Skip to main content

Courier OS SDK

The Courier OS SDK offers robust tools for building programmatic agents in Python using OpenAI-compatible APIs or for licensed builders running local agents on Apple Silicon using our proprietary and industry leading infrastructure.

Install: pip install courier-os
Import: import courier_os

Dual mode

Mode How Needs binary + license?
API Model("gpt-4o", api_key="…", base_url="…") No
Local Model("mlx-community/…", mode="local") Yes (courier-os[local])
from courier_os import Model, Agent, Operator, tools

@tools.tool
def get_weather(city: str) -> dict:
    """Get weather for a city."""
    return {"city": city, "temp_f": 72}

# Cloud / any OpenAI-compatible endpoint
model = Model("gpt-4o", api_key="…", base_url="https://api.openai.com/v1")

# Or local MLX (requires courier-os-binary on Apple Silicon)
# model = Model("mlx-community/Qwen3.5-2B-MLX-8bit", mode="local")
# if not model.can_load:
#     model = Model("gpt-4o", api_key="…", base_url="…")

agent = Agent(model, tools=[get_weather])
messages = [{"role": "user", "content": "Weather in Denver?"}]

# Agent — one model turn (you handle tool_calls if present)
resp = agent.chat(messages)
if resp.tool_calls:
    messages.append({"role": "assistant", "content": resp.content, "tool_calls": resp.tool_calls})
    messages.extend(agent.call_tools(resp.tool_calls))
    resp = agent.chat(messages)
print(resp.content)

# Operator — auto tool loop until the model finishes
out = Operator(agent).run([{"role": "user", "content": "Weather in Denver?"}])
print(out.content)

HTTP relay

from courier_os import relay

out = relay(
    model="gpt-4o",
    messages=[{"role": "user", "content": "hi"}],
    api_key="…",
    base_url="https://api.openai.com/v1",
    tools=[get_weather],
).response

Multimodal messages

OpenAI-shaped image/audio content parts work on both paths (local omni models extract media before inference):

messages = [{
    "role": "user",
    "content": [
        {"type": "text", "text": "What is in this image?"},
        {"type": "image_url", "image_url": {"url": "data:image/png;base64,…"}},
    ],
}]
Operator(agent).run(messages)

Local runtime

Local inference lives in the proprietary courier-os-binary package (not on public PyPI yet). In this monorepo:

cd playground && uv sync

That editable-installs courier-oscourier-os-binary.

Docs

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

courier_os-0.1.1.tar.gz (40.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

courier_os-0.1.1-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

Details for the file courier_os-0.1.1.tar.gz.

File metadata

  • Download URL: courier_os-0.1.1.tar.gz
  • Upload date:
  • Size: 40.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for courier_os-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5abb9d71811780e665f95ca2b9066b363360d7058e0186219c89730f90cdd7bb
MD5 fd10ffed250c747b986e6edfee865538
BLAKE2b-256 d1b26a2b16292cf24a271207fc48859bbfa83eb4b44a90cef44e9be25058a9f5

See more details on using hashes here.

File details

Details for the file courier_os-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: courier_os-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 49.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for courier_os-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa5feeb1292ec274b9c736ff033b4ccdadc303f17e7c6ffdde293b4ec167b419
MD5 80a6b9e8e18690ee9de1a33e1176809c
BLAKE2b-256 f9ef536480c7e6c54fdc4668a51ad135f1ceb67fc1fc13d4c82c4e9744e97a16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page