DeepSeek API Major Upgrade
Key point
DeepSeek API has added JSON Output, Function Calling, Chat Prefix Completion, and FIM.
Details
DeepSeek API has significantly expanded its features around /chat/completions and the new /completions. This update is open to both deepseek-chat and deepseek-coder models, and emphasizes compatibility with the OpenAI API.
The key changes are as follows.
- JSON Output: You can set
response_formatto{'type': 'json_object'}to force valid JSON-format output. - Function Calling: You can connect to external tools to perform actual tasks, supporting up to 128 functions in a single call, with parallel function calls also possible.
- Chat Prefix Completion: You can specify the beginning of the last
assistantmessage so the model completes what follows. Thebase_urlshould usehttps://api.deepseek.com/beta, and theprefixof the last message must be set toTrue. - 8K max_tokens(Beta): The Beta API raises the
max_tokenslimit up to 8192, supporting longer output scenarios.
Also, the new /completions API offers FIM (Fill-In-the-Middle) Completion. This method fills in the middle given a prefix and suffix, making it suitable for uses like story completion or code completion, and follows the same pricing structure as Chat Completion.
To use the Beta features, you must set base_url to https://api.deepseek.com/beta in all cases. DeepSeek stated that the Beta API is still defined as an unstable feature, and that subsequent testing and release plans may change flexibly.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.