Skip to content

About

Default provider and model definitions for Crystal Code.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crystal Code Defaults

Default provider and model definitions for Crystal Code.

This repository holds the reference providers.json catalog: named endpoints, protocols, model ids, and per-model metadata such as context window, output limit, thinking efforts, and image input. Copy it into your Crystal home to extend the small starter set built into Crystal Code with the full catalog.

Crystal Code License: MIT

Get started · Catalog · How the file is used · File format · Maintenance

📦 What's in this repository

File Purpose
providers.json The default provider and model catalog

🚀 Get started

📥 1. Download the catalog

Crystal Code reads providers.json from its home directory: ~/.crystal/providers.json, or the directory named by CRYSTAL_HOME when that variable is set. On Windows the default home is %USERPROFILE%\.crystal.

Linux or macOS

mkdir -p ~/.crystal
curl --fail --location --show-error \
  https://raw.githubusercontent.com/YELANDAOKONG/CrystalCode.Defaults/master/providers.json \
  --output ~/.crystal/providers.json

Windows PowerShell

$crystalHome = "$env:USERPROFILE\.crystal"
New-Item -ItemType Directory -Force $crystalHome | Out-Null
Invoke-WebRequest `
  -Uri https://raw.githubusercontent.com/YELANDAOKONG/CrystalCode.Defaults/master/providers.json `
  -OutFile "$crystalHome\providers.json"

The download replaces an existing providers.json. Back up or merge a file you already customized before you overwrite it.

🔑 2. Set provider keys

Keys never belong in this file. Write each one in ~/.crystal/credentials.json under the provider name, or set <PROVIDER>_API_KEY for the process that starts the app. A provider entry can also name an environment variable with apiKeyEnvironment, as bigmodel does with ZHIPU_API_KEY. See Credentials in the user guide for the full lookup order.

🏁 3. Restart Crystal Code

Provider definitions are read at startup. Restart the app after the file changes, then select a model with /model, or start with --provider and --model.

🗂️ Catalog

Provider Protocols Base URI
deepseek deepseek https://api.deepseek.com/
openai openai https://api.openai.com/v1/
anthropic anthropic https://api.anthropic.com/v1/
gemini gemini https://generativelanguage.googleapis.com/v1beta/
moonshot openai https://api.moonshot.cn/v1/
siliconflow openai https://api.siliconflow.cn/v1/
bigmodel openai https://open.bigmodel.cn/api/paas/v4/
openrouter openai https://openrouter.ai/api/v1/
requesty openai https://router.requesty.ai/v1/
opencode-zen responses, anthropic, gemini, openai https://opencode.ai/zen/v1/
opencode-go responses, anthropic, openai https://opencode.ai/zen/go/v1/
commandcode openai, anthropic https://api.commandcode.ai/provider/v1/

A provider name can map to an array of entries when one service exposes several protocols or endpoints; opencode-zen, opencode-go, and commandcode use this form, and each model is routed to the protocol that owns it.

openai means OpenAI-compatible Chat Completions and responses is the OpenAI Responses API. deepseek, anthropic, gemini, and ollama are native protocols.

⚙️ How the file is used

  • Without this file, Crystal Code falls back to a small starter catalog: deepseek, openai, gemini, and ollama. The anthropic protocol is built in, but has no starter entry.
  • A providers.json in the Crystal home supplies the operator catalog and overlays the built-in one.
  • Models that are not listed in the effective catalog cannot be selected. There is no global context window.
  • When providers.json exists, the legacy providers object in config.json is ignored.

📄 File format

Top-level keys are provider names. Each value is one provider entry or an array of entries, in the same shape Crystal Code reads and writes.

Provider fields:

Field Meaning
protocol deepseek, openai, responses, anthropic, gemini, or ollama
baseUri Absolute API base URI; the adapter appends the protocol's chat path
models Table of selectable model ids
replayReasoningContent Replay provider reasoning content (DeepSeek always does this)
tokenLimit Chat Completions output field: max_tokens or max_completion_tokens
apiKeyEnvironment Environment variable name checked first for this provider
apiKey Literal, {env:NAME}, or {file:path}. Keep secrets out of this file
requiresApiKey Whether a missing key is an error (default true, except ollama)
organization / project Optional OpenAI organization and project

Model fields:

Field Meaning
contextWindow Required. Positive token window used for compaction and the status bar
maxTokens Optional positive output-token cap
thinking Whether the model accepts reasoning hints
thinkingEfforts Accepted effort names: minimal, low, medium, high, maximum
thinkingCanDisable Whether /thinking off is accepted (default true)
imageInput Whether the model may receive images (default false)
temperature Optional, 0 to 2
topP Optional, 0 to 1

The user guide covers protocols, examples, and credentials in full.

🤝 Maintenance

Maintainers can write a commit message and commit the current change with commit.sh. It runs crystal run in this repository. Extra arguments are appended to the task. The run skips external tools and the directory trust check, and it does not record the directory as trusted.

Update providers.json by hand when a provider adds, retires, or changes models. Crystal Code does not rewrite this file.

📄 License

MIT

About

Default provider and model definitions for Crystal Code.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages