基于 Streamlit + llama-cpp-python 的本地 LLM 聊天界面。支持 Ollama 模型、Vulkan GPU 推理,开箱即用。 A local LLM chat UI powered by Streamlit + llama-cpp-python. Ollama models, Vulkan GPU, works out of the box.
一个纯本地运行的 LLM 聊天界面。不需要联网,不需要 API Key,不需要 Python 基础。
⚠️ Vibe Coded 项目声明本项目由 AI 辅助对话式编程(Vibe Coding)生成,并非专业工程产物。核心的本地模型加载与基础对话功能经过验证可用,但以下功能未经实际测试,可能存在 bug:
- 流式对话(Streaming):打字机效果的实时 token 输出,逻辑已写好但未在多种模型/场景下验证
- HTTP SSE 服务端模式:将模型暴露为 HTTP API 供外部调用,
chat_server()接口已定义但未实测- 服务端启停管理:
check_server_status()/shutdown_server()等服务端生命周期管理功能未验证欢迎提 Issue / PR 帮助改进!
- 📦 自动识别 Ollama 已下载的模型,按系列分组
- ⚡ Vulkan GPU 推理(支持 Intel Arc / AMD / NVIDIA)
- 💬 流式对话,打字机效果
- 🧠 7 套预设参数
- 📝 系统提示词可自定义
- 📊 实时内存监控
- 🔒 纯本地,数据不离开本机
https://python.org 下载 Python 3.12,安装时勾选 "Add Python to PATH"。
https://ollama.com 下载安装 → 拉一个模型:
ollama pull qwen3:4bgit clone https://github.com/GuTianshuo/llama-ui.git
cd llama-ui或点 GitHub 页面 Code → Download ZIP 解压。
pip install streamlit psutil httpx llama-cpp-pythonGPU 加速(推荐):先装 Vulkan SDK (https://vulkan.lunarg.com),再:
set CMAKE_ARGS="-DGGML_VULKAN=ON"
pip install llama-cpp-python --force-reinstall --no-cache-dirstreamlit run ui_st.py浏览器自动打开 http://127.0.0.1:8501。选模型 → 加载 → 聊天。
Q: 模型列表为空?
A: ollama pull qwen3:4b 拉一个模型,或把 .gguf 放 models/ 目录。
Q: 提示 "请先安装 llama-cpp-python"? A: 回第 4 步重装依赖。
Q: 显存不足? A: 换小模型或降低 Context Length。
Q: 用自己的 GGUF?
A: 放 models/ 目录,刷新页面。
A fully local LLM chat interface. No internet, no API key, no Python experience needed.
⚠️ Vibe Coded DisclaimerThis project was built conversationally with AI (Vibe Coding) and is not a professional engineering product. Core features (local model loading & basic chat) have been verified working, but the following features are untested and may contain bugs:
- Streaming chat: Real-time token-by-token output — logic is written but not verified across different models/scenarios
- HTTP SSE server mode: Exposing the model as an HTTP API —
chat_server()interface defined but not actually tested- Server lifecycle management:
check_server_status()/shutdown_server()— not validatedIssues & PRs welcome!
- 📦 Auto-detects Ollama models, grouped by series
- ⚡ Vulkan GPU inference (Intel Arc / AMD / NVIDIA)
- 💬 Streaming chat, typewriter effect
- 🧠 7 parameter presets (Creative / Balanced / Precise / Code / Deep Think / Analysis / Brainstorm)
- 📝 Customizable system prompt
- 📊 Real-time memory monitor
- 🔒 100% local, data never leaves your machine
Download Python 3.12 from https://python.org, check "Add Python to PATH".
https://ollama.com → Download → Pull a model:
ollama pull qwen3:4bgit clone https://github.com/GuTianshuo/llama-ui.git
cd llama-uiOr Code → Download ZIP on GitHub.
pip install streamlit psutil httpx llama-cpp-pythonGPU acceleration: install Vulkan SDK first, then:
set CMAKE_ARGS="-DGGML_VULKAN=ON"
pip install llama-cpp-python --force-reinstall --no-cache-dirstreamlit run ui_st.pyOpens http://127.0.0.1:8501. Select model → Load → Chat.
Q: Empty model list?
A: ollama pull qwen3:4b or drop .gguf into models/.
Q: "Please install llama-cpp-python"? A: Re-run Step 4.
Q: Out of VRAM? A: Smaller model or lower Context Length.
Q: Custom GGUF?
A: Drop into models/, refresh.
llama-ui/
├── app.py # 入口 / Entry
├── config.py # 常量 + 配置 / Constants & Config
├── discovery.py # 模型扫描 / Model Discovery
├── engine.py # 推理核心 / Inference Engine
├── presets.py # 7 套预设 / Presets
├── chat.py # 流式聊天 / Streaming Chat
├── ui_st.py # Streamlit 界面 / UI
├── .streamlit/config.toml # 端口/主题 / Port & Theme
├── 启动.bat / 关闭.bat # Windows 启停脚本
├── config.example.json # 配置模板
└── models/ # 本地 GGUF 模型
| 路径 | 文件 | 说明 |
|---|---|---|
~/.ollama/ |
config.py | Ollama 安装目录 (自动) |
models/ |
config.py | 本地 GGUF 模型目录 |
config.json |
项目根 | 用户配置 (自动生成) |
Vibe Coded 🤖 · MIT License