Providers#
PacketCode supports hosted APIs, a Codex CLI sign-in, local Ollama, Sugar and custom OpenAI-compatible endpoints.
Before you start#
- A model identifier supported by the selected service.
- A service credential where required.
- Network access to the endpoint, or a running local model server.
Built-in provider slugs#
sugar, openai, codex, anthropic, gemini, minimax, deepseek,
grok, mistral, openrouter and ollama are built in. codex reuses the
Codex CLI credential store. ollama is keyless. Other hosted providers require
their own API key.
Provider keys can be saved in config.toml or supplied through
PACKETCODE_<PROVIDER>_API_KEY. Environment variables are preferable for
temporary and automated environments because they keep secrets out of the
configuration file.
Custom compatible endpoint#
[providers.localai]
type = "openai_compatible"
display_name = "LocalAI"
base_url = "http://localhost:8080/v1"
default_model = "coder-large"
api_key_required = false
For a hosted custom endpoint, set api_key_env to the name of the environment
variable that contains its token. Add custom headers only when the service
requires them and never put a secret header in a shared project file.
Sugar sign-in#
The Sugar subcommand requires the current source build described on
Install; packaged release v0.5.1 does not include it.
Use packetcode sugar login to authorise against a Sugar service, then select
the sugar provider. Use the command's --server option for a nondefault
service URL.
Verify#
Run packetcode doctor, start a new session and send a short prompt. Confirm the
response metadata names the intended provider and model. Stop if a local setup
unexpectedly sends traffic to a public endpoint.