Skip to content

Model providers

Cantus loads a chat model from a single provider/model string via load_chat_model. Eight provider prefixes are supported; the prefix selects the adapter, and the part after the slash is passed through as the model id.

PrefixBackendNotes
openaiOpenAI APIGPT-class models; tool use supported.
anthropicAnthropic APIClaude family; tool use supported.
googleGoogle Gemini (google-genai)Gemini models; tool use supported.
groqGroq APIFast hosted inference; tool use supported.
nvidiaNVIDIA NIM (OpenAI-compatible)Uses the OpenAI client against an NVIDIA endpoint.
ollamaLocal Ollama (OpenAI-compatible)Runs a local daemon; no API key required.
mlxIn-process Apple Silicon (mlx-lm)macOS/arm64 only; text generation without tool use.
omlxLocal OpenAI-compatible MLX serverTalks to a local mlx-omni-server; base_url required.
python
from cantus.model import load_chat_model

model = load_chat_model("openai/gpt-4o-mini")
# swap the prefix to change backends without touching the rest of your code:
# load_chat_model("anthropic/claude-3-5-sonnet-latest")
# load_chat_model("ollama/llama3.1")
# load_chat_model("mlx/mlx-community/SmolLM-135M-Instruct-4bit")

Each adapter lazily imports its SDK and raises an actionable ImportError naming the extra to install (for example pip install cantus-agent[openai]) when the backend is requested without its dependency.