large language
DeepSeek V3.2
DeepSeek's new hybrid reasoning model with efficient long context scaling
Model details
View repositoryExample usage
DeepSeek V3.2 runs using the Baseten Inference Stack and is accessible via an OpenAI-compatible API endpoint.
Input
1# You can use this model with any of the OpenAI clients in any language!
2# Simply change the API Key to get started
3from openai import OpenAI
4import os
5client = OpenAI(
6 api_key=os.getenv("BASETEN_API_KEY"),
7 base_url="https://inference.baseten.co/v1"
8)
9response = client.chat.completions.create(
10 model="deepseek-ai/DeepSeek-V3.2",
11 messages=[
12 {
13 "role": "user",
14 "content": "Implement Hello World in Python"
15 }
16 ],
17 stream=True,
18 stream_options={
19 "include_usage": True,
20 "continuous_usage_stats": True
21 },
22 top_p=1,
23 max_tokens=1000,
24 temperature=1,
25 presence_penalty=0,
26 frequency_penalty=0
27)
28for chunk in response:
29 if chunk.choices and chunk.choices[0].delta.content is not None:
30 print(chunk.choices[0].delta.content, end="", flush=True)JSON output
1{
2 "id": "chatcmpl-130642b89fba4c4d9ea162ba88a1153a",
3 "object": "text_completion",
4 "created": 1764865060,
5 "model": "deepseek-ai/DeepSeek-V3.2",
6 "choices": [
7 {
8 "index": 0,
9 "text": "Here's the classic \"Hello, World!\" program in Python:\n\n```python\nprint(\"Hello, World!\")\n```\n\nThat's it! Just one line. When you run this program, it will display:\n```\nHello, World!\n```\n\n## How to run it:\n\n1. **Save the code** in a file with a `.py` extension (e.g., `hello.py`)\n2. **Run it** using one of these methods:\n - Command line: `python hello.py`\n - In an IDE like VS Code, PyCharm, or IDLE\n - Online Python interpreters\n\n## Alternative versions:\n\n**Using a function:**\n```python\ndef main():\n print(\"Hello, World!\")\n\nif __name__ == \"__main__\":\n main()\n```\n\n**Using f-string (Python 3.6+):**\n```python\nmessage = \"Hello, World!\"\nprint(f\"{message}\")\n```\n\n**Multiline version:**\n```python\nprint(\"Hello,\")\nprint(\"World!\")\n```\n\nPython is known for its simplicity and readability, which is why \"Hello, World!\" is so straightforward!",
10 "logprobs": null,
11 "finish_reason": "stop",
12 "matched_stop": 1
13 }
14 ],
15 "usage": {
16 "prompt_tokens": 9,
17 "total_tokens": 237,
18 "completion_tokens": 228,
19 "prompt_tokens_details": null
20 }
21}