Agent guide · rapid-mlx 0.10.3 · ← Back to README

gpt-oss (OpenAI SDK direct)

gpt-oss is the open-weight reasoning model family from OpenAI, native to the Harmony format (channel-aware analysis + final). It has no dedicated agent CLI — instead, use the plain OpenAI Python SDK against rapid-mlx's /v1/chat/completions and let the server's harmony tool + reasoning parsers handle the dual-channel output.

Wire: /v1/chat/completions (OpenAI Python SDK) · Setup: pass base_url + api_key="not-needed" to the SDK · Matrix column: gpt-oss serves as the fourth Tier-1 family — every agent / framework row has a gpt-oss cell on the integration matrix.

Install

$ pip install openai

Serve gpt-oss

$ rapid-mlx serve gpt-oss-20b-mxfp4-q8 \
    --tool-call-parser harmony \
    --reasoning-parser harmony \
    --enable-auto-tool-choice

Both parsers must be harmony — the model emits <|channel|>analysis for its CoT and <|channel|>final for the user-visible answer. Without --reasoning-parser harmony the analysis channel leaks into content.

OpenAI SDK config

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="not-needed",
)

resp = client.chat.completions.create(
    model="default",
    messages=[{"role": "user", "content": "Say hello"}],
)
print(resp.choices[0].message.content)

Tool calling

The exact tool-call round-trip the integration matrix runs against every gpt-oss cell (_run_openai_tool_smoke):

resp = client.chat.completions.create(
    model="default",
    messages=[{"role": "user",
               "content": "What's the weather in Tokyo? Use the get_weather tool."}],
    tools=[{
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the weather for a city.",
            "parameters": {
                "type": "object",
                "properties": {"city": {"type": "string"}},
                "required": ["city"],
            },
        },
    }],
    temperature=0.0,
    max_tokens=384,
)
tc = resp.choices[0].message.tool_calls[0]
# tc.function.name == "get_weather", json.loads(tc.function.arguments) == {"city": "Tokyo"}

Harmony features

Gotchas

See also