Baltor Get started

Endpoints

MLX LM

A local runtime you install and run on your own hardware. This page lists the addresses it answers, the facts its documentation states, and the setup of each harness.

Addresses and facts

Start it

mlx_lm.server --model {mlx_repository}

Runs on Apple silicon. The project says its server is not meant for production.

Harness setup

Replace <model> with the model you want.

OpenCode

Put this in opencode.json in your project folder:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "mlx-lm": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "MLX LM",
      "options": {
        "baseURL": "http://localhost:8080/v1"
      },
      "models": {
        "<model>": {
          "name": "<model>"
        }
      }
    }
  }
}
  • OpenCode reads any OpenAI-compatible address through the @ai-sdk/openai-compatible package, and an address that speaks the Responses API through @ai-sdk/openai.

From OpenCode documentation, read .

Pi

Put this in ~/.pi/agent/models.json:

{
  "providers": {
    "mlx-lm": {
      "baseUrl": "http://localhost:8080/v1",
      "api": "openai-completions",
      "apiKey": "local",
      "models": [
        {
          "id": "<model>"
        }
      ]
    }
  }
}
  • The apiKey field can name an environment variable as $NAME.

From Pi documentation, read .

Codex

Codex speaks only the Responses API, and MLX LM documents no Responses address. A gateway that offers one can sit in between.

  • Codex speaks the Responses API only: responses is the one supported wire API of a custom provider. Ollama and LM Studio are built in and start with --oss.

From Codex documentation, read .

Claude Code

Claude Code sends Anthropic Messages requests, and MLX LM documents no such address. A gateway that translates to that API can sit in between.

  • Claude Code sends Anthropic Messages requests to ANTHROPIC_BASE_URL. Anthropic says it does not support routing Claude Code to models other than Claude through any gateway, so some features may not work with another model.

From Claude Code documentation, read .