LM Studio Bionic telemetry.
Route LM Studio's local OpenAI-compatible API through a small proxy that sends logs, metrics, and traces to Observagent.
What this integration covers
Use this setup when your client can point at an OpenAI-compatible base URL. Keep the proxy on the same machine as LM Studio and send the client to http://127.0.0.1:1235/v1.
Minimum required plan
LM Studio / Bionic Free (local models).
- This guide uses a loaded local model and the local API server. Bionic+ and Pro are optional cloud-inference plans.
Requirements reviewed on .
Integration steps
Select a platform to see commands and paths for your computer. Project setup and delivery verification are shared across platforms.
- Step 1
Start the LM Studio API
Load a model, start the local server, and verify port 1234.
- Download and load a model before starting the local API server.
- The models response confirms that the OpenAI-compatible endpoint is reachable on port 1234.
PowerShelllms server start Invoke-WebRequest http://127.0.0.1:1234/v1/models - Step 2
Install the proxy environment
Clone the public Observagent repository and install its dependencies.
- Place lmstudio_proxy.py and the optional verifier in the working directory before starting the proxy.
- The virtual environment keeps FastAPI and OpenTelemetry dependencies isolated from other Python projects.
PowerShellgit clone https://github.com/Observagent/observagent-lmstudio-proxy.git cd observagent-lmstudio-proxy python -m venv .venv .\.venv\Scripts\Activate.ps1 pip install -r requirements.txt - Step 3
Configure and start the proxy
Set credentials in the same terminal that starts the proxy.
- Replace YOUR_PROJECT_KEY with a key that can write logs, metrics, and traces.
- Keep these variables and the proxy process in the same terminal session.
- A successful start reports that Uvicorn is listening on http://127.0.0.1:1235.
PowerShell$env:OBSERVAGENT_ENDPOINT = "https://dashboard.observagent.cloud" $env:OBSERVAGENT_API_KEY = "YOUR_PROJECT_KEY" $env:OBSERVAGENT_SESSION_ID = "lmstudio-bionic-local" $env:LMSTUDIO_UPSTREAM = "http://127.0.0.1:1234" python -m uvicorn lmstudio_proxy:app --host 127.0.0.1 --port 1235 - Step 4
Route a request and verify
Point your OpenAI-compatible client at http://127.0.0.1:1235/v1, complete one request, then verify logs, metrics, and traces separately in Observagent.
- Configure the calling application’s base URL as http://127.0.0.1:1235/v1; port 1234 bypasses telemetry.
- Complete one model request, then inspect logs, metrics, and traces independently in Observagent.
- The proxy records operational metadata and does not intentionally add prompt or response content to telemetry.
PowerShellpython .\verify_delivery.py
Start the local LM Studio API
Install LM Studio, download a model, and start its local server. The documented default is port 1234.
lms server start
# Verify the OpenAI-compatible endpoint
Invoke-WebRequest http://127.0.0.1:1234/v1/modelsIn LM Studio, the same server can be started from the Developer / Local Server controls. If you enable API authentication, save the token for the proxy environment below.
Install the proxy environment
Run these commands in PowerShell. Keep this terminal for the proxy process.
git clone https://github.com/Observagent/observagent-lmstudio-proxy.git
cd observagent-lmstudio-proxy
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtDownload lmstudio_proxy.py into this folder, or use the copy in the downloads above. The included test file can be run before configuration.
python test_lmstudio_proxy.pyCreate a project key
In Observagent, create or choose a project. Enable Logs, Metrics, and Traces, enable monitoring, and use Connect source to generate a project key with telemetry write access. A new key replaces other keys for that project only; other projects remain unchanged.
If project key creation is unavailable, contact your Observagent administrator or support channel. This is a server-side account or deployment issue, not an LM Studio client setting.
Configure endpoints and credentials
Set the backend base URL, project key, session ID, and the local LM Studio upstream. Use the base URL without /v1/logs; the proxy appends all three paths.
$env:OBSERVAGENT_ENDPOINT = "https://dashboard.observagent.cloud"
$env:OBSERVAGENT_API_KEY = "YOUR_OBSERVAGENT_PROJECT_KEY"
$env:OBSERVAGENT_SESSION_ID = "lmstudio-bionic-local"
$env:LMSTUDIO_UPSTREAM = "http://127.0.0.1:1234"
# Only if LM Studio authentication is enabled:
$env:LMSTUDIO_API_TOKEN = "YOUR_LM_STUDIO_TOKEN"Never commit the key or token. The proxy emits three independent OTLP HTTP exports: /v1/logs, /v1/metrics, and /v1/traces.
Start the proxy and route your client
python -m uvicorn lmstudio_proxy:app --host 127.0.0.1 --port 1235Point an OpenAI-compatible client at http://127.0.0.1:1235/v1. For example:
$body = @{ model = "your-loaded-model"; messages = @(@{ role = "user"; content = "Reply with the word telemetry." }); stream = $false } | ConvertTo-Json -Depth 5
Invoke-RestMethod -Uri http://127.0.0.1:1235/v1/chat/completions -Method Post -ContentType "application/json" -Body $bodyThe proxy supports chat completions, completions, embeddings, and model listing. Requests sent directly to port 1234 bypass telemetry.
Verify logs, metrics, and traces
Watch the proxy terminal for completed requests. Then open Telemetry Data in the project and filter for the recent lmstudio-api source. Check Logs, Metrics, and the project's trace history separately; one signal arriving does not prove the other two arrived.
python verify_delivery.pyThe check sends one synthetic record to each endpoint. It should report HTTP 200 and a saved count for each signal. An empty protobuf request returning status: ok, count: 0 tests endpoint access only.
Understand the privacy boundary
The proxy exports route, model, status, duration, token usage when supplied by LM Studio, and error metadata. It does not add prompt or response content to telemetry. The request still travels through the local proxy and LM Studio, so follow your retention and access policies.
lms log stream can include exact input and output. This integration intentionally does not forward that diagnostic stream. Capture it separately only after a privacy review.Troubleshoot delivery
- Proxy starts but no records: confirm the client uses port 1235 and that the three environment variables are set in the same terminal.
- 401 from LM Studio: set
LMSTUDIO_API_TOKENonly when local API authentication is enabled. - 401/403 from Observagent: check the project key, signal toggles, and base URL. Do not append an extra
/v1toOBSERVAGENT_ENDPOINT. - Logs arrive but metrics/traces do not: check all three project signals and allow the exporter to flush after a request.
- Bionic activity is missing: this proxy cannot see built-in chats, cloud sessions, or requests that do not use its local API URL.
See the complete README for references and recovery steps.