AI Features
Use any OpenAI-compatible LLM to enhance metadata, search, and library discovery with the BYOK AI suite.
Comicarr includes an optional AI integration layer that works with any OpenAI-compatible endpoint — Ollama, LM Studio, OpenRouter, or any hosted provider. All AI features are hidden until you configure an API key. The app works fully without one.
Bring Your Own Key
Your API key is stored encrypted in config.ini and never exposed to the frontend. All LLM calls are proxied through the backend.
Setup
Configure your provider
Go to Settings > AI and enter your provider details:
| Field | Example |
|---|---|
| Base URL | http://localhost:11434/v1 (Ollama) |
| API Key | Your provider's API key |
| Model | llama3.2:latest |
Test the connection
Click Test Connection to verify Comicarr can reach your endpoint. A success badge confirms the model is reachable and responding.
Configure rate limits
Set limits that match your provider's capacity:
| Setting | Default | Description |
|---|---|---|
| Timeout | 30s | Max wait time per AI request |
| RPM Limit | 20 | Requests per minute (sliding window) |
| Daily Token Limit | 100,000 | Total tokens per day across all features |
Once configured, AI features activate automatically across the app.
Dashboard
The home page at / shows a dashboard with collection stats, recent downloads, and upcoming releases. When AI is configured, an AI Insights panel displays the activity feed — a real-time log of AI actions across all features.
The series list is now at /series.
Behind-the-Scenes AI
These features run automatically during normal library operations — no interaction required.
Filename Parsing Fallback
When Comicarr's regex-based parser fails to extract metadata from a filename, the LLM attempts structured extraction. Parsed results are validated against your monitored series before being accepted.
Search Query Expansion
When a search returns zero results, Comicarr generates alternate query formulations via the LLM and retries. Successful expansions are persisted so future searches benefit without additional AI calls.
Metadata Enrichment
During post-processing, blank Genre and AgeRating fields in ComicInfo.xml are filled using AI analysis of existing metadata. Enrichment is limited to these two fields to mitigate hallucination risk. Original values are stored in ai_metadata_history for revert.
Metadata Reconciliation
When ComicVine metadata conflicts with pre-existing ComicInfo.xml values, the LLM evaluates both sources and selects the best value per field. Decisions are logged with per-provider revert capability.
Interactive Features
Library Chat
A collapsible side panel lets you ask questions about your library in natural language. The chat maps your questions to parameterized query patterns — it queries your actual library data, not hallucinated answers.
Example queries:
- "What Spider-Man series do I have?"
- "Show me my most recent downloads"
- "Which issues am I missing from Saga?"
Responses stream in real-time via SSE. Conversations are capped at 20 messages.
Story Arc Generator
Generate cross-series reading orders from natural language descriptions. The AI creates reading orders enriched with ComicVine data and mapped against your library status, showing which issues you own and which are missing.
See Story Arcs for more on arc management.
Pull List Curation
AI-powered weekly suggestions based on your collection patterns. When you view the Weekly Pull List, Comicarr analyzes your library against the current week's releases and suggests titles you might want. Suggestions are cached per pull list update.
Safety Infrastructure
All AI features are designed to degrade gracefully:
- Circuit breaker — After consecutive failures (default: 5), the circuit opens and AI calls are skipped. It transitions to half-open after a cooldown period (default: 300s) and closes again on success.
- Rate limiting — Enforced per-minute and daily token budgets prevent runaway costs.
- Prompt injection defense — User-provided metadata is sanitized and wrapped with spotlighting delimiters before being sent to the LLM.
- Non-blocking — AI never blocks core library operations. If the circuit is open or a request times out, the operation continues without AI.
Monitoring
The AI Status section in Settings shows real-time metrics:
- Circuit breaker state (active / paused / error)
- Today's request count
- Today's token usage vs. daily limit
- RPM limit
The activity feed (visible on the dashboard and via the activity drawer) logs every AI action with feature type, latency, token usage, and success/failure status.
Log Tags
Filter Comicarr logs by these AI-specific tags:
| Tag | Feature |
|---|---|
[AI] | General AI operations |
[AI-PARSE] | Filename parsing |
[AI-SEARCH] | Search expansion |
[AI-ENRICH] | Metadata enrichment |
[AI-RECONCILE] | Metadata reconciliation |
[AI-ARC] | Story arc generation |
[AI-PULLLIST] | Pull list curation |
[DASHBOARD] | Dashboard data |
Disabling AI
Remove the API key from Settings > AI to instantly disable all AI features. No data migration is needed — the app reverts to fully non-AI operation. AI metadata history is preserved in the database for future use.
See the AI Configuration reference for all settings.