一个面向面试的生产级 LLM 服务与 RAG 参考平台,配合交互式实验室,纯 Python 实现,无重型框架依赖。

Stars

10

7 天增长

暂无数据

Fork 数

2

开放 Issue

0

开源协议

NOASSERTION

最近更新

2026-07-30

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它提供了涵盖路由、RAG、缓存、智能体、安全等模块的全面架构,拥有 150 多项单元测试和交互式 Streamlit UI,无需重型依赖即可动手测试。

适合谁使用

  • 准备机器学习系统设计面试的软件工程师
  • 构建生产级 LLM 应用的开发者
  • 学习 LLM 系统架构的学生
  • 寻求 RAG 与智能体系统参考实现的机器学习工程师

典型使用场景

  • 学习端到端 LLM 服务与检索架构
  • 使用混合检索与重排序快速原型化 RAG 流水线
  • 测试多智能体编排与安全护栏
  • 理解 LLM 系统中的成本估算、缓存与自动扩缩容

项目优势

  • 纯 Python 实现,依赖极少(标准库,可选 numpy/FastAPI)
  • 从令牌估算到多提供商网关的全面模块覆盖
  • 交互式 Streamlit 实验室,可直观测试和追踪所有系统模块
  • 150 多项离线单元测试和确定性离线回退,确保可复现性

使用前须知

  • 需要本地部署 Ollama 以集成真实模型(可选,但推荐以获得完整体验)
  • 并非生产就绪部署,而是参考与教育平台
  • 对分布式系统方面的覆盖有限(例如水平扩展、熔断器之外的容错)

README 快速开始

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

项目描述

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.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

deerwork-ai
精选
deerwork-ai GitHub avatar

deer-workflow

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

AI 与机器学习大语言模型
312
makecindy
精选
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 与机器学习大语言模型
958
uzairansaruzi
精选
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 与机器学习大语言模型
941