This document lists all environment variables that can be used to configure Code Puppy.
| Variable | Description | Default | Used In |
|---|---|---|---|
MODEL_NAME |
The model to use for code generation. Must match a key in the models.json configuration. | gpt-4o |
agent.py |
MODELS_JSON_PATH |
Optional path to a custom models.json configuration file. | Package directory models.json | agent.py |
GEMINI_API_KEY |
API key for Google's Gemini models. | None | model_factory.py |
OPENAI_API_KEY |
API key for OpenAI models. | None | model_factory.py |
CEREBRAS_API_KEY |
API key for Cerebras models. | None | model_factory.py |
When using custom endpoints (type: "custom_openai" in models.json), environment variables can be referenced in header values by prefixing with $ in models.json.
Example configuration in models.json:
"gpt-4o-custom": {
"type": "custom_openai",
"name": "gpt-4o",
"max_requests_per_minute": 100,
"max_retries": 3,
"retry_base_delay": 10,
"custom_endpoint": {
"url": "https://my.custom.endpoint:8080",
"headers": {
"X-Api-Key": "$OPENAI_API_KEY"
}
}
}In this example, $OPENAI_API_KEY will be replaced with the value from the environment variable.
# Use a specific model defined in models.json
export MODEL_NAME=gemini-2.5-flash-preview-05-20
code-puppy --interactive# Use a custom models.json file
export MODELS_JSON_PATH=/path/to/custom/models.json
code-puppy --interactive# Run in YOLO mode to bypass command confirmations (use with caution)
export YOLO_MODE=true
code-puppy --interactive# Set API keys for model providers
export OPENAI_API_KEY=sk-...
export GEMINI_API_KEY=...
export CEREBRAS_API_KEY=...
code-puppy --interactive