Skip to main content

Providers

TF Code supports multiple AI providers alongside ToothFairyAI. Use tfcode providers list to see which are configured, and tfcode models to see available models.

ToothFairyAI (Default)

ToothFairyAI is the default provider. Set it up via tfcode setup or environment variables:

tfcode setup

Or:

export TF_WORKSPACE_ID="your-workspace-id"
export TF_API_KEY="your-api-key"
export TF_REGION="au"

No additional provider configuration needed — credentials from your profile, environment, or config are resolved automatically.

Add Another Provider

Add providers in your tfcode.json:

{
"provider": {
"anthropic": {
"type": "api",
"key": "your-anthropic-key"
}
}
}

Or use environment variables when available (e.g. ANTHROPIC_API_KEY, OPENAI_API_KEY).

Select a Model

Use --model <provider>/<model-id> format:

tfcode run "Review this PR" --model anthropic/your-model-id
tfcode run "Explain this code" --model toothfairyai/your-model-id

In the TUI, use /models to browse and select.

Set a default in your config:

{
"model": "toothfairyai/mystica"
}

Discover Models

tfcode models # All available models
tfcode models toothfairyai # Models for a specific provider
tfcode models --verbose # Include metadata like costs
tfcode models --refresh # Refresh the cache
tfcode providers list # List configured providers

Provider Options

Providers support timeout, chunkTimeout, and setCacheKey options:

{
"provider": {
"anthropic": {
"options": {
"timeout": 600000,
"chunkTimeout": 30000
}
}
}
}

Model Loading Order

  1. --model / -m CLI flag
  2. model in config file
  3. Last used model
  4. Internal priority