DeepSeek:性能强劲的开源模型

deepseek

全新系列模型 DeepSeek-V3 首个版本上线并同步开源。登录官网 chat.deepseek.com 即可与最新版 V3 模型对话。

性能对齐海外领军闭源模型

DeepSeek-V3 为自研 MoE 模型,671B 参数,激活 37B,在 14.8T token 上进行了预训练。

论文链接: DeepSeek-V3/DeepSeek_V3.pdf at main · deepseek-ai/DeepSeek-V3 · GitHub

DeepSeek-V3 多项评测成绩超越了 Qwen2.5-72B 和 Llama-3.1-405B 等其他开源模型,并在性能上和世界顶尖的闭源模型 GPT-4o 以及 Claude-3.5-Sonnet 不分伯仲。

  • 百科知识: DeepSeek-V3 在知识类任务(MMLU, MMLU-Pro, GPQA, SimpleQA)上的水平相比前代 DeepSeek-V2.5 显著提升,接近当前表现最好的模型 Claude-3.5-Sonnet-1022。
  • 长文本: 在长文本测评中,DROP、FRAMES 和 LongBench v2 上,DeepSeek-V3 平均表现超越其他模型。
  • 代码: DeepSeek-V3 在算法类代码场景(Codeforces),远远领先于市面上已有的全部非 o1 类模型;并在工程类代码场景(SWE-Bench Verified)逼近 Claude-3.5-Sonnet-1022。
  • 数学: 在美国数学竞赛(AIME 2024, MATH)和全国高中数学联赛(CNMO 2024)上,DeepSeek-V3 大幅超过了所有开源闭源模型。
  • 中文能力: DeepSeek-V3 与 Qwen2.5-72B 在教育类测评 C-Eval 和代词消歧等评测集上表现相近,但在事实知识 C-SimpleQA 上更为领先。

最新的活动

登录DeepSeek的官网

点击接入API,注册就送500万的token数量

接入API

点击接口文档,首次调用API,下面有实例demo,按照demo通过postman工具先调用试试

bash 复制代码
curl https://api.deepseek.com/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <DeepSeek API Key>" \
  -d '{
        "model": "deepseek-chat",
        "messages": [
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Hello!"}
        ],
        "stream": false
      }'

记得修改headerAuthorizationBearer <DeepSeek API Key> 改成自己的token,Bearer sk-b8ebb504f8994f98964850b2这样的

得到问答结果

golang 接入API

go 复制代码
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

type Completion struct {
	ID      string `json:"id"`
	Object  string `json:"object"`
	Created int64  `json:"created"`
	Model   string `json:"model"`
	Choices []struct {
		Index   int `json:"index"`
		Message struct {
			Role    string `json:"role"`
			Content string `json:"content"`
		} `json:"message"`
		Logprobs     interface{} `json:"logprobs"`
		FinishReason string      `json:"finish_reason"`
	} `json:"choices"`
	Usage struct {
		PromptTokens          int `json:"prompt_tokens"`
		CompletionTokens      int `json:"completion_tokens"`
		TotalTokens           int `json:"total_tokens"`
		PromptCacheHitTokens  int `json:"prompt_cache_hit_tokens"`
		PromptCacheMissTokens int `json:"prompt_cache_miss_tokens"`
	} `json:"usage"`
	SystemFingerprint string `json:"system_fingerprint"`
}

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type ChatRequest struct {
	Model    string    `json:"model"`
	Messages []Message `json:"messages"`
	Stream   bool      `json:"stream"`
}

func main() {
	url := "https://api.deepseek.com/chat/completions"
	// 创建请求体结构体
	requestBody := ChatRequest{
		Model: "deepseek-chat",
		Messages: []Message{
			{Role: "system", Content: "现在角色扮演,你是客服人员,你现在不用联网搜索信息,你按照逻辑推理合理的回答就可以了"},
			{Role: "user", Content: "我希望我们的预约网站能够越做越好"},
		},
		Stream: false,
	}

	// 将结构体转换为 JSON
	payload, err := json.Marshal(requestBody)
	if err != nil {
		fmt.Println("Error marshaling JSON:", err)
		return
	}

	// 创建请求
	req, err := http.NewRequest("POST", url, bytes.NewBuffer(payload))
	if err != nil {
		fmt.Println("Error:", err)
		return
	}

	// 设置请求头
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", "Bearer sk-b8ebb99508964850b2b1c")

	// 发送请求
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	// 读取响应
	body, _ := ioutil.ReadAll(resp.Body)
	fmt.Println(string(body))

	var completion Completion
	err = json.Unmarshal(body, &completion)
	if err != nil {
		fmt.Println("Error parsing JSON:", err)
		return
	}

	if len(completion.Choices) > 0 {
		content := completion.Choices[0].Message.Content
		fmt.Println("Content:", content)
	} else {
		fmt.Println("No choices available")
	}
}

结果

相关推荐
JaguarJack6 小时前
Openai Codex 重大更新 已支持接入任意开源大模型
ai·openai·codex
Artech14 小时前
[MAF预定义的AIContextProvider-02]AgentSkillsProvider——将Agent Skills引入MAF
ai·c#·agent·agent skills·maf
岳小哥AI16 小时前
读懂计算机视觉CV、语言感知(ASR/TTS)、多模态,就能理解AI是如何“看到”与“听到”世界的
ai·ai基础
大树881 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
施小赞1 天前
普通 RAG vs GraphRAG 核心对比
人工智能·ai
何以解忧,唯有..1 天前
Go语言循环语句详解:for、range与循环控制
开发语言·算法·golang
goldenrolan1 天前
A公司物料替代测试系统 v1.7:从需求到 exe/apk 的 AI 辅助全链路实践
android·自动化测试·软件测试·python·ai
gis分享者1 天前
GPT-Image-2 图像生成模型新手实战指南
gpt·ai·image·模型·图像生成
ofoxcoding1 天前
在AI API聚合平台配置DeepSeek V3.2提示词缓存实战:快速接入与成本优化指南
人工智能·spring·缓存·ai
m0_634666731 天前
Anthropic Fable/Mythos 被紧急暂停:前沿模型商业化开始碰到真正的政策墙
人工智能·ai·ai编程