A sophisticated B2B sales demo platform featuring AI-powered chatbot, Lakera Guard integration, RAG capabilities, and ToolHive integration.
- Skinnable B2B Landing Page with customizable branding
- AI Chatbot with ReAct agent architecture and smart autocomplete
- Lakera Guard Integration with blocking/watching modes for content moderation
- Demo Prompt Corpus with autocomplete functionality (right arrow key trigger)
- RAG System supporting file uploads and AI-generated seed packs
- ToolHive Integration via MCP tools
- Admin Console for complete configuration management
- Export/Import configuration as ZIP with selective sections (appearance, LLM, security, RAG, demo prompts, tools, etc.)
- Frontend: Vite + React + TypeScript + Tailwind CSS
- Backend: FastAPI + SQLite + ChromaDB
- LLM: OpenAI or LiteLLM proxy (chat + embeddings)
- Vector DB: ChromaDB for RAG
- Security: Lakera Guard for content moderation
- Python 3.8β3.12 (3.13+ may break some deps like pandas; use
pyenvor Homebrewpython@3.12if needed) - Node.js 16+
- Docker (required for LiteLLM + Postgres auto-bootstrap)
- OpenAI API key or LiteLLM API key (master or virtual; configure in Admin β Security)
- Lakera API key (optional)
git clone <repository-url>
cd guard-demo-clientThe easiest way to get started is using the start_all.py script, which handles most of the setup for you:
# 1. First, create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 2. Then run the startup script
python start_all.pyThe script will:
- Install all Python dependencies from
requirements.txt - Install all Node.js dependencies from
package.json - Auto-start Postgres for LiteLLM (Docker)
- Auto-start LiteLLM proxy container on port 4000 using
litellm/config.yaml - Start the backend server on port 8000
- Start the frontend server on port 3000
Note: You still need to create and activate the virtual environment first, but the script handles all the dependency installation and service startup for you.
If you prefer to set up the components manually or need more control:
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start backend server
python start_backend.py# Install dependencies
npm install
# Start development server
npm run devTerminal 1 - Backend:
python start_backend.pyTerminal 2 - Frontend:
npm run devLiteLLM runs in Docker and is automatically managed by start_all.py.
LiteLLM uses litellm/litellm-database:v1.82.3 (default) and PostgreSQL on localhost:5432.
- Ensure
.envexists:cp .env.example .env
- If needed, edit:
litellm/config.yaml(general_settings.database_url, model routes, guardrails).env(AZURE_API_KEY,UI_USERNAME,UI_PASSWORD, optionalLAKERA_*)
- Start the stack:
source venv/bin/activate python start_all.py - Open http://localhost:4000/ui and sign in with
UI_USERNAME/UI_PASSWORDfrom.env.
Reuse behavior: if LiteLLM is already running at LITELLM_BASE_URL (default http://localhost:4000), startup reuses it and does not launch another LiteLLM container.
Useful scripts:
./scripts/stop_demo_stack.sh # stop backend/frontend and LiteLLM container
./scripts/stop_demo_stack.sh --postgres # also stop LiteLLM Postgres container
./scripts/fresh_start_demo.sh # stop + activate venv + start_all.py- Use PowerShell activation commands:
python -m venv venv .\venv\Scripts\Activate.ps1 python start_all.py - In
cmd.exe, use:venv\Scripts\activate.bat
- Keep Docker Desktop running (Linux containers enabled).
- If LiteLLM image startup fails on your architecture, set
.env:LITELLM_DOCKER_PLATFORM=linux/amd64(current default)- or clear it / set
linux/arm64if your machine supports that image tag.
- If Docker reports a config mount error on Windows path handling, run from PowerShell in the repo root and retry
python start_all.py(the bootstrap mountsdata/litellm-runtime-config.yamlinto the container).
- Demo Page: http://localhost:3000
- Admin Console: http://localhost:3000/admin
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs (if available)
- LiteLLM Proxy (optional): http://localhost:4000 β LiteLLM UI: http://localhost:4000/ui
- Navigate to the Admin Console at http://localhost:3000/admin
- Go to the Security tab
- Enter your OpenAI API key
- Optionally enter your Lakera API key and enable Lakera Guard
- If using LiteLLM + Lakera guardrails, set guardrail names in Admin β Security to match
litellm/config.yaml:- blocking:
lakera-guard-block - monitor:
lakera-guard-monitor
- blocking:
- Configure other settings as needed
In the Branding tab:
- Set your business name and tagline
- Upload logo and hero images
- Customize hero text
In the LLM tab:
- Select OpenAI model (GPT-4o, GPT-4o-mini, etc.)
- Adjust temperature (0-10 scale)
- Customize system prompt
In the RAG tab:
- Upload documents (PDF, MD, TXT, CSV)
- Generate AI-powered seed packs
- View ingested content
In the Tools tab:
- Add custom tools
- Configure MCP endpoints
- Test tool functionality
In the Demo Prompts tab:
- Create curated demo prompts for different scenarios
- Organize prompts by category (general, security, tools, rag, malicious)
- Set a preferred LLM per prompt (chat uses that model when the prompt is selected)
- Add tags for easy searching
- Mark prompts as malicious for security testing
- Track usage statistics
Chat Autocomplete:
- Start typing in the chat (minimum 2 characters)
- See real-time suggestions with autocomplete overlay
- Press right arrow key (β) to complete the current suggestion
- Click on suggestions in the dropdown to select them
- Escape key to dismiss suggestions
All API routes are under the /api prefix.
GET /api/config- Get current configurationPUT /api/config- Update configurationGET /api/config/export- Export config as a ZIP file (query:?include=appearance,llm,...and?version=2; omit include = safe default sections)POST /api/config/import- Import config from an exported ZIP file (merge by section)
POST /api/chat- Send message to AI assistant
POST /api/rag/upload- Upload documentsPOST /api/rag/generate- Generate AI contentGET /api/rag/search- Search stored content
GET /api/tools- List toolsPOST /api/tools- Create toolPUT /api/tools/{id}- Update toolDELETE /api/tools/{id}- Delete toolPOST /api/tools/test/{id}- Test tool
GET /api/lakera/last- Get last guardrail result
GET /api/demo-prompts- List demo promptsGET /api/demo-prompts/search- Search demo prompts with autocompletePOST /api/demo-prompts- Create demo promptPUT /api/demo-prompts/{id}- Update demo promptDELETE /api/demo-prompts/{id}- Delete demo promptPOST /api/demo-prompts/{id}/use- Track prompt usage
guard-demo-client/
βββ backend/ # FastAPI backend
β βββ __init__.py
β βββ main.py # FastAPI app, config export/import
β βββ models.py # SQLAlchemy models
β βββ schemas.py # Pydantic schemas
β βββ database.py # Database connection
β βββ llm_client.py # LLM integration (OpenAI or LiteLLM proxy)
β βββ rag.py # RAG service, ChromaDB
β βββ lakera.py # Lakera integration
β βββ toolhive.py # ToolHive service
β βββ agent.py # ReAct agent
βββ src/ # React frontend
β βββ components/ # React components
β β βββ ChatWidget.tsx # Chat with autocomplete
β β βββ DemoPromptManager.tsx # Prompt management
β β βββ LakeraOverlay.tsx # Guard results
β β βββ ...
β βββ pages/ # Page components
β βββ services/ # API services
β βββ types/ # TypeScript types
β βββ ...
βββ data/ # Data storage
β βββ agentic_demo.db # SQLite database
β βββ chroma/ # ChromaDB vectors (default)
β βββ chroma_import/ # ChromaDB after import (if used)
βββ uploads/ # Uploaded files
βββ requirements.txt # Python dependencies
βββ package.json # Node.js dependencies
βββ start_all.py # Start backend + frontend (recommended)
βββ start_backend.py # Backend-only startup
βββ README.md # This file
- Real-time chat with AI assistant
- Smart autocomplete with demo prompt corpus
- Tool usage tracking
- Lakera guardrail monitoring
- Message history
- Content moderation with blocking/watching modes
- Direct Lakera API checks or LiteLLM-native Lakera guardrails (when LiteLLM mode is enabled)
- Guardrail enforcement (blocking mode) or monitoring (watching mode)
- Unified Lakera result shape for the frontend overlay in either provider mode
- Detailed violation reporting with TL;DR summaries
- Document upload (PDF, MD, TXT, CSV)
- AI-generated content creation
- Semantic search
- Content chunking and embedding
- Calculator tool
- HTTP fetch tool
- Calendar lookup
- GitHub repository info
- Custom tool addition
- Curated prompt library for consistent demos
- Category-based organization (general, security, tools, rag, malicious)
- Tag-based search and filtering
- Usage tracking and analytics
- Smart autocomplete in chat interface
- Right arrow key (β) completion trigger
- Visual indicators for malicious prompts
- Admin interface for prompt management
- API key masking in UI
- Secure file upload validation
- Content moderation via Lakera
- Input sanitization
- CORS configuration
Configuration is exported and imported as ZIP files (not JSON). You choose which sections to include.
- Go to Admin Console β Export/Import.
- Check the sections you want in the export:
- Appearance, LLM, Security, RAG scanning, Demo prompts, Tools, RAG (default: all checked).
- API keys and Project IDs are off by default (safe for sharing).
- Click Export. A ZIP file is downloaded (e.g.
agentic_demo_config_2026-02-23T12-00-00.zip).
The ZIP contains metadata.json (version 2.0, list of included sections), config.json, and section-specific files such as demo_prompts.json, tools.json, rag_sources.json, and the ChromaDB vector store when those sections are included.
- Go to Admin Console β Export/Import.
- Upload a previously exported ZIP file.
- The app merges by section: only sections present in the ZIP are applied (e.g. a βsafeβ export does not overwrite your API keys or project IDs).
- After import, a summary shows which sections were applied. RAG (ChromaDB) is loaded from the ZIP without replacing the live
data/chromadirectory in use; the app switches to the imported vectors so RAG keeps working.
Tips:
- For demo prompts to be in the export, include the Demo prompts section when exporting. Re-export after adding prompts if your current ZIP was created before that change.
- v1.0 ZIPs (no
metadata.jsonversion 2.0 or old format) are still supported: full replace behavior, and demo prompts can be read fromdemo_prompts.jsonor fromdata/agentic_demo.dbinside the ZIP.
See CHANGELOG.md for recent changes (LiteLLM integration, model selection).
-
Backend won't start
- Check Python version (3.8+)
- Verify all dependencies installed
- Check port 8000 availability
-
Frontend won't start
- Check Node.js version (16+)
- Run
npm install - Check port 3000 availability
-
API errors
- Verify OpenAI API key is set
- Check network connectivity
- Review browser console for CORS issues
-
Database issues
- Delete
data/folder to reset - Check file permissions
- Verify SQLite installation
- Delete
- Backend logs: Check terminal running
start_backend.py - Frontend logs: Check browser console
- LiteLLM container logs:
docker logs -f guard-demo-litellm-proxy - API logs: Check backend terminal output
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For issues and questions:
- Check the troubleshooting section
- Check the browser console for errors
- Review backend logs in the terminal
- Check the API endpoints in the code if needed
Happy Demo-ing! π