Configuration¶
Config File Location¶
Perspt searches for configuration in this order:
--config <path>(CLI flag)~/.config/perspt/config.jsonEnvironment variables
Auto-detection
Config File Format¶
{
"default_provider": "gemini",
"default_model": "gemini-3.1-flash-lite-preview",
"api_key": "AIza...",
"provider_type": "gemini",
"providers": {
"openai": {
"api_key": "sk-xxx",
"default_model": "gpt-4.1"
},
"anthropic": {
"api_key": "sk-ant-xxx",
"default_model": "claude-sonnet-4-20250514"
}
}
}
Environment Variables¶
Variable |
Provider |
Priority |
|---|---|---|
|
Anthropic |
Highest |
|
OpenAI |
2 |
|
Gemini |
3 |
|
Groq |
4 |
|
Cohere |
5 |
|
xAI |
6 |
|
DeepSeek |
7 |
(none) |
Ollama |
Fallback |
Note
When multiple keys are set, the highest-priority provider is used. Override
with --provider-type.
CLI Flag Override¶
CLI flags always take precedence:
# Override provider
perspt chat --provider-type openai --model gpt-4.1
# Override API key
perspt chat --api-key "sk-xxx"
# Use a specific config file
perspt chat --config /path/to/config.json
Logging Configuration¶
# Default: error-level logging only (avoids TUI noise)
perspt
# Enable debug logging with RUST_LOG
RUST_LOG=debug perspt simple-chat
# Agent LLM logging to DuckDB
perspt agent --log-llm -w . "Task"