One prompt in, a spectrum of model responses out.
AI Prisma is a Streamlit chat studio for working with multiple LLM providers (OpenAI, Anthropic, Groq, Mistral, Google) through a single interface, powered by aisuite. Its signature feature is Compare Mode: send the same prompt to 2–5 models in parallel and review their answers side by side, with per-branch latency, token counts, and failure isolation.
- Multi-provider chat — switch models from a dropdown loaded from
config.yaml; model IDs use theprovider:modelformat - Compare Mode — fan one prompt out to 2–5 models concurrently, view side-by-side result cards, and hand off your favorite response back into the main chat
- Prompt templates & variables — reusable system prompts with
{{variable}}substitution - Conversation persistence — chats stored locally in SQLite (WAL mode)
- Streaming responses with graceful, run-id-tagged error messages
- File & audio input — image uploads and audio recording in chat
- Guardrails — provider key validation per selected model, prompt-size and upload-size limits
- Optional Langfuse tracing — every completion traced automatically when Langfuse keys are configured, with sensitive-data redaction (see Observability with Langfuse)
- Python 3.10+
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
pip install -r requirements.txtcp .env.example .envEdit .env and add the keys for the providers you plan to use. Only the key for the currently selected model's provider is required. Langfuse keys are optional — the app runs fine without tracing.
streamlit run app.pyThe app opens at http://localhost:8501. Compare Mode is available as a separate page in the sidebar.
The model dropdown is driven by config.yaml. Each entry supports:
- name: "Display name" # shown in the dropdown
provider: "openai" # aisuite provider id
model: "gpt-5.2" # provider's model id
capability: "chat"
env: "OPENAI_API_KEY" # env var holding the provider keyAdd or remove entries to control which models appear in the UI.
AI Prisma ships with built-in Langfuse integration for LLM observability. It is entirely optional — without credentials the app runs normally and tracing is silently disabled.
When enabled, every chat completion (including each branch of a Compare Mode run) is traced automatically with the model used, request/response messages, latency, token usage, and a run_id you can use to correlate UI errors with traces.
To enable it, bring your own Langfuse credentials — traces are sent to your Langfuse project, not anyone else's:
- Create a free account at cloud.langfuse.com (or use your self-hosted Langfuse instance)
- Create a project and copy its API keys from Project Settings → API Keys
- Add them to your
.env:
LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
# Optional — defaults to the EU cloud endpoint.
# Use https://us.cloud.langfuse.com for US cloud, or your self-hosted URL.
LANGFUSE_BASE_URL=https://cloud.langfuse.com- Restart the app — tracing starts automatically, no code changes needed.
Privacy note: before anything is sent to Langfuse, the tracing layer redacts sensitive patterns from traced content — API keys (e.g. sk-...), bearer tokens, inline KEY=value secrets, and email addresses.
app.py # Main chat page (entry point)
pages/2_Compare_Mode.py # Side-by-side multi-model comparison
services/ # Model registry, guardrails, variable substitution, compare orchestrator
ui/ # Streamlit session-state setup
data/ # Repository layer over SQLite
observability/ # Langfuse tracing wrapper (with redaction)
db.py # SQLite utilities (WAL, pooling, transactions)
config.yaml # Model registry
docs/ # PRD, sprint boards, and AI-assisted dev session logs
- "Missing API key for selected model provider" — set the env var for the provider of the model selected in the dropdown (see
config.yaml'senvfield). - "The request failed (run_id: ...)" — use the run id shown in the UI to correlate with logs/Langfuse traces.
- Port 8501 already in use —
streamlit run app.py --server.port 8502.
The docs/ folder contains the PRD, milestone task boards, and session handoff notes from the AI-assisted development workflow used to build this project. Historical notes there reference the old entry point name demo_GPT.py (now app.py) and the original dev_chat-ui/ folder layout.