A production-grade, interview-focused LLM serving and RAG reference platform with an interactive lab, built in pure Python with zero heavy framework dependencies.

Stars

10

7-day growth

No data

Forks

2

Open issues

0

License

NOASSERTION

Last updated

2026-07-30

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It offers a comprehensive, modular architecture covering routing, RAG, caching, agents, safety, and more, with over 150 unit tests and an interactive Streamlit UI for hands-on testing, all without heavy dependencies.

Who it is for

  • Software engineers preparing for ML system design interviews
  • Developers building production LLM applications
  • Students learning LLM system architecture
  • ML engineers seeking a reference implementation of RAG and agent systems

Use cases

  • Learning end-to-end LLM serving and retrieval architecture
  • Prototyping RAG pipelines with hybrid retrieval and reranking
  • Testing multi-agent orchestration and safety guardrails
  • Understanding cost estimation, caching, and autoscaling in LLM systems

Strengths

  • Pure Python implementation with minimal dependencies (standard library, optional numpy/FastAPI)
  • Comprehensive module coverage from token estimation to multi-provider gateway
  • Interactive Streamlit lab for visual testing and tracing of all system modules
  • Over 150 offline unit tests and deterministic offline fallback for reproducibility

Considerations

  • Requires local setup of Ollama for real model integration (optional but recommended for full experience)
  • Not a production-ready deployment; it is a reference and educational platform
  • Limited coverage of distributed systems aspects (e.g., horizontal scaling, fault tolerance beyond circuit breakers)

README quick start

LLM System Design — Project & Lab Companion

A production-grade, interview-focused implementation of Large Language Model systems featuring:

  1. project/ (llm_platform): A minimal, production-shaped LLM serving + RAG reference platform built in pure Python with zero heavy framework dependencies.
  2. lab/ (llm_lab): An interactive hands-on Streamlit web application built with LangChain, backing local Ollama models (llama3.1 + nomic-embed-text) with a deterministic offline fallback.

📁 Repository Layout

LLM-system-design/
├── project/                  # Reference LLM serving + RAG platform (pure Python)
│   ├── llm_platform/         # Core platform modules (pipeline, router, RAG, agents, etc.)
│   ├── tests/                # Offline unit test suite (150+ tests)
│   ├── run_demo.py           # End-to-end demo script with telemetry
│   └── README.md
└── lab/                      # Interactive web lab (LangChain + Streamlit)
    ├── llm_lab/              # Lab modules & LangChain implementations
    │   └── platform_bridge.py  # Bridges all reference modules to the UI
    ├── tests/                # Lab test suite
    ├── app.py                # Streamlit web dashboard
    └── README.md

🚀 Quick Start

1. Running the Reference Platform (project/)

(Dependency-free, pure Python standard library; optional numpy/FastAPI)

cd project
python run_demo.py          # Run end-to-end platform demo with telemetry
python -m pytest -q         # Run full offline test suite (150+ tests)

Optional: Launch HTTP API Server

pip install -r requirements.txt
uvicorn llm_platform.app:app --reload
# POST http://127.0.0.1:8000/v1/chat   {"query": "What is the KV cache?"}

Optional: Connect to Real OpenAI-Compatible Endpoints (vLLM, TGI, Ollama, Vendor)

export OPENAI_BASE_URL="https://api.your-provider.com/v1"
export OPENAI_API_KEY="sk-..."
python run_demo.py

2. Running the Interactive UI Lab (lab/)

(LangChain + Streamlit UI with local Ollama models or offline fallback)

cd lab
pip install -r requirements.txt

# (Optional) Real models via Ollama:
ollama pull llama3.1
ollama pull nomic-embed-text
ollama serve            # if not already running

# Generate seed datasets (also runnable from UI)
python -m llm_lab.seed

# Launch Streamlit Web UI
streamlit run app

Description

A production-grade LLM System Design platform & interactive lab. Features a pure-Python LLM serving, RAG, routing, safety, and agent control plane (150+ offline tests) plus a LangChain + Streamlit UI with local Ollama models.

Related repositories

Similar projects matched by category, topics, and programming language.

deerwork-ai
Featured
deerwork-ai GitHub avatar

deer-workflow

An open-source Dynamic Workflow runtime that combines deterministic TypeScript orchestration with replaceable Agent runtimes.

AI & Machine LearningLarge Language Models
312
makecindy
Featured
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI & Machine LearningLarge Language Models
958
uzairansaruzi
Featured
uzairansaruzi GitHub avatar

hermex

Hermex is a native SwiftUI iPhone app that lets you control a self-hosted Hermes AI agent directly from your phone, with no subscriptions, tracking, or third-party relay.

AI & Machine LearningLarge Language Models
941