Installation
Setup
Set your DeepSeek API key as an environment variable:Usage
Streaming
API Reference
ChatDeepSeek
ChatDeepSeek extends ChatOpenAI and inherits all of its parameters. It’s preconfigured to use DeepSeek’s API endpoint.
Name of DeepSeek model to use (e.g.,
deepseek-chat, deepseek-reasoner).Sampling temperature. Controls randomness in generation.
Maximum number of tokens to generate.
Timeout for requests in seconds.
Maximum number of retries for failed requests.
DeepSeek API key. If not provided, reads from
DEEPSEEK_API_KEY environment variable.Supported Models
- DeepSeek-V3: Latest flagship model with excellent performance
- DeepSeek-Chat: General-purpose chat model
- DeepSeek-Reasoner: Specialized for complex reasoning tasks
Features
- Text generation
- Function/tool calling
- Reasoning mode (DeepSeek-Reasoner)
- Streaming
- Async support
- Competitive pricing
- Support for long context windows
DeepSeek models are known for their strong reasoning capabilities and cost-effectiveness. The DeepSeek-Reasoner model includes a thinking process similar to OpenAI’s o1 series.