Code Generation
AI coding agents and coding assistants such as Visual Studio Code Copilot Chat, OpenCode, Claude Code, and Codex normally send every request — including your source code — to the cloud service of their vendor. If your code must not leave your own infrastructure, you can point these tools at adito-code, a coding model served by the ADITO AI Runtime. All requests then stay on ADITO Cloud infrastructure in Germany, and no data is sent to external AI services.
This guide shows how to configure these tools so the self-hosted model is available on demand, without breaking your regular vendor-hosted setup.
Prerequisites
- An ADITO AI API key. Managed cloud systems receive a system API key at startup; if you need a personal key, contact the AI team.
- One of the supported clients installed: Visual Studio Code with Copilot Chat, OpenCode, Claude Code (current version), or Codex 0.143 or later.
Keep your API key confidential. Do not commit it to repositories or expose it in client-side code.
Model
| Model ID | adito-code |
| Base model | Qwen/Qwen3.6-35B-A3B |
| Hosting | ADITO Cloud infrastructure, Germany |
| Base URL | https://ai.adito.cloud |
| Interfaces | OpenAI-compatible Chat Completions API (used by Visual Studio Code Copilot Chat and OpenCode), Anthropic Messages API (used by Claude Code), OpenAI Responses API (used by Codex) |
| Context window | 262,144 tokens (prompt and response combined) |
adito-code currently shares its base model family with the adito-llm-brizo text-generation codename, but the two are quantized, tuned, and served differently for their respective use cases.
Code generation follows the same naming and deprecation scheme as the other model kinds, with one restriction: adito-code is served through its floating alias only, so there is no pinned codename to fix the version against yet. See Model naming and versioning.
Default request parameters
Coding agents set most generation parameters themselves, so these defaults mainly apply to direct API calls and to agents that leave a parameter unset. adito-code is not pinnable, so unlike the pinned text-generation codenames these defaults are not frozen and may change with a model update.
A value the agent or your request sends always wins over the default. Only the context window is a hard limit rather than something you can override.
Defaults for adito-code
| Parameter | Default | Description |
|---|---|---|
chat_template_kwargs.enable_thinking | false | Reasoning before the answer is off. Agents that support extended thinking can enable it per request. |
temperature | 0.6 | Sampling randomness. Tuned lower than the text-generation default for more precise code output. |
top_p | 0.95 | Nucleus sampling cutoff. |
top_k | 20 | Number of candidate tokens considered per step. |
min_p | 0.0 | Minimum probability threshold, relative to the most likely token. |
presence_penalty | 0.0 | No repetition penalty, so recurring code patterns are not suppressed. |
max_tokens | 32768 | Upper bound for the generated response. The launcher below caps it lower for interactive use. |
| Context window | 262144 | Hard limit for prompt and response combined. Not a request parameter. |
Visual Studio Code Copilot Chat
Visual Studio Code supports Bring Your Own Key (BYOK) language models in Copilot Chat. BYOK models are configured through the Language Models editor and then appear in the Chat model picker.
For background on the VS Code BYOK feature, see Use your own language model key in VS Code.
Add the model
- Open the Copilot Chat view in Visual Studio Code.
- In the model picker at the bottom of the Chat view, select Manage Models. Depending on the current VS Code layout, this option can also appear behind a gear icon.
- Select Add Models.
- Enter a display name, for example
ADITO AI, and enter the ADITO AI API key. - Set Default request/response format to Chat completions.
- Save the model configuration. Visual Studio Code opens a JSON configuration file that you must complete manually.
Configure the endpoint
Use the following configuration for the ADITO coding model:
[
{
"name": "ADITO AI",
"vendor": "customendpoint",
"apiKey": "${input:chat.lm.secret.<generated-id>}",
"apiType": "chat-completions",
"models": [
{
"id": "adito-code",
"name": "adito-code",
"url": "https://ai.adito.cloud/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 128000,
"maxOutputTokens": 16000
}
]
}
]
The following values are required:
| Field | Value |
|---|---|
apiType | chat-completions |
id | adito-code |
name | adito-code |
url | https://ai.adito.cloud/chat/completions |
toolCalling | true |
vision | true |
Do not replace the apiKey value with the plain API key. Visual Studio Code
stores the secret separately and references it through a generated placeholder,
for example ${input:chat.lm.secret.24e928a8}. Keep the placeholder that
Visual Studio Code generated for your local configuration.
Update the API key
If the API key changes, update the stored secret instead of editing the JSON file directly:
- Open Manage Models in Visual Studio Code.
- Select the configured ADITO AI model.
- Open the context menu for the model.
- Select Update API Key.
- Enter the new API key.
Command-line tools
The OpenCode, Claude Code, and Codex examples below expect your API key in the
ADITO_AI_API_KEY environment variable:
export ADITO_AI_API_KEY="your-api-key"
OpenCode
OpenCode reads provider configuration from an opencode.json file — either project-level (repo root) or global (~/.config/opencode/opencode.json).
Add ADITO AI as a custom provider:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"adito": {
"npm": "@ai-sdk/openai-compatible",
"name": "ADITO AI",
"options": {
"baseURL": "https://ai.adito.cloud/v1",
"apiKey": "{env:ADITO_AI_API_KEY}"
},
"models": {
"adito-code": {
"name": "adito-code"
}
}
}
}
}
Then select the model at invocation:
opencode -m adito/adito-code
adito is the provider key defined above, adito-code the model key nested under it. Plain opencode keeps using your regular provider.
Claude Code
Claude Code reads its API endpoint and credentials from environment variables at startup. Redirecting it to the ADITO AI Runtime therefore requires no changes to your Claude Code configuration files:
export ANTHROPIC_BASE_URL="https://ai.adito.cloud"
export ANTHROPIC_AUTH_TOKEN="$ADITO_AI_API_KEY"
claude --model adito-code
If you are also logged into Claude Code with your personal Anthropic account, Claude Code ignores ANTHROPIC_API_KEY and sends its own rotating login token to the endpoint instead, which the ADITO AI Runtime rejects with 401 Invalid proxy server token. ANTHROPIC_AUTH_TOKEN takes priority over the login and is sent as-is, so this conflict does not occur. It also skips the "Use it?" confirmation prompt that ANTHROPIC_API_KEY requires on first start.
Recommended: an opt-in launcher
Endpoint and authentication are fixed for the lifetime of a session. Exporting the variables globally would route all Claude Code sessions through the self-hosted model, including those you want to run against your regular Anthropic account. A small shell function keeps the setup opt-in:
# ~/.zshrc or ~/.bashrc
claude-adito-code() {
ANTHROPIC_BASE_URL="https://ai.adito.cloud" \
ANTHROPIC_AUTH_TOKEN="$ADITO_AI_API_KEY" \
ANTHROPIC_SMALL_FAST_MODEL="adito-code" \
ANTHROPIC_DEFAULT_HAIKU_MODEL="adito-code" \
ANTHROPIC_CUSTOM_MODEL_OPTION="adito-code" \
ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="ADITO Code" \
ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Self-hosted coding model" \
CLAUDE_CODE_MAX_CONTEXT_TOKENS="220000" \
CLAUDE_CODE_AUTO_COMPACT_WINDOW="220000" \
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE="60" \
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS="8000" \
CLAUDE_CODE_MAX_OUTPUT_TOKENS="16384" \
claude --model adito-code "$@"
}
The extra variables redirect Claude Code's background Haiku calls to adito-code (they would otherwise fail, since the ADITO AI Runtime doesn't serve Anthropic models) and register the model in the /model picker.
claude-adito-code starts a fully self-hosted session; plain claude keeps using your regular setup. Additional arguments are passed through, for example claude-adito-code -c to continue a previous conversation.
Claude Code has no per-model endpoint routing. Switching models inside a session only changes the model ID sent to the endpoint the session started with — you cannot use Anthropic models and adito-code in the same session.
Codex
Codex supports layered configuration profiles: codex --profile <name> loads ~/.codex/<name>.config.toml on top of your base configuration. Your existing ~/.codex/config.toml stays untouched.
Create ~/.codex/adito-code.config.toml:
# Top-level keys must come before the first table header.
model = "adito-code"
model_provider = "adito"
[model_providers.adito]
name = "ADITO AI Runtime"
base_url = "https://ai.adito.cloud"
wire_api = "responses"
env_key = "ADITO_AI_API_KEY"
Then start Codex with the profile:
codex --profile adito-code
Plain codex keeps using your regular provider and login.
At startup, Codex may log failed to refresh available models errors and a Model metadata for adito-code not found warning. Both are caused by Codex expecting vendor-specific metadata that third-party endpoints do not provide. Requests work regardless.
Verifying the command-line setup
Run a one-shot prompt through each command-line tool:
opencode run -m adito/adito-code "Reply with: OK"
claude-adito-code -p "Reply with: OK"
codex --profile adito-code exec "Reply with: OK"
Codex prints a session header that shows adito-code as the active model and adito as the provider.
See also: AI Models | Text Generation | AI Compliance