AI 语言大模型 免费上线啦 让 deepSeek 不在卡顿!
码本服务项目
完美接入 deepSeek 模型,并根据最新的数据进行微调!支持 ollama 的调用方法 提供 Java Curl 调用示例!网页版给各位免费使用啦!
目录
文章目录
介绍
是否还在为 deepSeek 的性能问题及无法使用而困扰?我们为您提供了一个免费的在线网页版解决方案,并支持通过API直接接入我们的服务!
使用指南
网页端使用
访问 LY码本录 网站后,您会在右下角发现一个机器人图标。这个图标代表了集成了 codebook-deepSeek 模型的语言助手,能够满足您的各种需求。

您也可以直接访问:https://bot.lingyuzhao.top/ui/chat/d9425dc77c723361
集成至您的系统
对于那些有远大理想和创新思维的开发者、领航者或AI爱好者来说,即使缺乏搭建模型所需的资源,也可以利用我们的API服务。我们的API设计与 ollama 完全兼容,包括 chat 和内容生成接口,使得集成到现有的知识系统变得简单快捷。
获取 API 访问权限
若您希望使用我们的API,请点击 立即购买 加入我们,开启全新的体验!
对话生成模型调用示例
直接使用 curl 来调用!
非流的调用
# 在这里要写您的 id 和 sk
curl "https://api.get.lingyuzhao.top:8081/api/chat/generate?id=您的id&sk=您的服务sk" \
-H "Content-Type: application/json" \
-d '{
"model": "CodeBook-deepSeek",
"prompt": "你好呀 很开心认识你",
"stream": false
}'
下面是回复数据
{
"model": "codeBook-DeepSeek",
"created_at": "2025-02-20T11:13:00.91449962Z",
"response": "<think>\n好的,现在我要仔细思考用户的问题,并给出详细的中文回复。用户发来的是“你好呀 很开心认识你”,这是在用中文表达问候和愉快的情绪。\n\n首先,我应该礼貌地回应用户的问候,表达同样高兴的认识之情。接下来,可以邀请用户多聊聊,了解他们的兴趣、爱好或者最近的生活情况,这样能让对话更深入,也显示出对用户的关心。\n\n可能的话,还可以加入一些轻松的话题,比如最近有没有什么有趣的事情发生,或者用户喜欢做什么活动等。这样不仅回应了问候,还主动开启了进一步交流的大门,让对话更加自然流畅。\n</think>\n\n你好呀!很高兴认识你!有什么我可以帮助你的吗?",
"done": true,
"done_reason": "stop",
"context": [
151644,
108386,
104256,
84141,
230,
102313,
100720,
56568,
151645,
151648,
198,
99692,
3837,
99601,
104515,
104857,
104107,
20002,
103936,
90395,
107485,
109648,
104811,
104787,
1773,
20002,
28291,
36407,
100146,
2073,
108386,
104256,
84141,
230,
102313,
100720,
56568,
33590,
100346,
18493,
11622,
104811,
102124,
113940,
33108,
107071,
108876,
3407,
101140,
3837,
35946,
99730,
113369,
29490,
104493,
107494,
113940,
3837,
102124,
101165,
102483,
107945,
110325,
1773,
104326,
3837,
73670,
104331,
20002,
42140,
115604,
3837,
99794,
104056,
100565,
5373,
103059,
100631,
104044,
104103,
99559,
3837,
99654,
106995,
105051,
33126,
100403,
3837,
74763,
114956,
32664,
107494,
104329,
3407,
87267,
100363,
3837,
104468,
101963,
101883,
104261,
108380,
3837,
101912,
104044,
104710,
99245,
103027,
103976,
99726,
3837,
100631,
20002,
99729,
106428,
99600,
49567,
1773,
99654,
99902,
104493,
34187,
113940,
3837,
97706,
101966,
111923,
100642,
101069,
104197,
64689,
3837,
99258,
105051,
101896,
99795,
110205,
8997,
151649,
271,
108386,
104256,
6313,
112169,
100720,
56568,
6313,
104139,
109944,
100364,
103929,
101037,
11319
],
"total_duration": 8227799192,
"load_duration": 2980665634,
"prompt_eval_count": 10,
"prompt_eval_duration": 156000000,
"eval_count": 145,
"eval_duration": 5089000000
}
流的调用
# 在这里要写您的 id 和 sk
curl "https://api.get.lingyuzhao.top:8081/api/chat/generate?id=您的id&sk=您的服务sk" \
-H "Content-Type: application/json" \
-d '{
"model": "CodeBook-deepSeek",
"prompt": "你好呀 很开心认识你",
"stream": true
}'
下面是回复数据
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.454634366Z","response":"<think>","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.489679962Z","response":"\n","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.524833742Z","response":"好","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.559989338Z","response":",","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.595085778Z","response":"用户","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.630118383Z","response":"说","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.665046226Z","response":"“","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.700078343Z","response":"你好","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.735096141Z","response":"呀","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.804842666Z","response":" 很","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.839803265Z","response":"开心","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.874719794Z","response":"认识","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.909621307Z","response":"你","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.944544052Z","response":"”,","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:43.979476225Z","response":"我","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:44.014565542Z","response":"该怎么","done":false}
........................
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:48.250665601Z","response":"你想","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:48.285743394Z","response":"聊","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:48.321389066Z","response":"些什么","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:48.356872777Z","response":"呢","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:48.392019573Z","response":"?","done":false}
{"model":"codeBook-DeepSeek","created_at":"2025-02-20T11:17:48.427794243Z","response":"","done":true,"done_reason":"stop","context":[151644,108386,104256,84141,230,102313,100720,56568,151645,151648,198,52801,3837,20002,36587,2073,108386,104256,84141,230,102313,100720,56568,33590,35946,110801,104493,101036,11319,101140,3837,100662,106098,33108,102379,20412,99936,1773,35946,99730,102124,20221,107948,102313,90395,100136,100437,42411,3407,106287,3837,73670,60726,11622,104811,104493,3837,99654,33126,109010,1773,101889,3837,102106,56007,111410,104139,109944,106128,9370,3837,100631,99172,100281,109565,1773,114717,3837,105051,26232,100640,101169,3407,101948,3837,102064,30534,99795,3837,115596,101093,1773,101912,11622,2073,104256,854,101893,110098,99689,3837,104392,33126,105874,33108,106098,3407,116880,3837,104493,99730,100630,5122,113940,5373,102313,108876,102124,5373,100437,3837,101034,104331,100642,101069,8997,151649,271,108386,104256,6313,104526,102483,100720,56568,26525,232,220,104139,109944,99663,103929,101037,11319,100631,107409,100281,109565,101036,11319],"total_duration":5047174822,"load_duration":23545179,"prompt_eval_count":10,"prompt_eval_duration":14000000,"eval_count":142,"eval_duration":5008000000}
java 调用
导入依赖
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
<dependency>
<groupId>io.github.BeardedManZhao</groupId>
<artifactId>zhao-utils</artifactId>
<version>1.2.20250218</version>
</dependency>
</dependencies>
非流式
package org.example;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import top.lingyuzhao.utils.StringFormatter;
import java.io.IOException;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) throws IOException {
StringFormatter format = StringFormatter.createFormat(
"{\"prompt\": \"{zhaoZhao}\", \"stream\":false}", Pattern.compile("\\{zhaoZhao}")
);
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost("https://api.get.lingyuzhao.top:8081/api/chat/generate?id=48&sk=2531543885707671800");
httpPost.setEntity(new StringEntity(
format.function("你好,很高兴认识你!"), ContentType.APPLICATION_JSON
));
try (CloseableHttpResponse execute = httpClient.execute(httpPost)) {
if (execute.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("请求失败");
}
System.out.println(EntityUtils.toString(execute.getEntity()));
}
}
}
}
下面是回复数据
{
"model": "codeBook-DeepSeek",
"created_at": "2025-02-20T11:26:44.046575057Z",
"response": "<think>\n嗯,用户发来一条问候:“你好,很高兴认识你!”看起来他想和我建立联系。首先,我需要回应他的问候,表达我也很高兴认识他。然后,我应该邀请他告诉我更多关于自己或他感兴趣的话题,这样可以引导对话继续下去。我要确保语气友好且开放,让他感到舒适,愿意进一步交流。\n\n也许他会问一些问题或者分享自己的兴趣爱好,所以我得准备好各种话题的应对策略。同时,保持回应简洁明了,避免信息过载,让用户感觉自然流畅。还要注意用词亲切,比如使用“朋友”这样的称呼,增加亲和力。\n\n接下来,我应该怎样组织语言呢?先感谢他的问候,然后表达高兴认识他,最后邀请他分享更多信息。这样结构清晰,逻辑顺畅,能够有效引导对话的发展。同时,避免任何可能让用户感到压力的语言,确保他可以轻松地继续交流。\n\n总的来说,回应需要友好、开放,并且鼓励用户进一步互动。这样才能让整个对话过程愉快且有意义。\n</think>\n\n你好!很高兴认识你!有什么我可以帮助你的吗?",
"done": true,
"done_reason": "stop",
"context": [
151644,
108386,
3837,
112169,
100720,
56568,
6313,
151645,
151648,
198,
106287,
3837,
20002,
28291,
36407,
101946,
113940,
36987,
108386,
3837,
112169,
100720,
56568,
75758,
104544,
42411,
99172,
33108,
35946,
100641,
72064,
1773,
101140,
3837,
35946,
85106,
104493,
100648,
113940,
3837,
102124,
104284,
112169,
100720,
42411,
1773,
101889,
3837,
35946,
99730,
104331,
42411,
106525,
99573,
101888,
99283,
57191,
42411,
103198,
108380,
3837,
99654,
73670,
104042,
105051,
100640,
101169,
1773,
104515,
103944,
110098,
106098,
100136,
100713,
3837,
104358,
104048,
102476,
3837,
102167,
100642,
101069,
3407,
102106,
109345,
56007,
101883,
86119,
100631,
93149,
100005,
100565,
103059,
3837,
107020,
49828,
108720,
100646,
105167,
9370,
104397,
104238,
1773,
91572,
3837,
100662,
104493,
110485,
30858,
34187,
3837,
101153,
27369,
38182,
27366,
3837,
115987,
100681,
99795,
110205,
1773,
104019,
60533,
11622,
99689,
109010,
3837,
101912,
37029,
2073,
99614,
854,
101893,
112451,
3837,
100649,
99396,
33108,
47534,
3407,
104326,
3837,
35946,
99730,
102066,
99877,
102064,
101036,
11319,
60726,
104305,
100648,
113940,
3837,
101889,
102124,
102483,
100720,
42411,
3837,
100161,
104331,
42411,
93149,
110074,
1773,
99654,
100166,
104542,
3837,
104913,
110699,
3837,
100006,
88086,
104042,
105051,
103949,
1773,
91572,
3837,
101153,
99885,
87267,
115987,
104048,
101950,
109824,
3837,
103944,
42411,
73670,
104261,
29490,
100640,
101069,
3407,
116880,
3837,
104493,
85106,
106098,
5373,
100713,
90395,
100136,
104125,
20002,
100642,
104199,
1773,
109095,
99258,
101908,
105051,
100178,
107071,
100136,
111087,
8997,
151649,
271,
108386,
6313,
112169,
100720,
56568,
6313,
104139,
109944,
100364,
103929,
101037,
11319
],
"total_duration": 8091550760,
"load_duration": 26371884,
"prompt_eval_count": 9,
"prompt_eval_duration": 27000000,
"eval_count": 227,
"eval_duration": 8037000000
}
流式
package org.example;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import top.lingyuzhao.utils.StringFormatter;
import java.io.IOException;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) throws IOException {
StringFormatter format = StringFormatter.createFormat(
"{\"prompt\": \"{zhaoZhao}\", \"stream\":true}", Pattern.compile("\\{zhaoZhao}")
);
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost("https://api.get.lingyuzhao.top:8081/api/chat/generate?id=您的服务ID&sk=您的SK");
httpPost.setEntity(new StringEntity(
format.function("你好,很高兴认识你!"), ContentType.APPLICATION_JSON
));
try (CloseableHttpResponse execute = httpClient.execute(httpPost)) {
if (execute.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("请求失败");
}
System.out.println(EntityUtils.toString(execute.getEntity()));
}
}
}
}
如果您需要一个更全的示例,处理流式消息,那么这是一个交互式的,体现出流式的有趣!
package org.example;
import com.alibaba.fastjson2.JSONObject;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import top.lingyuzhao.utils.StringFormatter;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) throws IOException {
StringFormatter format = StringFormatter.createFormat(
"{\"prompt\": \"{zhaoZhao}\", \"stream\":true}", Pattern.compile("\\{zhaoZhao}")
);
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost("https://api.get.lingyuzhao.top:8081/api/chat/generate?id=您的服务id&sk=您的sk");
Scanner scanner = new Scanner(System.in);
while (true) {
System.out.print("\n > ");
String function = format.function(scanner.nextLine());
System.out.println(function);
httpPost.setEntity(new StringEntity(function, ContentType.APPLICATION_JSON));
try (CloseableHttpResponse execute = httpClient.execute(httpPost)) {
if (execute.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("请求失败");
}
// 获取到回复数据
try (BufferedReader content = new BufferedReader(new InputStreamReader(execute.getEntity().getContent()))) {
String line;
JSONObject jsonObject;
while ((line = content.readLine()) != null) {
jsonObject = JSONObject.parseObject(line);
System.out.print(jsonObject.getString("response"));
}
}
}
}
}
}
}
多轮对话模型调用示例
多轮对话可以将您之前的对话记住,这能够实现用户对话的连贯性!!
curl 调用 非流
curl "https://api.get.lingyuzhao.top:8081/api/chat/?id=48&sk=2531543885707671800" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": "你好,我叫zhao,请记住我!"
},
{
"role": "assistant",
"content": "你好,赵!我已经记住了你的名字。有什么我可以帮你的吗?"
},
{
"role": "user",
"content": "你还记得我叫什么吗?"
}
],
"stream": false
}'
下面是返回的 json
{
"model": "codeBook-DeepSeek",
"created_at": "2025-02-20T11:42:52.014753014Z",
"message": {
"role": "assistant",
"content": "<think>\nOkay, the user just asked me if I remember their name. Let me check our conversation history.\n\nOh right, the user introduced themselves as Zhao earlier. But in my response, I called them赵 instead of Zhao. That might have confused them because Zhao is the English version, while 赵 is their surname in Chinese.\n\nI should acknowledge that I do remember them and confirm their name clearly. Maybe they're concerned about whether I recognize them or if there's been a mix-up.\n\nI want to make sure my response is friendly and reassuring. Apologizing for any confusion could help build trust. Offering further assistance shows I'm here to help with whatever they need.\n</think>\n\n你好!是的,我记得你叫赵。有什么我可以帮助你的吗?如果有任何事情需要我帮忙,请随时告诉我!"
},
"done_reason": "stop",
"done": true,
"total_duration": 6261329730,
"load_duration": 20128422,
"prompt_eval_count": 39,
"prompt_eval_duration": 38000000,
"eval_count": 166,
"eval_duration": 5866000000
}
Java 调用 非流 交互的
package org.example;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.util.Scanner;
public class Main2 {
public static void main(String[] args) throws IOException {
// 构建请求体
JSONObject jsonObject1 = JSONObject.parseObject("{\"messages\": \"[]\", \"stream\":false}");
// 设置消息历史
JSONArray objects = jsonObject1.putArray("messages");
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost("https://api.get.lingyuzhao.top:8081/api/chat/?id=48&sk=2531543885707671800");
Scanner scanner = new Scanner(System.in);
while (true) {
System.out.print("\n > ");
// 构建消息对象
JSONObject jsonObject2 = objects.addObject();
jsonObject2.put("role", "user");
jsonObject2.put("content", scanner.nextLine());
httpPost.setEntity(new StringEntity(jsonObject1.toString(), ContentType.APPLICATION_JSON));
try (CloseableHttpResponse execute = httpClient.execute(httpPost)) {
if (execute.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("请求失败");
}
// 获取到回复数据
JSONObject jsonObject = JSONObject.parseObject(EntityUtils.toString(execute.getEntity()));
String string = jsonObject.getJSONObject("message").getString("content");
System.out.println(string);
// 将历史消息追加
JSONObject jsonObject3 = objects.addObject();
jsonObject3.put("role", "assistant");
jsonObject3.put("content", string);
}
}
}
}
}
java调用 流式 交互的
package org.example;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class Main2 {
public static void main(String[] args) throws IOException {
// 构建请求体
JSONObject jsonObject1 = JSONObject.parseObject("{\"messages\": \"[]\", \"stream\":true}");
// 设置消息历史
JSONArray objects = jsonObject1.putArray("messages");
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost("https://api.get.lingyuzhao.top:8081/api/chat/?id=48&sk=2531543885707671800");
Scanner scanner = new Scanner(System.in);
while (true) {
System.out.print("\n > ");
// 构建消息对象
JSONObject jsonObject2 = objects.addObject();
jsonObject2.put("role", "user");
jsonObject2.put("content", scanner.nextLine());
httpPost.setEntity(new StringEntity(jsonObject1.toString(), ContentType.APPLICATION_JSON));
try (CloseableHttpResponse execute = httpClient.execute(httpPost)) {
if (execute.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("请求失败");
}
// 获取到回复数据
try (BufferedReader content = new BufferedReader(new InputStreamReader(execute.getEntity().getContent()))) {
String line;
JSONObject jsonObject;
StringBuilder stringBuilder = new StringBuilder();
while ((line = content.readLine()) != null) {
// 如果您使用的是流式的 API 则在这里会接受到每一个 JSON 数据块
jsonObject = JSONObject.parseObject(line);
// 在这里输出每一条数据块
String string = jsonObject.getJSONObject("message").getString("content");
System.out.print(string);
// 构建历史消息
stringBuilder.append(string);
}
// 将历史消息追加
JSONObject jsonObject3 = objects.addObject();
jsonObject3.put("role", "assistant");
jsonObject3.put("content", stringBuilder.toString());
}
}
}
}
}
}

3027

被折叠的 条评论
为什么被折叠?



