Skip to content

models: Add support for DeepSeek models #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

veeragoni
Copy link

@veeragoni veeragoni commented Jul 12, 2025

Features

  • New DeepSeek Model Provider: Full implementation with streaming and tool use support
  • OpenAI-compatible API: Uses OpenAI client for seamless integration with DeepSeek endpoints
  • Tool Use Support: Proper tool calling with calculator, file operations, and shell commands
  • Reasoning Model Support: Handles DeepSeek-specific features like reasoning content
  • Beta Features: Support for beta endpoint and advanced DeepSeek capabilities

Changes

  • src/strands/models/deepseek.py: New DeepSeek model provider implementation with proper tool use streaming
  • src/strands/models/__init__.py: Export DeepSeekModel class
  • tests_integ/models/test_model_deepseek.py: Comprehensive integration tests (8 test cases)
  • tests_integ/models/ds_test.py: Demonstration script showing tool use capabilities
  • README.md: Update documentation with DeepSeek examples and provider list

Usage

from strands.models.deepseek import DeepSeekModel
from strands_tools import calculator

model = DeepSeekModel(api_key="your-key", model_id="deepseek-chat")
agent = Agent(model=model, tools=[calculator])
result = agent("What is 42 ^ 9")  # Uses calculator tool correctly

Testing

✅ All 8 integration tests passing
✅ Basic conversation, structured output, streaming, tool usage
✅ Multi-tool workflows (calculator, file_read, shell)
✅ Configuration updates and async operations
✅ Tool use streaming matches OpenAI/Ollama implementations
✅ All mypy type checks passing

Documentation PR

strands-agents/docs#135

Type of Change

New feature

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

I ran hatch run prepare

Checklist

[x] I have read the CONTRIBUTING document
[x] I have added any necessary tests that prove my fix is effective or my feature works
[x] I have updated the documentation accordingly
[x] I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
[x] My changes generate no new warnings
[x] Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Suresh Veeragoni added 2 commits July 11, 2025 18:18
## Features
- **New DeepSeek Model Provider**: Full implementation with streaming and structured output support
- **OpenAI-compatible API**: Uses OpenAI client for seamless integration with DeepSeek endpoints
- **Reasoning Model Support**: Handles DeepSeek-specific features like reasoning content
- **Beta Features**: Support for beta endpoint and advanced DeepSeek capabilities

## Changes
- `src/strands/models/deepseek.py`: New DeepSeek model provider implementation
- `src/strands/models/__init__.py`: Export DeepSeekModel class
- `tests_integ/models/test_model_deepseek.py`: Comprehensive integration tests (7 test cases)
- `tests_integ/models/providers.py`: Add DeepSeek to provider configuration
- `README.md`: Update documentation with DeepSeek examples and provider list

## Usage
```python
from strands.models.deepseek import DeepSeekModel
model = DeepSeekModel(api_key="your-key", model_id="deepseek-chat")

Testing
✅ All 7 integration tests passing

✅ Basic conversation, structured output, streaming, tool usage

✅ Configuration updates and async operations
@veeragoni veeragoni changed the title # Add support for DeepSeek models models: Add support for DeepSeek models Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant