Skip to content

Configuration

Global settings live at:

~/.config/anki-llm/config.json

Manage them through the CLI so values are validated and written atomically:

Terminal window
anki-llm config set model gpt-5-mini
anki-llm config get model
anki-llm config list
anki-llm config unset model
KeyValuePurpose
modelstringDefault LLM model
api_base_urlURLDefault OpenAI-compatible endpoint
reasoning_effortnon-empty stringDefault reasoning effort
gemini_thinking_enabledbooleanShow and request supported Gemini thinking; defaults to true
nerd_fontbooleanUse Nerd Font symbols in terminal interfaces
default_workspacepathWorkspace fallback outside a workspace directory
anki_connect_urlURLAnkiConnect endpoint override
tts_providerprovider IDDefault TTS provider
tts_voicevoice IDDefault TTS voice
tts_modelstringOpenAI TTS model or Amazon Polly engine
tts_formatstringDefault audio format
azure_tts_keysecretAzure Speech subscription key
azure_tts_regionregionAzure Speech region
google_tts_keysecretGoogle Cloud TTS API key
aws_tts_access_key_idsecretAWS access key ID for Polly
aws_tts_secret_access_keysecretAWS secret access key for Polly
aws_tts_regionregionAWS region for Polly

Global config has no LLM API key key. Prefer environment variables for all secrets, including TTS credentials, so they do not reside in config.json.

VariablePurpose
ANKI_LLM_API_BASE_URLGeneric compatible API endpoint
ANKI_LLM_API_KEYGeneric key, including OpenRouter and custom APIs
ANKI_LLM_REASONING_EFFORTReasoning effort override
OPENAI_API_KEYAuto-detected OpenAI key and OpenAI TTS fallback
GEMINI_API_KEYAuto-detected Google Gemini key
DEEPSEEK_API_KEYAuto-detected DeepSeek key
XAI_API_KEYAuto-detected xAI key
VariablePurpose
AZURE_TTS_KEYAzure Speech subscription key
AZURE_TTS_REGIONAzure Speech region
GOOGLE_TTS_KEYGoogle Cloud Text-to-Speech API key
AWS_ACCESS_KEY_IDAmazon Polly access key ID
AWS_SECRET_ACCESS_KEYAmazon Polly secret access key
AWS_SESSION_TOKENOptional AWS temporary-credential token
AWS_REGIONAmazon Polly region
AWS_DEFAULT_REGIONPolly region fallback when AWS_REGION is absent

See Models and TTS providers for provider-specific resolution rules.

A workspace contains prompts/ and can include anki-llm.yaml:

anki-llm.yaml
default_model: gemini-2.5-flash
reasoning_effort: low

The effective workspace is the workspace containing the current directory. When none contains it, default_workspace supplies a fallback. Its prompts/, note-types/, and anki-llm.yaml become available to workspace-aware commands.

Model precedence is CLI, workspace default_model, global model, then key-based detection. Reasoning effort precedence is CLI, environment, workspace, global, then unset. API base URL does not have a workspace key.

Read Use workspaces for initialization, discovery, prompt selection, and version-control patterns.

Terminal window
anki-llm config set model gpt-5-mini
anki-llm config set reasoning_effort low
anki-llm config set default_workspace ~/anki
anki-llm config set anki_connect_url http://192.168.1.100:8765
anki-llm config set gemini_thinking_enabled false

Inspect the resolved environment with:

Terminal window
anki-llm doctor
PathContents
~/.local/state/anki-llm/state.jsonEphemeral application state, including the last prompt
~/.local/state/anki-llm/logs/Automatic LLM session logs
~/.local/state/anki-llm/snapshots/Original field values from direct deck-processing runs
~/.local/state/anki-llm/note-type-snapshots/Backups created before note type pushes
~/.cache/anki-llm/tts/Content-addressed synthesized audio cache
<workspace>/note-types/<slug>/.sync-state.jsonLast-synced note type hash, locally gitignored

These paths assume the standard home directory layout used by the current implementation.