AI prompts
base on OpenAI 接口管理 & 分发系统,改自songquanpeng/one-api。支持更多模型,加入统计页面,完善非openai模型的函数调用。 <p align="right">
<strong>中文</strong> | <a href="./README.en.md">English</a>
</p>
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/MartialBE/one-hub/assets/42402987/c4125d1a-5577-446d-ba15-2a71c52140c1">
<img height="90" src="https://raw.githubusercontent.com/MartialBE/one-api/main/web/src/assets/images/logo.svg">
</picture>
</p>
<div align="center">
# One Hub
_本项目是基于[one-api](https://github.com/songquanpeng/one-api)二次开发而来的_
<p align="center">
<a href="https://raw.githubusercontent.com/MartialBE/one-api/main/LICENSE">
<img src="https://img.shields.io/github/license/MartialBE/one-api?color=brightgreen" alt="license">
</a>
<a href="https://github.com/MartialBE/one-hub/releases/latest">
<img src="https://img.shields.io/github/v/release/MartialBE/one-api?color=brightgreen&include_prereleases" alt="release">
</a>
<a href="https://github.com/users/MartialBE/packages/container/package/one-api">
<img src="https://img.shields.io/badge/docker-ghcr.io-blue" alt="docker">
</a>
<a href="https://hub.docker.com/r/martialbe/one-api">
<img src="https://img.shields.io/badge/docker-dockerHub-blue" alt="docker">
</a>
<a href="https://goreportcard.com/report/github.com/MartialBE/one-api">
<img src="https://goreportcard.com/badge/github.com/MartialBE/one-api" alt="GoReportCard">
</a>
</p>
**请不要和原版混用,因为新增功能,数据库与原版不兼容**
**为了更加简洁,本项目之后,除了新增供应商时会更新程序自带的模型列表,平常不再更新程序自带的模型列表。**
**如果发现缺少新模型,请在`后台-模型价格-更新价格`中更新新增的模型**
[演示网站](https://one-api-martialbe.vercel.app/)
</div>
> [!WARNING]
> 本项目为个人学习使用,不保证稳定性,且不提供任何技术支持,使用者必须在遵循 OpenAI 的使用条款以及法律法规的情况下使用,不得用于非法用途。
> 根据[《生成式人工智能服务管理暂行办法》](http://www.cac.gov.cn/2023-07/13/c_1690898327029107.htm)的要求,请勿对中国地区公众提供一切未经备案的生成式人工智能服务。
## 功能变化
- 全新的 UI 界面
- 新增用户仪表盘
- 新增管理员分析数据统计界面
- 重构了中转`供应商`模块
- 支持使用`Azure Speech`模拟`TTS`功能
- 渠道可配置单独的 http/socks5 代理
- 支持动态返回用户模型列表
- 支持自定义测速模型
- 日志增加请求耗时
- 支持和优化非 OpenAI 模型的函数调用(支持的模型可以在 lobe-chat 直接使用)
- 支持完成倍率自定义
- 支持完整的分页和排序
- 支持`Telegram bot`
- 支持模型按次收费
- 支持模型通配符
- 支持使用配置文件启动程序
- 支持模型价格更新
- 支持自动获取供应商模型
- 支持仅聊天,开启后如果有传入`function call`参数会跳过该渠道
- 支持支付
- 支持配置用户组 RPM
- 支持`Prometheus`监控
## 文档
请查看[文档](https://github.com/MartialBE/one-hub/wiki)
## 当前支持的供应商
| 供应商 | Chat | Embeddings | Audio | Images | 其他 |
| --------------------------------------------------------------------- | ------------------------ | ---------- | ------ | ----------- | ---------------------------------------------------------------- |
| [OpenAI](https://platform.openai.com/docs/api-reference/introduction) | ✅ | ✅ | ✅ | ✅ | - |
| [Azure OpenAI](https://oai.azure.com/) | ✅ | ✅ | ✅ | ✅ | - |
| [Azure Speech](https://portal.azure.com/) | - | - | ⚠️ tts | - | - |
| [Anthropic](https://www.anthropic.com/) | ✅ | - | - | - | - |
| [Gemini](https://aistudio.google.com/) | ✅ | - | - | - | - |
| [百度文心](https://console.bce.baidu.com/qianfan/overview) | ✅ | ✅ | - | - | - |
| [通义千问](https://dashscope.console.aliyun.com/overview) | ✅ | ✅ | - | - | - |
| [讯飞星火](https://console.xfyun.cn/) | ✅ | - | - | - | - |
| [智谱](https://open.bigmodel.cn/overview) | ✅ | ✅ | - | ⚠️ 图片生成 | - |
| [腾讯混元](https://cloud.tencent.com/product/hunyuan) | ✅ | - | - | - | - |
| [百川](https://platform.baichuan-ai.com/console/apikey) | ✅ | ✅ | - | - | - |
| [MiniMax](https://www.minimaxi.com/user-center/basic-information) | ✅ | ✅ | - | - | - |
| [Deepseek](https://platform.deepseek.com/usage) | ✅ | - | - | - | - |
| [Moonshot](https://moonshot.ai/) | ✅ | - | - | - | - |
| [Mistral](https://mistral.ai/) | ✅ | ✅ | - | - | - |
| [Groq](https://console.groq.com/keys) | ✅ | - | - | - | - |
| [Amazon Bedrock](https://console.aws.amazon.com/bedrock/home) | ⚠️ 仅支持 Anthropic 模型 | - | - | - | - |
| [零一万物](https://platform.lingyiwanwu.com/details) | ✅ | - | - | - | - |
| [Cloudflare AI](https://ai.cloudflare.com/) | ✅ | - | ⚠️ stt | ⚠️ 图片生成 | - |
| [Midjourney](https://www.midjourney.com/) | - | - | - | - | [midjourney-proxy](https://github.com/novicezk/midjourney-proxy) |
| [Cohere](https://cohere.com/) | ✅ | - | - | - | - |
| [Stability AI](https://platform.stability.ai/account/credits) | - | - | - | ⚠️ 图片生成 | - |
| [Coze](https://www.coze.com/open/docs/chat?_lang=zh) | ✅ | - | - | - | - |
| [Ollama](https://github.com/ollama/ollama) | ✅ | ✅ | - | - | - |
| [Suno](https://suno.com/) | - | - | - | - | [Suno-API](https://github.com/Suno-API/Suno-API) |
## 感谢
- 本程序使用了以下开源项目
- [one-api](https://github.com/songquanpeng/one-api)为本项目的基础
- [Berry Free React Admin Template](https://github.com/codedthemes/berry-free-react-admin-template)为本项目的前端界面
- [minimal-ui-kit](https://github.com/minimal-ui-kit/material-kit-react),使用了其中的部分样式
- [new api](https://github.com/Calcium-Ion/new-api),Midjourney/Suno 模块的代码来源于此
- [go-zero](https://github.com/zeromicro/go-zero) - Token 限流器的实现
感谢以上项目的作者和贡献者
## 交流群
<img src="https://github.com/MartialBE/one-hub/assets/42402987/9b608d39-70ae-4b2e-be49-09afab6bd536" width="300">
## 其他
<a href="https://next.ossinsight.io/widgets/official/analyze-repo-stars-history?repo_id=689214770" target="_blank" style="display: block" align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://next.ossinsight.io/widgets/official/analyze-repo-stars-history/thumbnail.png?repo_id=689214770&image_size=auto&color_scheme=dark" width="721" height="auto">
<img alt="Star History of MartialBE/one-api" src="https://next.ossinsight.io/widgets/official/analyze-repo-stars-history/thumbnail.png?repo_id=689214770&image_size=auto&color_scheme=light" width="721" height="auto">
</picture>
</a>
", Assign "at most 3 tags" to the expected json: {"id":"8812","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"