作者:京东科技 张新磊
背景
最近一直在关注deepseek的动态,现在看到一则好消息,分享给大家;国家超算中心目前上线了deepseek且免费调用DeepSeek-R1:7B、DeepSeek-R1:14B、DeepSeek-R1:32B三个模型,具体操作如下
操作步骤
-
通过如下导航栏进入,进行购买

-
购买完成后,我们点击去使用,获取密钥

测试代码
1import requests 2import json 3 4url = "http://activity.scnet.cn:61080/v1/chat/completions" 5 6payload = json.dumps({ 7 "messages": [ 8 { 9 "role": "user", 10 "content": "写一首诗" 11 } 12 ], 13 "stream": True, 14 "model": "DeepSeek-R1-Distill-Qwen-32B", 15 "temperature": 0.5, 16 "presence_penalty": 0, 17 "frequency_penalty": 0, 18 "top_p": 1 19}, ensure_ascii=False).encode('utf-8') 20headers = { 21 'Accept': 'application/json, text/event-stream', 22 'Accept-Language': 'zh-CN,zh;q=0.9', 23 'Authorization': 'Bearer', # 插入访问密钥 24 'Connection': 'keep-alive', 25 'Content-Type': 'application/json', 26 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36', 27} 28 29response = requests.request("POST", url, headers=headers, data=payload, stream=True) 30 31for line in response.iter_lines(): 32 if line: 33 print(line.decode('utf-8'))
查看效果

