基于 DeepSeek 模型的 Mermaid 图表代码生成工具。
- 支持本地模型和 API 模式
- 自动下载和加载模型
- 生成符合 Mermaid 语法的图表代码
- 提供图表下载功能(PNG 格式)
- 友好的用户界面,支持示例输入
-
克隆仓库:
git clone https://github.com/yourusername/yourrepository.git cd yourrepository -
安装依赖:
pip install -r requirements.txt
-
复制配置文件:
cp config/config.yaml.example config/config.yaml
-
修改配置文件,添加您的 API Key:
- 在
.env文件中设置 API Key:
DEEPSEEK_API_KEY=your-new-api-key-here
- 在
-
运行 Web UI:
python run_webui.py
-
打开浏览器,访问
http://localhost:8501。 -
在输入框中描述您需要的图表,或点击示例按钮快速填充。
-
点击"生成图表"按钮,查看生成的图表。
-
可选择下载图表为 PNG 格式,或查看生成的 Mermaid 代码。
- 不要直接在配置文件中存储 API Key。
- 使用环境变量存储敏感信息:
# Linux/Mac export DEEPSEEK_API_KEY=your-api-key-here # Windows set DEEPSEEK_API_KEY=your-api-key-here
- 或者创建
.env文件(确保已添加到.gitignore)。
MIT License
欢迎任何形式的贡献!请提交问题或拉取请求。