衍智体 YANZHITI - AI 智能编程助手,支持 17+ AI 供应商
Project description
🚀 衍智体 (YANZHITI) - AI-Powered Intelligent Code Assistant
开源 AI 智能编程助手 - Python 实现 | Open-Source AI Coding Assistant in Python
🌟 为什么选择衍智体? | Why Choose YANZHITI?
中文: 衍智体 (YANZHITI) 是一个完全开源免费的 AI 智能编程助手,基于 Python 实现。与闭源的 Claude Code 不同,我们提供:
- ✅ 完全开源 (MIT 许可证) - 可自由查看、修改、分发
- ✅ 永久免费 - 无订阅费用,个人和企业均可使用
- ✅ 本地部署 - 代码不上传云端,保护隐私安全
- ✅ Python 原生 - 无缝集成 Python 生态系统
- ✅ 可定制扩展 - 根据需求自由修改源码
- ✅ 40+ 开发工具 - 文件操作、Shell 执行、Git 管理、Web 操作等
- ✅ 17+ AI 供应商 - OpenAI、Anthropic、DeepSeek、Ollama 等自由切换
- ✅ 内置后备模型 - 无需配置即可使用内置小模型引导配置
📊 功能对比 | Feature Comparison
| Feature 功能 | YANZHITI 衍智体 | Claude Code | GitHub Copilot |
|---|---|---|---|
| 开源许可 License | ✅ MIT | ❌ Proprietary | ❌ Proprietary |
| 免费 Free | ✅ 100% Free | ❌ $20/month | ❌ $10/month |
| 本地部署 Self-hosted | ✅ Yes | ❌ Cloud only | ❌ Cloud only |
| 隐私 Privacy | ✅ Local first | ❌ Cloud processing | ❌ Cloud processing |
| 模型选择 Models | ✅ Any LLM | ❌ Claude only | ❌ OpenAI only |
| 可扩展 Extensible | ✅ Full source | ❌ Closed | ❌ Closed |
| 离线使用 Offline | ✅ Supported | ❌ Online only | ❌ Online only |
| 编程语言 Language | 🐍 Python | TS/Node.js | TS/Node.js |
| AI 供应商数 Providers | ✅ 17+ | ❌ 1 | ❌ 1 |
✨ 核心特性 | Core Features
🤖 17+ AI 供应商支持
| 类型 | 供应商 | 免费额度 | 说明 |
|---|---|---|---|
| ☁️ 云端 | OpenRouter | ✅ 100+ 模型 | 综合最优选择 |
| ☁️ 云端 | OpenAI | ❌ 付费 | GPT-4 系列 |
| ☁️ 云端 | Anthropic | ❌ 付费 | Claude 3.5 系列 |
| ☁️ 云端 | DeepSeek | ✅ 免费额度 | DeepSeek V3 |
| ☁️ 云端 | Google Gemini | ✅ 免费 | Gemini Pro |
| ☁️ 云端 | Groq | ✅ 免费 | LLaMA 3.1 等 |
| ☁️ 云端 | Mistral | ✅ 免费 | Mistral Small |
| ☁️ 云端 | Together AI | ✅ 免费 | 多种开源模型 |
| ☁️ 云端 | Fireworks | ❌ 付费 | 高性能推理 |
| 🖥️ 本地 | Ollama | ✅ 免费 | 主流开源模型 |
| 🖥️ 本地 | LM Studio | ✅ 免费 | 桌面应用 |
| 🖥️ 本地 | MLX (Apple) | ✅ 免费 | Apple Silicon |
| 🖥️ 本地 | llama.cpp | ✅ 免费 | 高性能推理 |
| 🖥️ 本地 | vLLM | ✅ 免费 | 服务器部署 |
| 🔧 内置 | TinyLlama/Phi-2/StableLM | ✅ 免费 | 零配置后备 |
🔧 40+ 开发工具集 | Developer Toolkit
| 类别 | 工具数 | 示例 |
|---|---|---|
| 📁 文件操作 | 8+ | 读取、写入、搜索、批量编辑 |
| ⚡ Shell 执行 | 5+ | Bash、PowerShell、CMD |
| 🔀 Git 管理 | 6+ | Commit、Branch、Diff、Merge |
| 🌐 Web 操作 | 4+ | Fetch、搜索、API 调用 |
| 📋 任务管理 | 3+ | 创建、跟踪、组织 |
| 🔌 MCP 支持 | 2+ | 模型上下文协议扩展 |
🚀 快速开始 | Quick Start
方式一:pip 安装 (推荐) | Method 1: pip install (Recommended)
# 安装稳定版(推荐)
pip install yanzhiti
# 或使用短名称安装
pip install yzt
# 全量安装(含所有可选依赖)
pip install yanzhiti[all]
# 或
pip install yzt[all]
# 从源码安装开发版
pip install git+https://github.com/yanzhiti/yanzhiti.git
方式二:从源码运行 | Method 2: From Source
# 1. 克隆仓库 | Clone repository
git clone https://github.com/yanzhiti/yanzhiti.git
cd yanzhiti
# 2. 创建虚拟环境 | Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# Windows: venv\Scripts\activate
# 3. 安装依赖 | Install dependencies
pip install -e ".[dev]"
# 4. 配置 AI 供应商 | Configure AI provider
yzt --setup
# 5. 启动 | Launch
yzt
配置 API | Configuration
首次运行配置向导 | First Run Configuration Wizard:
# 运行配置向导 (自动引导配置)
yzt --setup
# 或手动配置
export YANZHITI_API_KEY=your-api-key
export YANZHITI_MODEL=openai/gpt-4o
运行衍智体 | Run YANZHITI
# 交互式对话
yzt
# 单次查询
yzt "帮我写一个快速排序"
# Web 界面
yzt-web
# 然后打开 http://localhost:8000
# 系统诊断
yzt-diagnose
📸 使用示例 | Usage Examples
示例 1: 代码生成 | Code Generation
You: 帮我创建一个快速排序算法
YANZHITI:
好的,我来为您创建一个快速排序的 Python 实现:
def quick_sort(arr):
if len(arr) <= 1:
return arr
pivot = arr[len(arr) // 2]
left = [x for x in arr if x < pivot]
middle = [x for x in arr if x == pivot]
right = [x for x in arr if x > pivot]
return quick_sort(left) + middle + quick_sort(right)
# 测试
arr = [64, 34, 25, 12, 22, 11, 90]
print(quick_sort(arr)) # 输出:[11, 12, 22, 25, 34, 64, 90]
示例 2: Git 管理 | Git Management
You: 查看当前的 Git 状态并提交所有更改
YANZHITI:
📊 Git Status:
Modified: src/main.py
New file: README.md
✅ Changes committed successfully!
📥 安装方式 | Installation
推荐使用 pip 安装 | Recommended:
pip install yanzhiti或pip install yzt
| 安装方式 | 命令 | 说明 |
|---|---|---|
| pip(推荐) | pip install yanzhiti |
PyPI 官方包 |
| pip 短名称 | pip install yzt |
与 yanzhiti 相同包,仅名称不同 |
| pip 全量安装 | pip install yanzhiti[all] 或 pip install yzt[all] |
含所有可选依赖 |
| 最新源码 | pip install git+https://github.com/yanzhiti/yanzhiti.git |
保持最新 |
发布版本通过 Git tag 创建,每次 v* tag push 时自动构建并发布到 PyPI。
PyPI 地址: https://pypi.org/project/yanzhiti/ | https://pypi.org/project/yzt/
📚 文档 | Documentation
- 📖 完整文档 | Full Documentation
- 🚀 快速上手指南(新手必读)| Quick Start Guide
- 🔧 工具列表 | Available Tools
- 🌐 API 参考 | API Reference
- ❓ 常见问题 | FAQ
- 🎓 示例库 | Examples
- 🔐 安全政策 | Security Policy
- 🤝 贡献指南 | Contributing
🤝 参与贡献 | Contributing
衍智体是一个开源项目,欢迎社区贡献!
开发设置 | Development Setup
# 克隆项目 | Clone the project
git clone https://github.com/yanzhiti/yanzhiti.git
cd yanzhiti
# 安装开发依赖 | Install dev dependencies
pip install -e ".[dev]"
# 运行测试 | Run tests
pytest tests/ -v
# 代码格式化 | Code formatting
ruff format src tests
# Lint 检查 | Lint check
ruff check src tests
# 类型检查 | Type checking
mypy src/
🏗️ 技术架构 | Technical Architecture
┌─────────────────────────────────────────────────────────┐
│ YANZHITI Architecture │
├─────────────────────────────────────────────────────────┤
│ 🎨 User Interface Layer │
│ • CLI (交互式命令行) │
│ • Web GUI (浏览器界面) │
│ • Desktop Client (桌面客户端) │
├─────────────────────────────────────────────────────────┤
│ 🧠 Core Engine │
│ • UnifiedAIEngine (统一 AI 引擎,自动故障转移) │
│ • Session Manager (会话管理) │
│ • Permission Control (权限控制) │
│ • BuiltInModelManager (内置模型管理) │
├─────────────────────────────────────────────────────────┤
│ 🔌 Tool Layer (40+ Tools) │
│ • File Tools • Shell Tools • Git Tools │
│ • Web Tools • Task Tools • MCP Support │
├─────────────────────────────────────────────────────────┤
│ 🤖 AI Provider Integration │
│ • 11 Cloud Providers (OpenAI, Anthropic, etc.) │
│ • 5 Local Runners (Ollama, LM Studio, MLX, etc.) │
│ • 1 Built-in Fallback (TinyLlama/Phi-2/StableLM) │
└─────────────────────────────────────────────────────────┘
🎯 路线图 | Roadmap
v2.2.0 (当前)
- ✅ Web GUI 界面
- ✅ 17+ AI 供应商
- ✅ 内置后备模型系统
- ✅ PyPI 包发布
- 🔄 CI/CD 自动化
v2.3.0 (计划中)
- 📋 真实内置模型下载 (HuggingFace)
- 📋 插件系统
- 📋 更多本地模型支持
- 📋 移动端 Web 优化
v3.0.0 (规划中)
- 📋 Electron/Tauri 桌面客户端
- 📋 可视化工作流
- 📋 企业版功能
📊 项目统计 | Project Stats
| 指标 | 数值 |
|---|---|
| Python 版本 | 3.10+ |
| AI 供应商 | 17+ |
| 支持模型 | 100+ |
| 开发工具 | 40+ |
| 代码质量 | A+ (Ruff 0 errors) |
| 测试覆盖率 | 88%+ |
🙏 致谢 | Acknowledgments
- OpenAI - GPT 模型支持
- Anthropic - Claude 模型支持
- HuggingFace - 模型托管
- FastAPI - Web 框架
- Rich - 终端美化
- Pydantic - 数据验证
- 以及所有 Python 社区的贡献者!
📄 许可证 | License
本项目采用 MIT 许可证。
📬 联系方式 | Contact Us
- 🌐 官网 | Website: https://github.com/yanzhiti/yanzhiti
- 🐛 Bug 报告 | Bug Reports: https://github.com/yanzhiti/yanzhiti/issues
- 💡 功能建议 | Feature Requests: https://github.com/yanzhiti/yanzhiti/issues
- 🔐 安全漏洞 | Security: 参见 SECURITY.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yanzhiti-2.2.1.tar.gz.
File metadata
- Download URL: yanzhiti-2.2.1.tar.gz
- Upload date:
- Size: 197.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88f6bb8a8fb1adaadfd1849b1d5d461888f0db8ac0ebfcd4653a8de087d89444
|
|
| MD5 |
23dd476768f696f1484d3a0d14930ff3
|
|
| BLAKE2b-256 |
b61d11a6952a3fc098561ba5565251ad50916ebe9f9522ec8712f58765afc30f
|
File details
Details for the file yanzhiti-2.2.1-py3-none-any.whl.
File metadata
- Download URL: yanzhiti-2.2.1-py3-none-any.whl
- Upload date:
- Size: 127.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc4f86abde70fd683fa518dae7425239b6f2cb611f3610e2e6a640385d6f0c58
|
|
| MD5 |
6f46fc669c1c68c152841ae6eb1b29f5
|
|
| BLAKE2b-256 |
35f63649c95a801b9a937f363ec5820385a8f8293e930e49e827a33e63a08426
|