Local API integration · Windows · macOS · Linux

LM Studio Bionic telemetry.

Route LM Studio's local OpenAI-compatible API through a small proxy that sends logs, metrics, and traces to Observagent.

LM Studio127.0.0.1:1234
Proxy127.0.0.1:1235
Observagentlogs · metrics · traces
How it works

What this integration covers

Local API requests onlyLM Studio documents a local model API, but this guide does not claim a native app-wide Bionic OTLP exporter. The proxy captures requests routed through it. It does not automatically capture Bionic internal events, built-in chats, cloud sessions, GPU statistics, or requests sent directly to another host.

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.

Before you begin

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.
Observagent accessPrepare an Observagent project with monitoring and the required signals enabled, plus a valid project key with telemetry:write permission.

Requirements reviewed on .

Select OS

Integration steps

Select a platform to see commands and paths for your computer. Project setup and delivery verification are shared across platforms.

WindowsPowerShell
  1. 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.
    PowerShell
    lms server start
    Invoke-WebRequest http://127.0.0.1:1234/v1/models
  2. 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.
    PowerShell
    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.txt
  3. 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
  4. 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.
    PowerShell
    python .\verify_delivery.py
1 · LM Studio

Start the local LM Studio API

Install LM Studio, download a model, and start its local server. The documented default is port 1234.

LM Studio terminal
lms server start

# Verify the OpenAI-compatible endpoint
Invoke-WebRequest http://127.0.0.1:1234/v1/models

In 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.

2 · Proxy

Install the proxy environment

Run these commands in PowerShell. Keep this terminal for the proxy process.

PowerShell
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.txt

Download lmstudio_proxy.py into this folder, or use the copy in the downloads above. The included test file can be run before configuration.

PowerShell
python test_lmstudio_proxy.py
3 · Observagent

Create 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.

4 · Environment

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.

PowerShell
$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.

5 · Run

Start the proxy and route your client

PowerShell
python -m uvicorn lmstudio_proxy:app --host 127.0.0.1 --port 1235

Point an OpenAI-compatible client at http://127.0.0.1:1235/v1. For example:

PowerShell smoke test
$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 $body

The proxy supports chat completions, completions, embeddings, and model listing. Requests sent directly to port 1234 bypass telemetry.

6 · Delivery

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.

Optional delivery check
python verify_delivery.py

The 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.

7 · Data handling

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.

Do not treat logs as a transcriptLM Studio's diagnostic 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.
8 · Help

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_TOKEN only when local API authentication is enabled.
  • 401/403 from Observagent: check the project key, signal toggles, and base URL. Do not append an extra /v1 to OBSERVAGENT_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.