|
--- |
|
title: Duck2api |
|
emoji: 🏆 |
|
colorFrom: pink |
|
colorTo: red |
|
sdk: docker |
|
pinned: false |
|
license: apache-2.0 |
|
short_description: duck 2 api service |
|
thumbnail: >- |
|
https://cdn-uploads.huggingface.co/production/uploads/6642196ec80d018c28a68e9a/PHwTcv57ZhgW7--5-HTRn.png |
|
--- |
|
|
|
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference |
|
|
|
|
|
# duck2api |
|
|
|
> 高版本使用网站 https://duck.ai 进行访问 |
|
|
|
### native 编译部署 |
|
|
|
```bash |
|
git clone https://github.com/openChatGpts/Duck2api.git |
|
cd Duck2api |
|
go build -o duck2api |
|
chmod +x ./duck2api |
|
./duck2api |
|
``` |
|
## huggingface 部署 |
|
fork 项目,ok |
|
|
|
## huggingface访问 |
|
|
|
``` bash |
|
curl --location 'https://sanbo1200-duck2api.hf.space/completions' \ |
|
--header 'Content-Type: application/json' \ |
|
--data '{ |
|
"model": "gpt-4o-mini", |
|
"messages": [{"role":"system","content":"你是一个辅助机器人"},{"role": "user", "content": "你的知识库最后什么日期"}], |
|
"stream": true |
|
}' |
|
|
|
curl --location 'https://sanbo1200-duck2api.hf.space/api/v1/chat/completions' \ |
|
--header 'Content-Type: application/json' \ |
|
--data '{ |
|
"model": "gpt-4o-mini", |
|
"messages": [{"role":"system","content":"你是一个辅助机器人"},{"role": "user", "content": "你的知识库最后什么日期"}], |
|
"stream": true |
|
}' |
|
|
|
curl --location 'https://sanbo1200-duck2api.hf.space/hf/v1/chat/completions' \ |
|
--header 'Content-Type: application/json' \ |
|
--data '{ |
|
"model": "gpt-4o-mini", |
|
"messages": [{"role":"system","content":"你是一个辅助机器人"},{"role": "user", "content": "你的知识库最后什么日期"}], |
|
"stream": true |
|
}' |
|
|
|
``` |
|
|
|
### 国内反代地址(maybe) |
|
|
|
``` bash |
|
curl --location 'https://2.897653.xyz/aaabbbccc/https/sanbo1200-duck2api.hf.space/completions' \ |
|
--header 'Content-Type: application/json' \ |
|
--data '{ |
|
"model": "gpt-4o-mini", |
|
"messages": [{"role":"system","content":"你是一个辅助机器人"},{"role": "user", "content": "你的知识库最后什么日期"}], |
|
"stream": true |
|
}' |
|
``` |
|
|
|
|
|
## 支持的模型 |
|
|
|
- claude-3-haiku |
|
- llama-3.1-70b |
|
- mixtral-8x7b |
|
- gpt-4o-mini |
|
|
|
## 高级设置 |
|
|
|
默认情况不需要设置,除非你有需求 |
|
|
|
### 环境变量 |
|
``` |
|
Authorization=your_authorization 用户认证 key。 |
|
TLS_CERT=path_to_your_tls_cert 存储TLS(传输层安全协议)证书的路径。 |
|
TLS_KEY=path_to_your_tls_key 存储TLS(传输层安全协议)证书的路径。 |
|
PROXY_URL=your_proxy_url 添加代理池来。 |
|
``` |
|
|
|
## 参考项目 |
|
|
|
https://github.com/xqdoo00o/ChatGPT-to-API |