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")
	}
}

结果

相关推荐
TTGGGFF2 小时前
零门槛部署本地 AI 助手:Clawdbot/Meltbot 部署深度保姆级教程
ai·agent·clawdbot
小二·3 小时前
Go 语言系统编程与云原生开发实战(第4篇):数据持久化深度实战 —— PostgreSQL、GORM 与 Repository 模式
postgresql·云原生·golang
SelectDB技术团队3 小时前
上市大模型企业数据基础设施的选择:MiniMax 基于阿里云 SelectDB 版,打造全球统一AI可观测中台
数据库·数据仓库·人工智能·ai·apache
雨声不在3 小时前
ollama日常使用
ai·ollama
雄狮少年3 小时前
大模型流式对话返回demo2
ai
云草桑3 小时前
.net AI开发05 第九章 新增 RAG 文档处理后台服务 RagWorker 及核心流程
人工智能·ai·.net·rag·qdrant
会游泳的石头3 小时前
构建企业级知识库智能问答系统:基于 Java 与 Spring Boot 的轻量实现
java·开发语言·spring boot·ai
艾莉丝努力练剑3 小时前
【AI时代的赋能与重构】当AI成为创作环境的一部分:机遇、挑战与应对路径
linux·c++·人工智能·python·ai·脉脉·ama
ddxu4 小时前
AI学习笔记
笔记·学习·ai
女王大人万岁4 小时前
Go标准库 path 详解
服务器·开发语言·后端·golang