Updated 2026-06-18
DeepSeek Pi setup: use the official `models.json` provider schema instead of inventing your own compatibility layer
DeepSeek's official Pi integration page is more useful than a generic install note because it publishes a full provider schema rather than stopping at 'paste your key here.' The page shows where Pi stores `models.json`, how to point Pi at `https://api.deepseek.com`, how to register DeepSeek V4 Pro and Flash with 1M context metadata, and how to map Pi's reasoning levels to DeepSeek's current behavior. That makes this a strong long-tail page for developers searching how to wire Pi to DeepSeek without trial-and-error provider tweaks.
1. What DeepSeek officially supports in Pi
DeepSeek describes Pi as a minimal, aggressively extensible terminal coding harness with built-in provider switching. The important DeepSeek-first point is that the official docs now include Pi in the current agent-integrations surface rather than leaving it as a community-only compatibility guess.
That matters because Pi needs more than a bare endpoint URL. The current DeepSeek page publishes model metadata, cost fields, and reasoning compatibility hints that ordinary OpenAI-compatible snippets usually omit.
Sources checked
- DeepSeek official Pi integration guide - Primary source for Pi install, provider schema, and model metadata.
- DeepSeek API docs homepage - Confirms Pi is part of the current official agent-integrations surface.
2. Install Pi first, then verify the binary
DeepSeek's page starts with a straightforward baseline: install Node.js, run `npm install -g @mariozechner/pi-coding-agent`, and confirm the CLI with `pi --version`.
Linux and macOS users can also use Pi's shell installer, but the more important rule is to verify the binary before you start debugging provider config.
npm install -g @mariozechner/pi-coding-agent
pi --version
# Linux / macOS alternative from the official DeepSeek docs
curl -fsSL https://pi.dev/install.sh | sh3. Add DeepSeek as an OpenAI-compatible provider in `models.json`
This is the core value of the official page: DeepSeek gives a full `models.json` provider shape with `baseUrl`, `api`, `apiKey`, model IDs, context windows, max-token metadata, and cost fields.
On Linux and macOS the file path is `~/.pi/agent/models.json`. On Windows it lives under `%USERPROFILE%\.pi\agent\models.json`. Keep the base URL on `https://api.deepseek.com`, then define both DeepSeek V4 Pro and DeepSeek V4 Flash so Pi can switch between them cleanly.
{
"providers": {
"deepseek": {
"baseUrl": "https://api.deepseek.com",
"api": "openai-completions",
"apiKey": "$DEEPSEEK_API_KEY",
"models": [
{
"id": "deepseek-v4-pro",
"name": "DeepSeek V4 Pro",
"contextWindow": 1000000,
"maxTokens": 384000,
"reasoning": true
},
{
"id": "deepseek-v4-flash",
"name": "DeepSeek V4 Flash",
"contextWindow": 1000000,
"maxTokens": 384000,
"reasoning": true
}
]
}
}
}Sources checked
- DeepSeek official Pi integration guide - Provides the official provider block, context metadata, and model IDs.
4. Keep the reasoning compatibility block intact
DeepSeek's Pi example is not generic boilerplate. The compat section sets `thinkingFormat` to `deepseek`, requires reasoning content on assistant messages, and maps Pi's `minimal`, `low`, `medium`, `high`, and `xhigh` selector levels to the DeepSeek levels Pi should actually send.
That matters because reasoning-mode integration bugs are often caused by the wrong compatibility layer rather than the wrong prompt. If you simplify the config too aggressively, you are no longer testing the documented DeepSeek path.
| Field | Official DeepSeek value | Why it matters |
|---|---|---|
| thinkingFormat | `deepseek` | Keeps Pi aligned with DeepSeek's reasoning-state format instead of assuming generic OpenAI behavior |
| requiresReasoningContentOnAssistantMessages | `true` | Preserves reasoning state across assistant messages |
| reasoningEffortMap | `xhigh -> max`, lower levels -> `high` | Prevents Pi from sending unsupported effort labels to DeepSeek |
5. Export `DEEPSEEK_API_KEY`, then switch models inside Pi
The official page keeps the API key in the environment, not as a literal secret pasted into versioned config. That is the right default because it separates provider metadata from credential storage.
After the provider block is in place, launch Pi, open `/model`, choose the `deepseek` provider, and then select either DeepSeek V4 Pro or DeepSeek V4 Flash depending on the task.
If you need the operational difference between those two routes, continue with `/guides/deepseek-v4-pro-vs-flash`.
export DEEPSEEK_API_KEY="<your DeepSeek API Key>"
cd /path/to/project
pi
# then choose /model -> deepseek -> DeepSeek V4 Pro or DeepSeek V4 Flash6. Where this guide fits on a DeepSeek-first site
This page is support content, not a new pricing card. It does not imply that Pi itself is sold here, and it does not change the inventory gate on `/pricing`.
The right user path is simple: learn the official Pi provider schema here, then use `/pricing` only if you need an in-stock DeepSeek API key route. For adjacent terminal workflows, compare `/guides/deepseek-opencode-setup`, `/guides/deepseek-crush-agent-setup`, and `/guides/reasonix-deepseek-coding-agent`.
FAQ
How do I connect Pi to DeepSeek?
DeepSeek's official guide says to add a `deepseek` provider to `~/.pi/agent/models.json`, point it at `https://api.deepseek.com`, export `DEEPSEEK_API_KEY`, and then choose the DeepSeek models inside Pi's `/model` selector.
Which file does Pi use for the DeepSeek provider config?
On Linux and macOS, DeepSeek's official page uses `~/.pi/agent/models.json`. On Windows it uses `%USERPROFILE%\.pi\agent\models.json`.
Which base URL should Pi use for DeepSeek?
Use `https://api.deepseek.com`, which is the base URL shown in DeepSeek's official Pi provider example.
Why does the Pi config need a reasoning compatibility block?
Because DeepSeek's official example maps Pi's reasoning levels to supported DeepSeek behavior and preserves reasoning-content expectations across assistant messages.
Does this page mean Pi is a purchasable plan on this site?
No. This is a guide page for DeepSeek integration. Purchasable products still appear only when real stock exists on `/pricing`.
The practical DeepSeek Pi rule is simple: do not reduce the integration to a bare URL swap. Start from the official `models.json` provider schema, keep the DeepSeek-specific reasoning mapping intact, and treat Pro versus Flash as a routing decision after the baseline config already works.
Related model comparisons
Continue from this guide into structured DeepSeek-first comparison pages with model tables, routing advice, and pricing context.