PacketCodeDocs

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 is available from v0.6.0. 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.

For a Sugar coding task, start PacketCode in the process environment prepared by Sugar's task bridge. A current source build reads SUGAR_TASK_API_ROOT and routes the Sugar provider through that task's local endpoint for the lifetime of the process. Use the exact value supplied by the bridge; an invalid value stops provider requests rather than silently sending an untracked task to the normal service. Remove it before starting an unrelated session.

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.