just-deepseek
Wire-level types, a thin async client, and HTTP transport helpers for the DeepSeek API.
Overview
This crate provides serde-serializable request and response types that closely mirror the DeepSeek HTTP API shape, a thin async client (DeepSeekClient), and re-exported HTTP transport helpers for making requests with a raw reqwest::Client.
types— Wire-level DTOs (request/response types with serde derives).transport— Re-exported HTTP helpers fromjust-common(build_client,endpoint_url,ensure_success,parse_json,JsonEventStream).
For a provider-neutral abstraction with capability traits and runtime provider selection, use just-llm-client with the deepseek feature.
Quick start
Type serialization
use ;
let request = new;
let json = to_string?;
HTTP request with transport helpers
use ;
use ;
let http = build_client?;
let request = new;
let url = endpoint_url?;
let response = http
.post
.header
.body
.send
.await?;
let response = ensure_success.await?;
let completion: ChatCompletion = response.json.await?;
Highlights
- Wire-level DTOs — Request/response types mirror the upstream DeepSeek API shape with serde derives.
- Thinking mode —
ThinkingConfigandReasoningEffortfields for extended reasoning. - Tool calling —
ToolDefinition,ToolCallsMessage, and related types for tool-calling workflows. - Transport helpers — Re-exported HTTP utilities from
just-commonfor convenience. Usejust-llm-clientfor a full client abstraction.
Looking for a provider-neutral interface with capability traits, runtime provider selection, and tool dispatch? Check out just-llm-client.
Examples
# Non-streaming chat completion
JUST_LLM_DEEPSEEK_API_KEY=your-key JUST_LLM_DEEPSEEK_MODEL=deepseek-chat \
# Streaming
JUST_LLM_DEEPSEEK_API_KEY=your-key JUST_LLM_DEEPSEEK_MODEL=deepseek-chat \
# Thinking mode (DeepSeek-specific)
JUST_LLM_DEEPSEEK_API_KEY=your-key JUST_LLM_DEEPSEEK_MODEL=deepseek-chat \
# Tool calling loop
Ecosystem
| Crate | Description |
|---|---|
| just-llm-client | Provider-neutral LLM client — recommended entry point |
| just-openai-compat | Wire-level DTOs and transport helpers for OpenAI-compatible APIs |
| just-common | Shared HTTP transport, SSE parsing, and error types |