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: uv add courier-os or 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.2.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.2-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: courier_os-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 feb073ac2a138c65bceb8a6ecc558fd1541f8e4be3a2c2039cf7682a81dc4ac7
MD5 927767f675674829ff8598fb2327dbcf
BLAKE2b-256 f221bdf1104de4130ddc16448a9bfba2de63e06356f10766612558772dfd8ed1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: courier_os-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 762e6396a810346170601a21fca08857f84f4d814c1eaf31fc4d57131d44408e
MD5 0ee31b07da25e6efbac5b382d046ff37
BLAKE2b-256 a224acd272731de579203c413db89ae2b024efae1896d84a14e09f3e4f72288a

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 Sentry Error logging StatusPage Status page