Skip to main content

Overview

LM Studio is a desktop application for running LLMs locally on Mac, Windows, and Linux. It exposes a local OpenAI-compatible server, making it a natural fit for development and testing workflows where you want Cognisafe’s safety scoring and observability without sending data to cloud providers.

Start the LM Studio server

In LM Studio, go to Local Server → load a model → click Start Server. By default it listens on http://localhost:1234/v1.

Proxy configuration

If running the Cognisafe proxy in Docker, use host.docker.internal (Mac/Windows) or your machine’s LAN IP (Linux) to reach the LM Studio server on the host.
If running the proxy directly on the same machine:

SDK setup

Copy the exact model identifier from the LM Studio UI — it includes the GGUF file variant (e.g. Q4_K_M). The proxy passes the model name through unchanged.

Docker Compose for local development

Add Cognisafe alongside LM Studio in a local docker-compose.yml:
Point your app at http://localhost:8080/v1 and LM Studio continues to run as normal on port 1234.

Typical dev workflow

  1. Load your model in LM Studio and start the local server
  2. Start the Cognisafe proxy pointing at localhost:1234
  3. Run your agent or app — all calls are logged and scored
  4. Open the Cognisafe dashboard to inspect prompts, responses, and safety scores
  5. When ready for production, change UPSTREAM_URL to your cloud LLM provider — no app code changes needed
LM Studio is ideal for testing your safety scorer configuration. You can replay adversarial prompts against a local model to verify your custom scorers fire correctly before deploying to production.