๐ฎ Coven
February 21, 2026 ยท View on GitHub
On-Premise/Offline Multi-LLM orchestration interface โ a "Council of Models" architecture where multiple LLMs deliberate on your query and a Chairman model synthesizes the best response, fully customizable and extensible.
more images below!
โจ Features
- ๐ค Council of Models โ Queries multiple LLMs in parallel (e.g., Llama 3, Mistral, Gemma, DeepSeek R1, etc.) to get diverse perspectives. Basically everything that is supported by Ollama offline can be used in Coven. Coven supports also the use of multiple Ollama instances or remote ones if you prefer.
- ๐ Chairman Synthesis โ A "superior" model aggregates all drafts into a single, high-quality response. The Chairman is also customizable and can be a different model from the council members.
- ๐ง Thinking Mode Support โ Full support for reasoning models (e.g., DeepSeek R1) with visualized thought traces in the "X-Ray" view.
- ๐๏ธ Multimodal Vision โ Upload images (PNG, JPG, WEBP) for analysis by vision-capable models (e.g., Llama 3.2 Vision). The UI automatically displays model capability badges (๐ผ๏ธ Vision, ๐ง Thinking, ๐งฐ Tools).
- ๐พ Persistent Memory & Export โ Chats are saved to disk (on linux and mac
~/.coven/chats/and on windowsC:\Users\<username>\.coven\chats\) and reloaded and restored on launch. Conversations can also be effortlessly exported to Markdown at any time. - ๐ Automatic Summarization โ Long conversations are compressed into concise summaries to maintain context without token overflow.
- ๐ Tool Calling โ Models can use tools like Web Search (DuckDuckGo) and current Time retrieval if enabled in the
coven.tomlconfiguration file. - ๐ Built-in RAG (Retrieval-Augmented Generation) โ Attach code, text, and PDFs. The application automatically chunks, embeds, and stores documents inside a local
Milvus Litevector database for each chat. Only the most mathematically relevant context is injected into the prompt, avoiding token limit overflow. - ๐ X-Ray UI โ A dedicated "Council Deliberation" expander lets you inspect raw drafts, peer critique revisions, retrieved context snippets from the vector store, and exact execution times and token counts per model.
- ๐ก๏ธ Robust Health Checks โ On startup, Coven verifies all configured Ollama URLs (even across multiple instances) and checks if the requested models are pulled, alerting you to unreachable hosts or missing models so you never infer blindly.
- โก Async & Streaming โ Fully asynchronous pipeline with real-time streaming of the final verdict.
- โ๏ธ Configurable โ Easy TOML configuration for models, parameters, pipelines, and tools.
graph TD
User([User Query]) --> FileIngest[File & History Ingestion]
FileIngest -->|Chunk & Embed| Milvus[(Milvus Vector DB)]
Milvus -->|Semantic Retrieval| Context{RAG Context}
User --> Context
Context -->|Summarization| Memory[Short-term Memory]
Context -->|Tool Execution| Tools[Web Search / Time]
subgraph Council [The Council]
M1[Model A]
M2[Model B]
M3[Model C]
end
Memory --> M1
Tools --> M1
Memory --> M2
Memory --> M3
M1 --> D1[Draft A]
M2 --> D2[Draft B]
M3 --> D3[Draft C]
D1 & D2 & D3 --> Critique{Critique Phase?}
Critique -->|Yes| Review[Peer Review & Revise]
Review --> FinalDrafts[Revised Drafts]
Critique -->|No| FinalDrafts[Drafts]
FinalDrafts --> Chairman[๐ Chairman]
Chairman -->|Stream| Response([Final Response])
-
Context Loading & RAG
- Memory: The system loads the last
Nturns of conversation. If the history is too long, it is automatically summarized by the Chairman to preserve token space. - Documents: Attached files (PDF, code, text) are parsed and indexed into a local Milvus vector database alongside chat history. The query triggers a semantic search, and only the most relevant snippets are passed to the models.
- Memory: The system loads the last
-
The Inquiry
- The query is broadcast to all Council Members in parallel.
- Tool Usage: If enabled, models can autonomously use tools like
web_searchorget_current_date_timeto fact-check or retrieve real-time data before answering. - Failure Tolerance: If a model crashes or doesn't support tools, it gracefully falls back to standard text generation or abstains without halting the pipeline.
-
The Critique (Optional)
- If
enable_critique = true, members review each other's drafts. - Each model sees the query + its own draft + other drafts, and generates a revised version of its answer.
- If
-
The Decree
- The Chairman reads all (revised) drafts.
- It synthesizes a final, authoritative response, resolving conflicts and merging the best insights from each member.
- The result is streamed to the UI in real-time.
Prerequisites
- Python 3.13+
- Ollama running locally or on a remote host
- Pull the models you want to use:
ollama pull llama3
ollama pull mistral
ollama pull gemma:2b
...
Quick Start
# Clone and enter the project
cd coven
# Install dependencies (requires uv)
uv sync --group dev
# Launch the app
.venv/bin/streamlit run src/coven/app.py
The UI opens at http://localhost:8501. A sidebar shows model availability status.
Configuration
All settings live in coven.toml at the project root:
[ollama]
default_url = "http://localhost:11434"
[chairman]
model = "llama3"
temperature = 0.5
# ollama_url = "http://gpu-server:11434" # optional override
[[members]]
model = "llama3"
temperature = 0.7
# ollama_url = "http://other-host:11434" # optional: override default
[[members]]
model = "mistral"
temperature = 0.7
# ollama_url = "http://other-host:11434" # optional: override default
[[members]]
model = "gemma:2b"
temperature = 0.7
# ollama_url = "http://other-host:11434" # optional override
[pipeline]
enable_critique = true # Models review each other's drafts before the final verdict
memory_turns = 5 # Number of recent turns to keep in full context
[tools]
enable_web_search = true # Enable DuckDuckGo search for models
Multi-Ollama Support & Health Checks
Each member or the chairman can point to a different Ollama instance via the optional ollama_url field. If omitted, it falls back to [ollama].default_url. This lets you spread models across multiple endpoints: your local computer, rented GPU servers, etc.
Coven rigorously checks these connections on startup. If an endpoint is unreachable, or if a model is missing on that specific instance, the UI will warn you precisely about which models and which URLs are experiencing issues.
Prompt Templates
Prompts live as plain text files in the prompts/ directory and can be edited without touching Python:
| File | Purpose |
|---|---|
prompts/member_system.txt | Member system instruction |
prompts/member_human.txt | Member query template ({query} + {history}) |
prompts/chairman_system.txt | Chairman system instruction |
prompts/chairman_human.txt | Chairman synthesis template ({query} + {drafts}) |
prompts/critique.txt | Template for peer review round |
prompts/summary_system.txt | Summarizer system instruction |
prompts/summary_human.txt | Summarization prompt ({history}) |
Project Structure
coven/
โโโ coven.toml # Configuration
โโโ prompts/ # Editable prompt templates
โ โโโ member_system.txt
โ โโโ member_human.txt
โ โโโ chairman_system.txt
โ โโโ chairman_human.txt
โ โโโ critique.txt
โ โโโ summary_system.txt
โ โโโ summary_human.txt
โโโ src/coven/
โ โโโ config.py # Settings dataclass + TOML loader
โ โโโ models.py # Ollama health checks + LLM factory
โ โโโ prompts.py # Loads templates from prompts/
โ โโโ orchestrator.py # Async council + chairman synthesis
โ โโโ rag.py # LangChain Milvus semantic search integration
โ โโโ storage.py # Chat persistence (JSON/SQLite)
โ โโโ summarizer.py # History summarization logic
โ โโโ tools.py # LangChain tool definitions
โ โโโ app.py # Streamlit UI
โโโ tests/ # Pytest unit & integration suites
โ โโโ conftest.py
โ โโโ test_config.py
โ โโโ test_models.py
โ โโโ test_orchestrator.py
โ โโโ test_prompts.py
โ โโโ test_rag.py
โ โโโ test_summarizer.py
โ โโโ test_tools.py
โ โโโ test_tools_integration.py
โโโ pyproject.toml
Development
# Run tests
uv run pytest -v
# Lint
uv run ruff check src/ tests/
# Format
uv run ruff format src/ tests/
Tech Stack
| Layer | Technology |
|---|---|
| Runtime | Python 3.13 |
| LLM Backend | Ollama |
| Orchestration | LangChain (LCEL) |
| Frontend | Streamlit |
| Concurrency | asyncio |
| Package Manager | uv |
Images

License
Private โ all rights reserved.