Class DeepSeekClient

All Implemented Interfaces:
com.tnsai.llm.LLMClient

public class DeepSeekClient extends AbstractOpenAICompatibleClient
DeepSeek LLM client.

DeepSeek is a Chinese frontier-model lab. The API is OpenAI-compatible at https://api.deepseek.com/v1 — same chat-completions wire format as GroqClient / XAIGrokClient / YiClient, so this client is a thin subclass of AbstractOpenAICompatibleClient.

Supported models (at time of writing):

  • deepseek-chat — V3 general chat (very cost-efficient: ~$0.14/M input, $0.28/M output)
  • deepseek-reasoner — R1 reasoning model with visible chain-of-thought

The catalog evolves; check the live list at api-docs.deepseek.com.

About reasoning_content (R1). When the model is deepseek-reasoner, responses include a reasoning_content field on each message/delta carrying the model's visible chain-of-thought trace, alongside the standard OpenAI content field with the final answer. The shared ChatResponse SPI doesn't carry a thinking/reasoning channel, so the base client surfaces only the final content and drops the reasoning trace on the floor. R1 still answers correctly — callers just don't see the trace. Plumbing the reasoning content through is a separate ChatResponse/ChatChunk extension and a follow-up issue.

Configuration via environment variable:

  • DEEPSEEK_API_KEY — Required.
See Also:
  • Constructor Details

    • DeepSeekClient

      public DeepSeekClient(String model)
    • DeepSeekClient

      public DeepSeekClient(String model, float temperature)
    • DeepSeekClient

      public DeepSeekClient(String model, float temperature, Integer maxTokens)
    • DeepSeekClient

      public DeepSeekClient(String model, float temperature, Float topP, Integer maxTokens)
    • DeepSeekClient

      public DeepSeekClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey)
    • DeepSeekClient

      public DeepSeekClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey)