Comments (12)
如果你已经部署在本地并且使用8000端口,可以用以下代码请求。
@DemonsAH
curl --location --request POST 'http://localhost:8000/v1/chat/completions' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpX...' \
--header 'Content-Type: application/json' \
--data '{
"model": "kimi",
"messages": [
{
"role": "user",
"content": "你是谁?"
}
]
}'
响应内容:
{
"id": "co9bsopldu5r8bme6fp0",
"model": "kimi",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "我是Kimi,由月之暗面科技有限公司开发的人工智能助手。我在这里为您提供帮助,回答问题,解决问题,并提供信息。无论是日常知识、数据分析还是其他任何问题,只要告诉我,我都会尽力为您提供准确和有用的回答。"
},
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 1, "completion_tokens": 1, "total_tokens": 2 },
"created": 1712504419
}
from kimi-free-api.
@adminlove520 vercel我测试部署正常,可能得提供更多信息确认。
我感觉应该问题在 我用的vps上 回头搞个国内的主机测试一下 谢谢解惑啦 @Vinlic
from kimi-free-api.
@Vinlic 感谢大佬回答!可惜仍是不能顺利收到正确的响应内容
使用wsl ubuntu原生部署,运行上面的命令得到下面的报错:
$ curl --location --request POST 'http://localhost:8000/v1/chat/completions' --header 'Authorization: Bearer eyJhbG...' --header 'Content-Type: application/json' --data '{
"model": "kimi",
"messages": [
{
"role": "user",
"content": "你是谁?"
}
]
}'
{"code":-1,"message":"Internal error","data":null}
此时pm2 log 有反应同样报错
(如果用本机IP代替localhost报错变为Timeout,pm2 log能收到信息和token)
Docker部署
使用windows Docker Desktop部署完成后
使用anaconda直接跑python代码(跟着这个教程)
简述操作:python使用opanai的示例代码,修改token和base url
Docker显示如下:
(使用本机IP代替localhost无区别)
最后尝试Dify和NextChat(跟着这个教程)
操作与上面无异,即使用OpenAI端口,修改token和base
结果: Dify在设置供应商时Connection error
NextChat报错 failed to fetch
问题: 这些报错是否来自相同的原因?有没有本机为国外IP无法使用服务的可能?
from kimi-free-api.
@DemonsAH base url设置错误,/chat/completions不包含在base url中,另外curl调用有问题需要提供服务的日志截图。
不建议把服务部署在国外服务器,有可能连不上kimi。
from kimi-free-api.
作为一个纯小白,遇到了这样的问题
使用windows Docker Desktop部署完成后,
运行时出错了
from kimi-free-api.
@denghb001 请查看容器日志并截图方便检查
from kimi-free-api.
@Vinlic 请问 docker部署好之后,curl成功,但是nextchat内配置之后一直返回
{
"error": true,
"message": "Failed to fetch"
}
和
{
"error": true,
"message": "empty response from server"
}
from kimi-free-api.
请问这个如何解决呀 按理说 curl通的话 nextchat应该可以的呀 baseurl试了好几次。。 @Vinlic
from kimi-free-api.
@adminlove520 检查你在使用nextchat调用时的容器日志
from kimi-free-api.
@adminlove520 检查你在使用nextchat调用时的容器日志
甚至请求都没到容器日志 vercel部署的nextchat
from kimi-free-api.
但是吧 本地部署的nextchat就可以正常调用 vercel就不行 网络的问题嘛?
from kimi-free-api.
@adminlove520 vercel我测试部署正常,可能得提供更多信息确认。
from kimi-free-api.
Related Issues (20)
- 大佬能否增加一下Vercel的部署教程? HOT 2
- 可以增加代理池功能吗 HOT 1
- Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. HOT 2
- 在Dify中无法和图片对话 HOT 2
- paper
- DNS查询错误 HOT 1
- ocr能力是哪里来的啊 HOT 1
- 接口好像不支持非stream的模式 HOT 1
- api无法使用 HOT 9
- vercel免费版增加到60s啦 HOT 1
- 我http请求发送成功了,但是返回值好像不太对 HOT 1
- ERR! chatProcess Error FetchError: request to http://localhost:8000/v1/chat/completions failed, reason: connect ECONNREFUSED ::1:8000 HOT 1
- 怎么接入本地的oneapi中,配合fastgpt使用? HOT 1
- 怎么使用python直接在代码里发起http请求呢 HOT 2
- 如何兼容openai的调用方法? HOT 11
- docker同时部署qwen & kimi HOT 2
- 功能建议:通过网关整合所有的模型到一个docker镜像里面,通过 参数"model": "XXX"来调用不同的LLM,支持对用户token的管理
- 图片处理不到啊 HOT 1
- 是不是不能用了?一直无法连接上 HOT 1
- Vercel 部署后访问 404 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kimi-free-api.