Files
xianren_studio/README.md
T

70 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Xianren Studio(仙人工作室)
一款对标 LM Studio 的 Windows 本地大模型桌面应用:浏览/下载/管理 GGUF 模型,本机 CPU/GPU 推理聊天,并提供 OpenAI 兼容的本地 API 服务。
## 技术栈
- 桌面壳:Tauri 2Rust+ WebView2
- 前端:React 18 + TypeScript + Vite + Tailwind CSS
- 应用核心:Rusttokio / axum / reqwest / rusqlite
- 推理引擎:llama.cpp 官方 `llama-server` 子进程(CPU / CUDA / Vulkan
- 存储:SQLite(元数据、会话、设置)
## 仓库结构
```
apps/desktop Tauri 壳(Rust 命令层 + tauri.conf.json
crates/core 领域核心:模型注册表、会话、设置(SQLite)
crates/engine llama-server 子进程生命周期与流式聊天
crates/download 分片断点续传下载器
crates/api OpenAI 兼容本地 API 服务(axum
ui/ React 前端
scripts/ 构建/下载脚本
docs/ 产品与技术方案
```
## 环境要求(Windows
- RuststableMSVC 工具链)
- Visual Studio 2022 Build Tools(含 C++ 桌面开发)
- Node.js 18+
- WebView2 RuntimeWin10/11 一般自带)
- 可选:CUDA ToolkitGPU 推理)/ Vulkan SDKAMD/Intel GPU
## 快速开始
```powershell
# 1. 安装前端依赖
npm --prefix ui install
# 2. 获取预编译 llama.cpp 引擎(默认 CPU 版,可加 -Backend cuda/vulkan
.\scripts\fetch-llama.ps1
# 3. 下载一个测试模型(默认 Qwen2.5-0.5B Q4_K_M,约 400MB
.\scripts\download-test-model.ps1
# 4. 启动开发模式(自动拉起 Vite + Tauri
npm --prefix apps/desktop run dev
```
## 常用脚本
| 脚本 | 用途 |
| --- | --- |
| `scripts/fetch-llama.ps1` | 从 GitHub Releases 下载预编译 llama.cppcpu/cuda/vulkan |
| `scripts/build-llama.ps1` | 从源码编译 llama.cpp(需要 CMake,可选 CUDA/Vulkan |
| `scripts/download-test-model.ps1` | 下载迷你 GGUF 测试模型(支持 HF 镜像/ModelScope |
| `scripts/generate-icons.ps1` | 重新生成应用图标 |
## 引擎与模型目录
运行时数据默认存放在 `%APPDATA%\XianrenStudio`
- `models/`:下载的模型文件
- `engines/`llama-server 可执行文件
- `logs/`:引擎日志
- `xianren.db`SQLite 数据库
可在应用“设置”页修改模型目录与引擎路径。