Skip to content

Switching Models and Providers

NeoCode supports multiple model providers and lets you switch between them at any time.

Built-in providers

ProviderEnvironment variable
openaiOPENAI_API_KEY
geminiGEMINI_API_KEY
openllAI_API_KEY
qiniuQINIU_API_KEY

Switching in the TUI

Select a different provider or model from the interactive menu inside NeoCode. The selection is saved to ~/.neocode/config.yaml.

Adding a custom provider

For any OpenAI-compatible API (enterprise gateways, local models), create:

text
~/.neocode/providers/<name>/provider.yaml

Example:

yaml
name: company-gateway
driver: openaicompat
api_key_env: COMPANY_GATEWAY_API_KEY
model_source: discover
base_url: https://llm.example.com/v1
chat_api_mode: chat_completions
chat_endpoint_path: /chat/completions
discovery_endpoint_path: /models

Manual model list

If the provider does not support model discovery, use model_source: manual:

yaml
name: company-gateway
driver: openaicompat
api_key_env: COMPANY_GATEWAY_API_KEY
model_source: manual
base_url: https://llm.example.com/v1
chat_endpoint_path: /chat/completions
models:
  - id: gpt-4o-mini
    name: GPT-4o Mini
    context_window: 128000

Field reference

FieldDescription
nameProvider identifier, used in selected_provider
driverDriver type. Currently supports openaicompat
api_key_envEnvironment variable name for the API key
model_sourcediscover (auto) or manual (explicit list)
base_urlService base URL
chat_api_modechat_completions or responses
chat_endpoint_pathChat endpoint path
discovery_endpoint_pathModel discovery path (discover mode only)

A compact docs entrypoint built from NeoCode's current implementation.