Skip to content
GuTianshuoPublic

About

llama.cpp Vulkan · Vibe Coded

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

🦙 llama.cpp GUI / 本地 LLM 聊天界面

Vibe Coded Python Streamlit License

基于 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.

English | 中文


中文

这是什么

一个纯本地运行的 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 套预设参数
  • 📝 系统提示词可自定义
  • 📊 实时内存监控
  • 🔒 纯本地,数据不离开本机

5 分钟上手指南

第 1 步:安装 Python

https://python.org 下载 Python 3.12,安装时勾选 "Add Python to PATH"。

第 2 步:安装 Ollama(可选,推荐)

https://ollama.com 下载安装 → 拉一个模型:

ollama pull qwen3:4b

第 3 步:下载本项目

git clone https://github.com/GuTianshuo/llama-ui.git
cd llama-ui

或点 GitHub 页面 Code → Download ZIP 解压。

第 4 步:安装依赖

pip install streamlit psutil httpx llama-cpp-python

GPU 加速(推荐):先装 Vulkan SDK (https://vulkan.lunarg.com),再:

set CMAKE_ARGS="-DGGML_VULKAN=ON"
pip install llama-cpp-python --force-reinstall --no-cache-dir

第 5 步:启动

streamlit 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/ 目录,刷新页面。


English

What is this

A fully local LLM chat interface. No internet, no API key, no Python experience needed.

⚠️ Vibe Coded Disclaimer

This 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 validated

Issues & PRs welcome!

Features

  • 📦 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

5-Minute Setup

Step 1: Install Python

Download Python 3.12 from https://python.org, check "Add Python to PATH".

Step 2: Install Ollama (Recommended)

https://ollama.com → Download → Pull a model:

ollama pull qwen3:4b

Step 3: Get the code

git clone https://github.com/GuTianshuo/llama-ui.git
cd llama-ui

Or Code → Download ZIP on GitHub.

Step 4: Install dependencies

pip install streamlit psutil httpx llama-cpp-python

GPU acceleration: install Vulkan SDK first, then:

set CMAKE_ARGS="-DGGML_VULKAN=ON"
pip install llama-cpp-python --force-reinstall --no-cache-dir

Step 5: Launch

streamlit run ui_st.py

Opens http://127.0.0.1:8501. Select model → Load → Chat.

FAQ

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.


模块结构 / Project Structure

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 模型

配置路径 / Hardcoded Paths

路径 文件 说明
~/.ollama/ config.py Ollama 安装目录 (自动)
models/ config.py 本地 GGUF 模型目录
config.json 项目根 用户配置 (自动生成)

Vibe Coded 🤖 · MIT License

About

llama.cpp Vulkan · Vibe Coded

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages