DeepSeek-V3
A state-of-the-art 671B-parameter MoE LLM licensed for commercial use
Deploy DeepSeek-V3 behind an API endpoint in seconds.
Talk to salesExample usage
DeepSeek is optimized using SGLang and uses an OpenAI-compatible API endpoint.
Input
1import httpx
2import os
3
4MODEL_ID = "abcd1234" # Replace with your model ID
5DEPLOYMENT_ID = "abcd1234" # [Optional] Replace with your deployment ID
6API_KEY = os.environ["BASETEN_API_KEY"]
7
8resp = httpx.post(
9 f"https://model-{MODEL_ID}.api.baseten.co/environments/production/predict",
10 headers={"Authorization": f"Api-Key {API_KEY}"},
11 json={
12 "model": "deepseek_v3",
13 "messages": [
14 {"role": "system", "content": "You are a helpful AI assistant"},
15 {"role": "user", "content": "Write FizzBuzz in Python"},
16 ],
17 "max_tokens": 1024,
18 },
19 timeout=None
20)
21
22print(resp.json())
JSON output
1{
2 "id": "8456fe51db3548789f199cfb8c8efd35",
3 "object": "text_completion",
4 "created": 1735236968,
5 "model": "/models/deepseek_v3",
6 "choices": [
7 {
8 "index": 0,
9 "text": "FizzBuzz is a classic programming problem where you print numbers from 1 to 100...",
10 "logprobs": null,
11 "finish_reason": "stop",
12 "matched_stop": 1
13 }
14 ],
15 "usage": {
16 "prompt_tokens": 14,
17 "total_tokens": 240,
18 "completion_tokens": 226,
19 "prompt_tokens_details": null
20 }
21}