AZMX AI

Guide · 2026-05-25 · 8 min read

DeepSeek V4 with Approval Gate

Run the latest DeepSeek model in a native desktop app that asks permission before touching your codebase.

DeepSeek V4 is here — and it's fast, capable, and open. But sending AI-generated diffs straight into your editor is a recipe for regret. AZMX AI wraps DeepSeek V4 with an approval gate: every change is a diff you review, approve, or reject. No file is modified without your explicit consent. This is how you stay productive without losing control.

Why DeepSeek V4 needs an approval gate

DeepSeek V4 is the latest open-weight model from DeepSeek. It competes with GPT-4o and Claude 3.5 Sonnet on coding benchmarks, runs locally via Ollama or LM Studio, and costs next to nothing through the DeepSeek API if you need cloud speed. But an AI model — any model — is a probabilistic text generator. It can introduce bugs, delete logic, expose secrets, or refactor something you didn't ask for.

Most AI coding tools apply diffs automatically. Cursor's agent mode, Claude Code's streaming edits, even Aider's autocomplete will write to your files without asking. That saves keystrokes but costs trust. When the AI is wrong — and it will be wrong — you've already saved a broken file to disk.

An approval gate solves this. The AI writes its proposed change to a diff panel. You see exactly what lines are added, removed, or changed. Then you click "Approve" or "Reject". No file is touched until you say yes.

How AZMX AI implements the DeepSeek V4 approval gate

AZMX AI is a ~7 MB native desktop app for macOS, Windows, and Linux. It combines a real PTY terminal (xterm.js + portable-pty), a CodeMirror 6 editor with per-hunk AI diffs, and an approval-gated AI agent. Here's how DeepSeek V4 fits in:

1. BYOK — bring your own key for DeepSeek

You can use DeepSeek V4 through the DeepSeek API or through Ollama / LM Studio for offline execution. AZMX AI supports BYOK (bring your own key) across all providers. No account, no telemetry. The only outbound network call the app makes on its own is the signed updater check.

To add DeepSeek V4, open Settings, click Providers, and enter your DeepSeek API key or configure Ollama with the deepseek-v4 model. The connection is direct — your code never passes through a third-party proxy.

2. The approval gate in action

When you prompt the agent (e.g., "add input validation to the login route"), DeepSeek V4 generates a response. AZMX AI parses that response into hunks — discrete, contextual diffs. Each hunk appears in the diff panel alongside your current editor state. You can:

  • Approve the hunk, which applies it inline to the CodeMirror editor.
  • Reject the hunk, which discards it.
  • Edit the hunk manually before accepting it.
  • Skip to the next hunk.

No changes are written to disk until you explicitly save the editor buffer. The terminal and the editor are separate surfaces: the AI can read terminal output (to debug), but can't write to it. That separation is deliberate — it prevents the AI from silently executing dangerous commands.

3. Deny-list for sensitive files

DeepSeek V4 is powerful. It might try to read or write .env, .ssh/, credentials.json, or other sensitive files. AZMX AI ships with a built-in deny-list that refuses any AI action on those paths. You can extend the deny-list in ~/.azmx/deny.yaml. If the AI tries to touch a denied file, the agent stops execution (unless you confirm the action manually in the terminal). This is your safety net.

DeepSeek V4 compared to other models in AZMX AI

AZMX AI supports multiple providers: OpenAI, Anthropic, Google, Groq, xAI, Cerebras, DeepSeek, NVIDIA NIM, Azure OpenAI, Sarvam, plus fully offline via LM Studio and Ollama. Here's where DeepSeek V4 sits:

ModelStrengthsWeaknesses
DeepSeek V4Fast, open-weight, cheap via API, good at reasoningSlightly less creative than Claude on large refactors
Claude 3.5 SonnetBest at complex multi-file changesClosed, rate-limited, expensive
GPT-4oBroad general knowledge, fastMore verbose, less precise for code
Ollama (local)Fully offline, no data leakSlower, requires capable hardware

DeepSeek V4 is a strong everyday model. It's great for one-shot tasks, refactoring, and quick scaffolding. For intensive architectural decisions, you might want Claude. But for daily agentic work — especially when you pair it with an approval gate — DeepSeek V4 is hard to beat on cost and speed.

MCP, sub-agents, and project memory

Beyond the approval gate, AZMX AI gives DeepSeek V4 access to:

  • MCP (Model Context Protocol) over stdio and HTTP — lets your agent call external tools, databases, and APIs.
  • Sub-agents — you can spawn child agents that work on subtasks, each with its own model and approval settings.
  • Project memory via AZMX.md — a markdown file at the root of your project that the agent reads and updates as it learns your codebase. You approve or reject those updates too.

