This sample demonstrates integration with DeepSeek models using Genkit Java.
- DeepSeek Plugin Setup - Configure Genkit with DeepSeek models
- DeepSeek-Chat - Fast, efficient chat model for general tasks
- DeepSeek-Reasoner - Advanced reasoning model for complex problems
- Tool Usage - Mathematical calculator tool with automatic execution
- Text Generation - Generate responses with streaming support
- Code Generation - Generate and review code
- Problem Solving - Step-by-step reasoning with explanations
deepseek-chat- Efficient chat model for general tasksdeepseek-reasoner- Advanced model with enhanced reasoning capabilities
- Java 21+
- Maven 3.6+
- DeepSeek API key (get one at https://platform.deepseek.com/)
# Set your DeepSeek API key
export DEEPSEEK_API_KEY=your-api-key-here
# Navigate to the sample directory
cd samples/deepseek
# Run the sample
./run.sh
# Or: mvn compile exec:java# Set your DeepSeek API key
export DEEPSEEK_API_KEY=your-api-key-here
# Navigate to the sample directory
cd samples/deepseek
# Run with Genkit CLI
genkit start -- ./run.shThe Dev UI will be available at http://localhost:4000
| Flow | Model | Description |
|---|---|---|
greeting |
- | Simple greeting flow |
chat |
deepseek-chat | General chat |
mathAssistant |
deepseek-chat | Math assistant with calculator tool |
reasoning |
deepseek-reasoner | Complex reasoning and problem analysis |
streamingChat |
deepseek-chat | Streaming chat responses |
generateCode |
deepseek-chat | Code generation |
codeReview |
deepseek-chat | Code review and feedback |
problemSolving |
deepseek-reasoner | Step-by-step problem solving with streaming |
Once the server is running on port 8080:
curl -X POST http://localhost:8080/api/flows/greeting \
-H 'Content-Type: application/json' \
-d '"World"'curl -X POST http://localhost:8080/api/flows/chat \
-H 'Content-Type: application/json' \
-d '"Explain quantum entanglement in simple terms"'curl -X POST http://localhost:8080/api/flows/mathAssistant \
-H 'Content-Type: application/json' \
-d '"What is 25 times 47?"'curl -X POST http://localhost:8080/api/flows/reasoning \
-H 'Content-Type: application/json' \
-d '"How can we address climate change effectively?"'curl -X POST http://localhost:8080/api/flows/generateCode \
-H 'Content-Type: application/json' \
-d '"Write a Python function to calculate Fibonacci numbers"'