Providers
Four first-class providers plus a generic OpenAI-compatible adapter with presets for OpenRouter, Groq, Together AI, Mistral, xAI, DeepSeek, Azure AI Foundry, and more. Switch between them with a single flag.
Overview
| Provider | Models | Auth | Offline |
|---|---|---|---|
| OpenAI | GPT-5.4, GPT-5.3-Codex | OPENAI_API_KEY |
No |
| Anthropic | Claude Opus 4.6, Claude Sonnet 4.6 | ANTHROPIC_API_KEY |
No |
| Google Vertex AI | Gemini 3.1 Pro, Gemini 3.1 Flash | ADC + GOOGLE_CLOUD_PROJECT |
No |
| Ollama | Llama 3, CodeLlama, Mistral, etc. | None (local) | Yes |
| Custom (OpenAI-compatible) | Any OpenAI-compatible endpoint - presets for OpenRouter, Groq, Together, Mistral, xAI, Fireworks, DeepSeek, Perplexity, Cerebras, Cohere, Azure AI Foundry | base_url + API key |
No |
Switching Providers
$ codesight review file.py --provider openai
$ codesight review file.py --provider anthropic
$ codesight review file.py --provider google
$ codesight review file.py --provider ollama
$ codesight review file.py --provider openrouter # any custom label you saved in config
The --provider flag accepts any label saved in ~/.codesight/config.json. After codesight config picks a custom provider, the label you chose (e.g. openrouter, groq, azure) becomes the provider name.
OpenAI
Best overall accuracy for code analysis. Default provider.
$ export OPENAI_API_KEY="sk-..."
$ export CODESIGHT_MODEL="gpt-5.4" # optional, default
Approximate cost: $0.002-0.005 per file depending on file size.
Anthropic
Strong at nuanced reasoning and catching subtle logic bugs.
$ export ANTHROPIC_API_KEY="sk-ant-..."
$ export CODESIGHT_MODEL="claude-opus-4-6-20251101"
Google Vertex AI
Requires a Google Cloud project with Vertex AI API enabled.
$ export GOOGLE_CLOUD_PROJECT="my-project"
$ export GOOGLE_CLOUD_REGION="us-central1"
$ gcloud auth application-default login
Ollama (Local / Offline)
No API key. No data leaves your machine. Fits sensitive codebases.
$ ollama serve
$ ollama pull llama3
$ codesight review file.py --provider ollama
Custom / OpenAI-Compatible Providers
Works with any endpoint that speaks the OpenAI Chat Completions API. That covers most of the ecosystem: OpenRouter's model aggregator, fast inference on Groq and Cerebras, Azure AI Foundry deployments, and open-source hosts like Together, Fireworks, DeepSeek, Perplexity, and Mistral.
Built-in Presets
The codesight config wizard ships ready-made entries for:
| Preset | Base URL | Default Model |
|---|---|---|
| OpenRouter | https://openrouter.ai/api/v1 | meta-llama/llama-4-maverick |
| Groq | https://api.groq.com/openai/v1 | llama-3.3-70b-versatile |
| Together AI | https://api.together.xyz/v1 | meta-llama/Llama-3-70b-chat-hf |
| Mistral | https://api.mistral.ai/v1 | mistral-large-latest |
| xAI (Grok) | https://api.x.ai/v1 | grok-3 |
| Fireworks AI | https://api.fireworks.ai/inference/v1 | llama-v3p1-70b-instruct |
| DeepSeek | https://api.deepseek.com | deepseek-chat |
| Perplexity | https://api.perplexity.ai | llama-3.1-sonar-large-128k-online |
| Cerebras | https://api.cerebras.ai/v1 | llama3.1-70b |
| Cohere | https://api.cohere.ai/compatibility/v1 | command-r-plus |
| Azure AI Foundry | Your resource URL | Your deployment name |
| Custom URL | Anything OpenAI-compatible | Any model ID |
Interactive Setup
Run the config wizard and pick Custom:
$ codesight config
Select a provider: Custom (OpenRouter / Groq / Together / any OpenAI-compat)
Pick a provider: OpenRouter
Base URL: https://openrouter.ai/api/v1
API key: sk-or-v1-...
Model name: meta-llama/llama-4-maverick
Config label: openrouter
The label you pick (e.g. openrouter) becomes the provider name you pass to --provider.
Example Usage
$ codesight review file.py --provider openrouter
$ codesight security src/auth.py --provider groq
$ codesight bugs lib/parser.py --provider azure
Config File Example
Saved entries land in ~/.codesight/config.json. Edit the file directly if needed:
{
"default_provider": "openrouter",
"providers": {
"openrouter": {
"provider": "custom",
"api_key": "sk-or-v1-...",
"base_url": "https://openrouter.ai/api/v1",
"model": "meta-llama/llama-4-maverick"
},
"groq": {
"provider": "custom",
"api_key": "gsk_...",
"base_url": "https://api.groq.com/openai/v1",
"model": "llama-3.3-70b-versatile"
}
}
}
Multi-Model Pipeline
Security analysis can chain two models - a fast local model for triage, then a cloud model for deep verification:
$ codesight security src/auth.py --pipeline ollama/llama3:openai/gpt-5.4
Triage flags potential issues fast. Only flagged areas go to the verifier, cutting cost and latency.
Configuration File
Provider settings are stored in ~/.codesight/config.json:
{
"default_provider": "openai",
"providers": {
"openai": {
"provider": "openai",
"api_key": "sk-...",
"model": "gpt-5.4",
"max_tokens": 4096,
"temperature": 0.2
},
"openrouter": {
"provider": "custom",
"api_key": "sk-or-v1-...",
"base_url": "https://openrouter.ai/api/v1",
"model": "meta-llama/llama-4-maverick"
}
}
}