All of these are gated by the same approval mechanism. Whether DeepSeek V4 is calling a database via MCP or writing to AZMX.md, you see the diff and choose.

Setting up DeepSeek V4 with LM Studio or Ollama

If you want to run DeepSeek V4 offline:

  1. Install AZMX AI.
  2. Install LM Studio or Ollama on your machine.
  3. Pull the DeepSeek V4 model: ollama pull deepseek-v4 (or use LM Studio's model browser).
  4. In AZMX AI, go to Settings > Providers > Ollama, set the endpoint to http://localhost:11434, and the model to deepseek-v4.
  5. Start a new session. The agent will use the local model exclusively. No network calls, no data leaves your machine.

That's it. Your code, your model, your machine.

Why not just use Cursor or Claude Code?

Cursor and Claude Code are good products. They're fast, polished, and popular. But they don't give you the same level of control:

  • Cursor's agent mode applies diffs automatically by default. You can review them, but the flow is designed for speed over safety.
  • Claude Code streams edits directly into your terminal. It can execute commands without approval. There's no built-in deny-list for secrets.
  • Aider works in your terminal and can map files, but its safety model is opt-in — you have to explicitly turn on review mode.
  • Cline and Continue offer approval gates, but they're VSCode extensions — tied to Microsoft's telemetry and plugin ecosystem.

AZMX AI is a standalone desktop app. No account, no telemetry, no VSCode. It speaks MCP natively, supports local models, and ships with a deny-list and approval gate turned on by default. You can trust it with your production code because you see every change before it lands.

Use cases for DeepSeek V4 with an approval gate

The approval gate isn't just a safety feature — it's a teaching tool. Here's what it enables:

  • Learning by reviewing: Junior devs can ask an AI agent for a refactor, then study each diff before approving it. Over time, they internalize good patterns.
  • Audit trails: Every approved or rejected hunk is logged. You can replay the session later to understand why a change was made.
  • Confidence in automation: Senior engineers can approve bulk changes (e.g., renaming a module across 20 files) without fear, because each hunk is reviewed.
  • Secure environments: If you work with private keys, API tokens, or proprietary code, the deny-list + local model combo means zero data exposure.

Technical architecture: how approval gates work under the hood

When DeepSeek V4 returns a response, AZMX AI parses it into a structured change set. Each change is a structured diff (unified format). The app maps each hunk to the correct file path and line range. The hunk is displayed in a side-by-side view: original on the left, edited on the right.

The editor is CodeMirror 6, which supports custom extensions. Each hunk is rendered as a decorated gutter marker. Clicking a marker selects that hunk. Approving it applies the edit to the document buffer — but not to disk. You still need to save the file (Ctrl+S or Cmd+S). This gives you a second safety layer.

The terminal is powered by xterm.js and portable-pty. The AI can read terminal output (stdout, stderr) but cannot write to the terminal. Commands must be typed or pasted manually. If you want the AI to run a command, you copy/paste it yourself. This prevents a rogue agent from rm -rf / or pushing to prod.

The deny-list is resolved against absolute file paths. By default, it blocks ~/.ssh/, .env, .env.local, .env.*, credentials.json, *.pem, and *.key. You can extend it by adding patterns to ~/.azmx/deny.yaml. The list is checked before any file read or write attempt by the agent.

Performance and cost

DeepSeek V4 via cloud API costs roughly $0.50 per million input tokens and $1.50 per million output tokens (as of May 2026). That's a fraction of GPT-4o ($10/$30) and Claude 3.5 Sonnet ($3/$15). Using it locally in Ollama costs only electricity and compute time. On an M4 Max MacBook Pro, DeepSeek V4 generates code at about 20 tokens per second with quantization. On a desktop RTX 4090, you can get 40–50 tokens per second at Q4_K_M.

The approval gate adds negligible overhead. Diff parsing takes under 10ms for most hunks. The review time is up to you.

Getting started

Download AZMX AI from azmx.ai/download. Add your DeepSeek V4 API key or connect to a local Ollama instance. Start a new session. Ask the agent to make a change. Review the diffs. Approve or reject. That's the workflow.

For more on security, see the security docs. For MCP configuration, see the docs.

Final thoughts

DeepSeek V4 is a great model. But even the best model shouldn't have unsupervised access to your codebase. An approval gate gives you control without killing productivity. You see every change. You approve or reject each hunk. You save to disk manually. It's simple, it's safe, and it works.

Run DeepSeek V4 with an approval gate in AZMX AI. Your code will thank you.

One window. The whole loop.

Native. ~7 MB. BYOK or fully offline. No account. No telemetry.