pi-deepseek-provider
v3.0.3
Published
DeepSeek provider extension for pi - V4 Pro, V4 Flash & Reasoner with 1M context and thinking mode
Maintainers
Readme
🐋 pi-deepseek-provider
DeepSeek V4 Pro, V4 Flash & Reasoner for pi
Native DeepSeek API with 1M context, thinking mode, and live model sync.
Features
- DeepSeek V4 Pro — Flagship model with thinking mode, 1M context, and 384K max output
- DeepSeek V4 Flash — Fast and affordable model with thinking mode, 1M context, and 384K max output
- DeepSeek Reasoner (deprecated) — Legacy reasoning model (maps to V4 Flash thinking mode)
- DeepSeek Chat (deprecated) — Legacy non-reasoning model (maps to V4 Flash non-thinking mode)
- Reasoning Effort Control —
high/maxeffort levels for thinking mode - Anthropic API Compatible — Also available at
https://api.deepseek.com/anthropic
Installation
Option 1: Using pi install (Recommended)
Install directly from GitHub:
pi install https://github.com/monotykamary/pi-deepseek-providerThen set your API key and run pi:
# Recommended: add to auth.json
# See Authentication section below
# Or set as environment variable
export DEEPSEEK_API_KEY=your-api-key-here
piGet your API key at platform.deepseek.com/api_keys.
Option 2: Manual Clone
Clone this repository:
git clone https://github.com/monotykamary/pi-deepseek-provider.git cd pi-deepseek-providerSet your DeepSeek API key:
# Recommended: add to auth.json # See Authentication section below # Or set as environment variable export DEEPSEEK_API_KEY=your-api-key-hereRun pi with the extension:
pi -e /path/to/pi-deepseek-provider
Available Models
| Model | Context | Reasoning | Reasoning Effort | Input $/M | Output $/M | Cache Hit $/M | |-------|---------|-----------|------------------|-----------|------------|---------------| | Deepseek Flash | 131K | ❌ | ❌ | — | — | — | | DeepSeek V4 Pro | 1M | ✅ | ✅ | $0.43 | $0.87 | $0.00 |
Costs are per million tokens. Prices subject to change — check api-docs.deepseek.com for current pricing.
Note: The model names deepseek-chat and deepseek-reasoner will be deprecated on 2026/07/24. They correspond to the non-thinking mode and thinking mode of deepseek-v4-flash, respectively. Use deepseek-v4-flash and deepseek-v4-pro for new projects.
Usage
After loading the extension, use the /model command in pi to select your preferred model:
/model deepseek deepseek-v4-proOr start pi directly with a DeepSeek model:
pi --provider deepseek --model deepseek-v4-proThinking Mode
DeepSeek V4 models support both thinking and non-thinking modes. Thinking mode is enabled by default. In pi, reasoning models use the deepseek thinking format which sends thinking: {type: "enabled/disabled"} plus reasoning_effort mapped from pi's thinking levels.
To control reasoning effort, use the --reasoning-effort flag:
pi --provider deepseek --model deepseek-v4-pro --reasoning-effort maxEffort levels: high (default for regular requests), max (default for agent/coding requests).
Authentication
The DeepSeek API key can be configured in multiple ways (resolved in this order):
auth.json(recommended) — Add to~/.pi/agent/auth.json:
The{ "deepseek": { "type": "api_key", "key": "your-api-key" } }keyfield supports literal values, env var names, and shell commands (prefix with!). See pi's auth file docs for details.- Runtime override — Use the
--api-keyCLI flag - Environment variable — Set
DEEPSEEK_API_KEY
Get your API key at platform.deepseek.com/api_keys.
Configuration
Add to your pi configuration for automatic loading:
{
"extensions": [
"/path/to/pi-deepseek-provider"
]
}Compat Settings
DeepSeek's API uses these provider-specific compatibility settings:
thinkingFormat: "deepseek"— Reasoning models (V4 Pro, V4 Flash). Sendsthinking: {type: "enabled"/"disabled"}to toggle thinking mode. When enabled,reasoning_effortis mapped viathinkingLevelMap(high→"high",max→"max"). Minimal/low/medium are unsupported (null).supportsReasoningEffort: true— V4 models. Supportsreasoning_effort: "high" | "max".requiresReasoningContentOnAssistantMessages: true— V4 models. Replayed assistant messages include emptyreasoning_contentwhen reasoning is enabled, required by DeepSeek's API.supportsDeveloperRole,supportsStore,maxTokensField— Auto-detected frombaseUrl(deepseek.com). Not explicitly set.
Patch Overrides
The patch.json file contains overrides that are applied on top of models.json data. This is useful for:
- Correcting API-derived values (e.g., marking a model as reasoning-capable)
- Adding compat settings that the API doesn't provide
- Overriding pricing when official rates change
Updating Models
Run the update script to fetch the latest models from DeepSeek's API:
export DEEPSEEK_API_KEY=your-api-key
node scripts/update-models.jsThis will:
- Fetch models from
https://api.deepseek.com/models - Preserve pricing and compat from existing
models.json - Apply overrides from
patch.json - Update
models.jsonand the README model table
A GitHub Actions workflow runs this daily and creates a PR if models have changed.
License
MIT
