Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.siliconflow.com/llms.txt

Use this file to discover all available pages before exploring further.

CodeWhale (formerly DeepSeek TUI) is a terminal coding agent built for DeepSeek V4. It runs from the codewhale command, streams reasoning blocks, edits local workspaces with approval gates, and includes an auto mode that chooses both model and thinking level per turn. What sets CodeWhale apart is its harness — a system of rules, evidence, and feedback that keeps the model oriented instead of drifting. At its core is a written Constitution with nine tiers of authority: user intent outranks stale instructions, verification outranks confidence, etc. The system also benefits from recursive improvement — V4 helped write the harness, and as the harness improves, V4 becomes more effective. Each turn starts stronger. Now, SiliconFlow is a built-in provider in CodeWhale. With a single command, you can connect to SiliconFlow’s API and run DeepSeek-V4-Pro and DeepSeek-V4-Flash — no custom base URLs or manual config required. This guide walks you through installing CodeWhale and using SiliconFlow APIs in it.

Step 1: Prerequisites

Get Your SiliconFlow API Key

Before you begin, ensure you have a valid SiliconFlow account:
  • Register a SiliconFlow account at https://cloud.siliconflow.com/. You can sign up with Google or GitHub.
  • Log in and navigate to API Keys in the dashboard.
  • Click 🔑Create API Key and add a name to your key to help you identify it later, then confirm to create it.
  • Click the API key to copy it automatically.
⚠️ Note: Keep your API key secure; you will need it in the later configuration.
Codewhale1

Step 2: Install & Configure

  1. Install
Running the following CLI to download the prebuilt binaries for your platform from GitHub Releases and install both codewhale and codewhale-tui. This method requires Node 18+.
npm install -g codewhale
If you don’t have Node installed, see Other ways to install for Cargo, Homebrew, prebuilt binaries, or mainland-China mirrors.
  1. Verify
codewhale --version
codewhale doctor
codewhale doctor checks your API key, network, sandbox availability, and MCP servers. Full report is written to ~/.codewhale/doctor.log.
  1. Update
codewhale update
Checks GitHub Releases for a newer version and replaces the binary in place. If you installed via Homebrew or npm, prefer the package manager instead: brew upgrade deepseek-tui or npm update -g codewhale. Cargo users can re-run cargo install codewhale-cli --locked --force.
  1. Configure siliconflow
# SiliconFlow
codewhale auth set --provider siliconflow --api-key "YOUR_SILICONFLOW_API_KEY"
codewhale --provider siliconflow --model deepseek-ai/DeepSeek-V4-Pro

Step 3: Run CodeWhale

Run CodeWhale in your terminal
#Launch CodeWhale from any directory:
codewhale

#Or run it inside a specific project:
cd path/to/project
codewhale
On first launch, CodeWhale walks you through a few setup steps:
  • Press Enter to continue past the welcome screen
  • Choose your preferred language
  • Press 1 to trust and continue
  • Press Enter to open the workspace
Codewhale2

Mode

You’re now in CodeWhale — the active mode (Agent), current model (deepseek-ai/DeepSeek-V4-Pro), and provider (SiliconFlow) are shown in the top bar. Plan mode (read-only) is the default. Press Tab to switch to Agent mode, or press again for YOLO.
ModeDescription
PlanRead-only investigation. The agent can grep, read files, list dirs, fetch URLs — never write or shell out.
AgentDefault. Multi-step tool use. Shell and side-effectful tools require approval per approval_mode.
YOLOAuto-approve everything + enable trust mode. Workspace boundary lifts. Use carefully.

Quick Reference

Also, there’s a shortcut table for users to have a quick reference
ShortcutAction
TabCycle mode (Plan / Agent / YOLO)
Shift+TabCycle reasoning effort
Ctrl+LClear screen, keep session
Ctrl+CCancel current turn
Ctrl+DExit
/helpSlash command palette
/configEdit config interactively
/trustLift workspace boundary for session
For more detailed information on modes, tools, approval & sandbox, MCP integration, and skills, visit the CodeWhale official documentation.

DeepSeek V4 on SiliconFlow

CodeWhale is built for DeepSeek V4 series. SiliconFlow offers two variants — pick the one that fits your task, or let Auto Mode decide for you.
DeepSeek-V4-ProDeepSeek-V4-Flash
Best forComplex reasoning, architecture, security reviewFast tasks, code completion, daily workflows
Context1M tokens1M tokens
Cached Input$0.145 / 1M$0.028 / 1M
Input$1.60 / 1M$0.13 / 1M
Output$3.48 / 1M$0.28 / 1M
Prices shown are for reference only. For real-time pricing, check the SiliconFlow Models page.

Launch with a specific model

# Pro — complex reasoning
codewhale --provider siliconflow --model deepseek-ai/DeepSeek-V4-Pro

# Flash — fast and cost-efficient
codewhale --provider siliconflow --model deepseek-ai/DeepSeek-V4-Flash

Auto Mode

Auto Mode runs a small Flash routing call before each turn to assess task complexity, then picks the right model and thinking level automatically, so you don’t have to choose between speed, cost, and quality each time you use codewhale.

How to enable

  • CLI: codewhale --model auto
  • In-session: /model auto

How model routing works

Before your request is sent, codewhale runs a small routing call to assess task complexity, then selects:
  • Model: deepseek-v4-flash (fast, cheap) or deepseek-v4-pro (powerful, slower)
  • Thinking level: off / high / max
Task typeModelThinking
Simple Q&A, short repliesV4 Flashoff
Coding, debugging, release workV4 Prohigh or max
Architecture, security reviewV4 Promax

Already Using OpenRouter?

Bring Your Own Key

If you already have an OpenRouter account, you can connect your SiliconFlow API key via BYOK. Once connected:
  • Requests draw from your SiliconFlow balance first
  • Billing and rate limits stay in your SiliconFlow account
  • OpenRouter’s fallback routing still works to improve reliability
Bonus: OpenRouter waives platform fees on your first 1M BYOK requests per month.
Codewhale3

Resources

CodeWhale (DeepSeek-TUI)

OpenRouter

SiliconFlow