The latest Deepseek model.

The latest Deepseek model.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.getenv("ATLASCLOUD_API_KEY"),
base_url="https://api.atlascloud.ai/v1"
)
response = client.chat.completions.create(
model="deepseek-ai/deepseek-ocr",
messages=[
{
"role": "user",
"content": "hello"
}
],
max_tokens=1024,
temperature=0.7
)
print(response.choices[0].message.content)사용하는 언어에 필요한 패키지를 설치하세요.
pip install requests모든 API 요청에는 API 키를 통한 인증이 필요합니다. Atlas Cloud 대시보드에서 API 키를 받을 수 있습니다.
export ATLASCLOUD_API_KEY="your-api-key-here"import os
API_KEY = os.environ.get("ATLASCLOUD_API_KEY")
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {API_KEY}"
}클라이언트 측 코드나 공개 저장소에 API 키를 노출하지 마세요. 대신 환경 변수 또는 백엔드 프록시를 사용하세요.
import requests
url = "https://api.atlascloud.ai/v1/chat/completions"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer $ATLASCLOUD_API_KEY"
}
data = {
"model": "your-model",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 1024
}
response = requests.post(url, headers=headers, json=data)
print(response.json())다음 매개변수가 요청 본문에서 사용 가능합니다.
{
"model": "deepseek-ai/deepseek-ocr",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 1024,
"temperature": 0.7,
"stream": false
}API는 ChatCompletion 호환 응답을 반환합니다.
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "model-name",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I assist you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 20,
"total_tokens": 30
}
}Atlas Cloud Skills는 300개 이상의 AI 모델을 AI 코딩 어시스턴트에 직접 통합합니다. 한 번의 명령으로 설치하고 자연어로 이미지, 동영상 생성 및 LLM과 대화할 수 있습니다.
npx skills add AtlasCloudAI/atlas-cloud-skillsAtlas Cloud 대시보드에서 API 키를 받아 환경 변수로 설정하세요.
export ATLASCLOUD_API_KEY="your-api-key-here"설치 후 AI 어시스턴트에서 자연어를 사용하여 모든 Atlas Cloud 모델에 접근할 수 있습니다.
Atlas Cloud MCP Server는 Model Context Protocol을 통해 IDE와 300개 이상의 AI 모델을 연결합니다. MCP 호환 클라이언트에서 사용할 수 있습니다.
npx -y atlascloud-mcp다음 설정을 IDE의 MCP 설정 파일에 추가하세요.
{
"mcpServers": {
"atlascloud": {
"command": "npx",
"args": [
"-y",
"atlascloud-mcp"
],
"env": {
"ATLASCLOUD_API_KEY": "your-api-key-here"
}
}
}
}DeepSeek-V3.1 is a hybrid model that supports both thinking mode and non-thinking mode. Compared to the previous version, this upgrade brings improvements in multiple aspects:
Hybrid thinking mode: One model supports both thinking mode and non-thinking mode by changing the chat template.
Smarter tool calling: Through post-training optimization, the model's performance in tool usage and agent tasks has significantly improved.
Higher thinking efficiency: DeepSeek-V3.1-Think achieves comparable answer quality to DeepSeek-R1-0528, while responding more quickly.
DeepSeek-V3.1 is post-trained on the top of DeepSeek-V3.1-Base, which is built upon the original V3 base checkpoint through a two-phase long context extension approach, following the methodology outlined in the original DeepSeek-V3 report. We have expanded our dataset by collecting additional long documents and substantially extending both training phases. The 32K extension phase has been increased 10-fold to 630B tokens, while the 128K extension phase has been extended by 3.3x to 209B tokens. Additionally, DeepSeek-V3.1 is trained using the UE8M0 FP8 scale data format to ensure compatibility with microscaling data formats.
| Model | #Total Params | #Activated Params | Context Length | Download |
|---|---|---|---|---|
| DeepSeek-V3.1-Base | 671B | 37B | 128K | HuggingFace | ModelScope |
| DeepSeek-V3.1 | 671B | 37B | 128K | HuggingFace | ModelScope |
The details of our chat template is described in tokenizer_config.json and assets/chat_template.jinja. Here is a brief description.
v3.1 support both thinking and no-thinking. we now both support turning thinking with qwen mode
"chat_template_kwargs": {"enable_thinking": true}
and zai mode
"thinking":{"type":"enabled"}
Toolcall is supported in non-thinking mode. The format is:
<|begin▁of▁sentence|>{system prompt}{tool_description}<|User|>{query}<|Assistant|></think> where the tool_description is
## Tools You have access to the following tools: ### {tool_name1} Description: {description} Parameters: {json.dumps(parameters)} IMPORTANT: ALWAYS adhere to this exact format for tool use: <|tool▁calls▁begin|><|tool▁call▁begin|>tool_call_name<|tool▁sep|>tool_call_arguments<|tool▁call▁end|>{{additional_tool_calls}}<|tool▁calls▁end|> Where: - `tool_call_name` must be an exact match to one of the available tools - `tool_call_arguments` must be valid JSON that strictly follows the tool's Parameters Schema - For multiple tool calls, chain them directly without separators or spaces
We support various code agent frameworks. Please refer to the above toolcall format to create your own code agents. An example is shown in assets/code_agent_trajectory.html.
We design a specific format for searching toolcall in thinking mode, to support search agent.
For complex questions that require accessing external or up-to-date information, DeepSeek-V3.1 can leverage a user-provided search tool through a multi-turn tool-calling process.
Please refer to the assets/search_tool_trajectory.html and assets/search_python_tool_trajectory.html for the detailed template.
| Category | Benchmark (Metric) | DeepSeek V3.1-NonThinking | DeepSeek V3 0324 | DeepSeek V3.1-Thinking | DeepSeek R1 0528 |
|---|---|---|---|---|---|
| General | |||||
| MMLU-Redux (EM) | 91.8 | 90.5 | 93.7 | 93.4 | |
| MMLU-Pro (EM) | 83.7 | 81.2 | 84.8 | 85.0 | |
| GPQA-Diamond (Pass@1) | 74.9 | 68.4 | 80.1 | 81.0 | |
| Humanity's Last Exam (Pass@1) | - | - | 15.9 | 17.7 | |
| Search Agent | |||||
| BrowseComp | - | - | 30.0 | 8.9 | |
| BrowseComp_zh | - | - | 49.2 | 35.7 | |
| Humanity's Last Exam (Python + Search) | - | - | 29.8 | 24.8 | |
| SimpleQA | - | - | 93.4 | 92.3 | |
| Code | |||||
| LiveCodeBench (2408-2505) (Pass@1) | 56.4 | 43.0 | 74.8 | 73.3 | |
| Codeforces-Div1 (Rating) | - | - | 2091 | 1930 | |
| Aider-Polyglot (Acc.) | 68.4 | 55.1 | 76.3 | 71.6 | |
| Code Agent | |||||
| SWE Verified (Agent mode) | 66.0 | 45.4 | - | 44.6 | |
| SWE-bench Multilingual (Agent mode) | 54.5 | 29.3 | - | 30.5 | |
| Terminal-bench (Terminus 1 framework) | 31.3 | 13.3 | - | 5.7 | |
| Math | |||||
| AIME 2024 (Pass@1) | 66.3 | 59.4 | 93.1 | 91.4 | |
| AIME 2025 (Pass@1) | 49.8 | 51.3 | 88.4 | 87.5 | |
| HMMT 2025 (Pass@1) | 33.5 | 29.2 | 84.2 | 79.4 |
Note:
Search agents are evaluated with our internal search framework, which uses a commercial search API + webpage filter + 128K context window. Seach agent results of R1-0528 are evaluated with a pre-defined workflow.
SWE-bench is evaluated with our internal code agent framework.
HLE is evaluated with the text-only subset.
import transformers tokenizer = transformers.AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-V3.1") messages = [ {"role": "system", "content": "You are a helpful assistant"}, {"role": "user", "content": "Who are you?"}, {"role": "assistant", "content": "<think>Hmm</think>I am DeepSeek"}, {"role": "user", "content": "1+1=?"} ] tokenizer.apply_chat_template(messages, tokenize=False, thinking=True, add_generation_prompt=True) # '<|begin▁of▁sentence|>You are a helpful assistant<|User|>Who are you?<|Assistant|></think>I am DeepSeek<|end▁of▁sentence|><|User|>1+1=?<|Assistant|><think>' tokenizer.apply_chat_template(messages, tokenize=False, thinking=False, add_generation_prompt=True) # '<|begin▁of▁sentence|>You are a helpful assistant<|User|>Who are you?<|Assistant|></think>I am DeepSeek<|end▁of▁sentence|><|User|>1+1=?<|Assistant|></think>'
The model structure of DeepSeek-V3.1 is the same as DeepSeek-V3. Please visit DeepSeek-V3 repo for more information about running this model locally.
This repository and the model weights are licensed under the MIT License.
@misc{deepseekai2024deepseekv3technicalreport, title={DeepSeek-V3 Technical Report}, author={DeepSeek-AI}, year={2024}, eprint={2412.19437}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2412.19437}, }
If you have any questions, please raise an issue or contact us at [email protected].