OpenAI-compatible · function calling · 100% local

Use Outlier as the engine behind your tools

Outlier exposes a standard /v1/chat/completions API on your own Mac. Point Cursor, LangChain, LiteLLM, Codex, or anything built on the OpenAI SDK at it — same code you already have, but the model runs locally and nothing leaves your machine.

1 · Turn it on

In Outlier: Settings → Advanced → Developer → OpenAI-compatible API. Flip the toggle and copy your endpoint and API key. The endpoint is loopback-only (http://127.0.0.1:8766/v1) — nothing is exposed to your network.

2 · OpenAI SDK — drop-in

from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:8766/v1",
    api_key="YOUR-OUTLIER-KEY",   # Settings → Developer
)

r = client.chat.completions.create(
    model="outlier-nano",          # or outlier-lite / core / code / plus
    messages=[{"role": "user", "content": "Three taglines for a coffee truck"}],
)
print(r.choices[0].message.content)

Streaming, max_tokens, temperature, and finish_reason behave like the reference API.

3 · Function calling (tools)

r = client.chat.completions.create(
    model="outlier-nano",
    messages=[{"role": "user", "content": "What's the weather in Paris?"}],
    tools=[{
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get current weather for a city",
            "parameters": {
                "type": "object",
                "properties": {"city": {"type": "string"}},
                "required": ["city"],
            },
        },
    }],
)
tc = r.choices[0].message.tool_calls[0]
print(tc.function.name, tc.function.arguments)
# → get_weather {"city": "Paris"}

Run your function, then send the result back as a role:"tool" message — multi-turn tool loops work the way the OpenAI docs describe, including streaming (delta.tool_calls, finish_reason:"tool_calls").

4 · LangChain

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    base_url="http://127.0.0.1:8766/v1",
    api_key="YOUR-OUTLIER-KEY",
    model="outlier-nano",
).bind_tools(my_tools)

msg = llm.invoke("What's the weather in Berlin?")
print(msg.tool_calls)

5 · Cursor / Continue

In the model settings, add a custom OpenAI-compatible model: base URL http://127.0.0.1:8766/v1, your Outlier key, model outlier-code (the coding tier) or outlier-nano for speed.

6 · Codex CLI

# ~/.codex/config.toml
model = "outlier-code"
model_provider = "outlier"

[model_providers.outlier]
name = "Outlier (local)"
base_url = "http://127.0.0.1:8766/v1"
env_key = "OUTLIER_API_KEY"
wire_api = "chat"   # Outlier serves chat completions, not the Responses API
export OUTLIER_API_KEY="YOUR-OUTLIER-KEY"
codex

7 · LiteLLM

import litellm
r = litellm.completion(
    model="openai/outlier-nano",
    api_base="http://127.0.0.1:8766/v1",
    api_key="YOUR-OUTLIER-KEY",
    messages=[{"role": "user", "content": "hi"}],
)
Privacy note: requests to this endpoint are handled entirely on your Mac by the locally-running model. Your prompts, code, and tool results never leave your machine.

← outlier.host