惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
Malwarebytes
Malwarebytes
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
F
Future of Privacy Forum
C
Cisco Blogs
T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
S
Securelist
K
Kaspersky official blog
S
Schneier on Security
T
ThreatConnect
T
Tenable Blog
Spread Privacy
Spread Privacy
T
True Tiger Recordings
AWS News Blog
AWS News Blog
F
Fox-IT International blog
量子位
T
Threatpost
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
GbyAI
GbyAI
宝玉的分享
宝玉的分享
腾讯CDC
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
Cyberwarzone
Cyberwarzone
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
U
Unit 42
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
MyScale Blog
MyScale Blog
小众软件
小众软件
A
About on SuperTechFans
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
美团技术团队
Google Online Security Blog
Google Online Security Blog
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog

DEV Community

Sofi Log #012: Agentic GDP — Solana Pay.sh & x402 Protocol Spec Input Types, Attributes, Self-Closing Tags, Hover Effect Absolute vs Relative Paths File Types (Regular, Directory, Link, Device, Socket, Pipe) From Arduino IDE to AVR GCC | AVR Bare Metal #1 Using Bitcoin as collateral without wrapping it: the design of a BTC collateral vault Unreal Engine 5 Skill System Architecture using GAS and GameplayTags 5 Things I Wish I Knew Before Building with Hermes Agent Thoughts on Codingame 2026 Spring challenge OUT WITH THE OLD IN WITH THE NEW Why are simple 1099 tax calculators online so horribly bloated? So I built my own "Why You're Not Getting Callbacks (It's Not Your Skills)" # How I Built a Retail Demand Forecasting App with Python and Streamlit Why We Deliberately Crush Lithium Batteries (UN38.3 Crush Testing Explained) Command History & Completion The Three-Body Problem: AI Code, Supply Chain Attacks, and the Talent Exodus 로컬 LLM 셋업 가이드 (v27) Building Better .NET Worker Services with Cursor Rules Generate Professional PDF Invoices via REST API — JSON In, PDF Out Redis: Big Keys Destroem o Desempenho Compartilhado Agentic AI for Cybersecurity: Autonomous Threat Detection and Response How to Automate Android Without Appium Cron vs systemd daemon: which one for Node.js? Designing XSLT transforms with parameters and multiple inputs I Downloaded Gemma4:e2b On My Macbook in 2 steps Building an Autonomous SRE Agent: From Raw Telemetry to Safe, AI-Driven Remediation The EU AI Act in 2026: Reading the Law After the Omnibus I had zero coding knowledge. Here is "RetroTube", a 2010 YouTube sandbox prototype I built using AI! How to Validate Environment Variables in TypeScript (and Why You Should) I Built a CLI Tool That Writes Better Git Commits Than I Do Transfer Fees, Metadata, and Soulbound Tokens: My First Real Token Experiments on Solana Stop Using Fetch() in React: A Better Way To Call Your Backend Creando un Tetris con JavaScript VI: Complicando el juego. DeepSeek's API Price Cut Changed My Claude Code and ChatGPT Math [Boost] Perl 🐪 Weekly #774 - Perl is too HOT How to Track AI Usage Without Losing Revenue (Complete Guide) 77 Rules Later: What Graduating Our First Stack Actually Looked Like RAG 시스템 실전 구축 (v26) When Premature Scaling Leads to Operator Burnout Multi-Repo Microservice Changes Are a Coordination Problem. I Solved It With AI Agent Teams. The Next Frontier: How Multi-Agent Systems are Redefining Productivity The Kimwolf Bust Just Outed Android Webcams as Botnet Fodder — Here's the Question Every Repurposed-Phone Camera Setup Has to Answer I'm an autonomous AI agent. I shipped 18 fixes to myself in one session. Building a Secure Future with Zero Trust Security Architecture Asynchronous Functions in Dart How I migrated magic-link login from Resend to AWS SES + Lambda five days before launch Edge Computing He creado una empresa ficticia IT/OT para poder encontrar sus vulnerabilidades y reforzar su seguridad en sus activos críticos Why I Built @editora/react I built a tiny UGC script generator because hooks are the hardest part The Phone Is Becoming the New Terminal Why Most AI Music Tools Feel Wrong to Developers Goroutines vs. Promises: Why Go and JavaScript Look at Concurrency Completely Differently How I Use Antigravity 2.0 to Navigate Open-Source Codebases and Make Better Technical Decisions Understanding Basic HTML & CSS Concepts for Beginners Go Error Handling: Annoying or Awesome? Your To-Do List Doesn't Know You — So I Gave Mine Three Brains Shell Basics (Bash, Zsh, Sh) Free MongoDB GUI Tool for Developers, Students, and Teams Designing High-Performance Blockchain Indexers Choosing Models for an Agentic Chat App on Amazon Bedrock How Smart Growth Teams Automate Their Marketing Stack in 2026 (Without Hiring More People) What I Learned About Memory-Augmented AI Agents Seven Docker Tips Every Engineer Should Know (from Docker Captains) Welcome to the Fast-Food Era of Testing: Over-Weight by Tests How to use Claude in vscode? Prompt Engineering for Automated Evaluation: Making LLMs the Judge in AI Builder Solutions Full Stack Projects Are Not Enough Anymore Virtualization & Cloud Basics Orakle: Turning Raw Blockchain Data into Intelligence with Gemma 4 Building an Autoposting Pipeline with Hermes Agent: Why Waterfall Beats Parallel, and the Edge Cases Nobody Talks About OpenShift Virtualization Migration Advisor — Local-First, Powered by Gemma 4 26B MoE WebMCP is coming — so I’m building webmcp.js I Disappeared for 4 Months After Launch - Here's What Brought Me Back Jira Is Turing-Complete (And You've Been Coding in It) NyayAI: Building an AI Legal Assistant for 1.4 Billion People — A Technical Deep Dive E-commerce Order Automation: Stripe + Invoice + Shipping Workflow How to Evaluate AI Agents: LLM-as-Judge Tutorial The Interview Prep Stack I Used as a Senior Software Engineer Targeting Big Tech Gemma4 Challenge OptiLearn - Powered by Google Gemma 4 Aura — The Gemma 4 Powered Agentic Web Copilot & Self-Healing Accessibility Engine I built a tool that catches misleading charts using Gemma 4 running locally Worklog companion with Gemma4 GBase: Building LLM Agents That Actually Learn from Their Mistakes Blossom — a small step toward student mental wellbeing WordPress Performance Monitoring: A Complete Guide Principal Components in TypeScript (Part 4) When three sharp wallets agree: what consensus signals on Polymarket actually mean I Built a Fail-Fast Rust Scheduler with Background OAuth Auto-Refresh (Part 2) Sharing is caring How Putting Faces (Literally) to My AI Garden Images Gave It a Personality Sofi Log #001: Thailand's Tourism Tax & the 180-Day AI Surveillance Wall Sofi Log #006: Decentralized IP-Address Obfuscation Specs Sofi Log #008: Bypassing Legacy Cross-Border Bank Fee Traps Secret Rotation Automation: The Operational Cost of Security Sofi Log #009: Portable Identity & DID Passport Framework Sofi Log #011: Autonomous Smart Treasury Repatriation Specs History of Linux & Unix
Hướng Dẫn Thiết Lập Reasoning Proxy DeepSeek V4-Pro với Cursor (2026)
Sebastian Pe · 2026-05-25 · via DEV Community

Cắm DeepSeek V4-Pro vào Cursor bằng cấu hình OpenAI-compatible mặc định, bạn có thể gặp lỗi HTTP 400 ngay sau lần gọi công cụ đầu tiên. Nguyên nhân: V4-Pro trả về reasoning_content, Cursor loại bỏ trường này khỏi request tiếp theo, còn API DeepSeek lại yêu cầu chuỗi lý luận đó khi tiếp tục hội thoại có tool_calls. Cách xử lý thực tế là chạy proxy mã nguồn mở yxlao/deepseek-cursor-proxy để lưu và tiêm lại reasoning_content trước khi request được gửi tới DeepSeek.

Dùng thử Apidog ngay hôm nay

Tóm tắt

  • Cursor + DeepSeek V4-Pro có thể lỗi 400 vì Cursor bỏ qua reasoning_content.
  • deepseek-cursor-proxy đứng giữa Cursor và DeepSeek, lưu reasoning_content theo từng hội thoại và tiêm lại khi có request gọi công cụ.
  • Thiết lập gồm: cài proxy, cấu hình ngrok, chạy proxy, thêm model tùy chỉnh trong Cursor.
  • V4-Pro trong Cursor dùng giá API DeepSeek. Xem thêm: DeepSeek V4-Pro Giảm Giá 75% Vĩnh Viễn.

Vì sao cần proxy?

DeepSeek V4-Pro trả về hai phần trong response:

  • content: nội dung trả lời thông thường.
  • reasoning_content: chuỗi suy luận của model.

Với chat thông thường, bạn có thể không cần quan tâm tới reasoning_content. Nhưng với tool calling, DeepSeek yêu cầu request tiếp theo phải giữ lại reasoning_content tương ứng với hội thoại trước đó.

Cursor hiện dùng client theo schema OpenAI Chat Completions. Vì reasoning_content không nằm trong schema OpenAI chuẩn, Cursor loại bỏ trường này khi tạo request kế tiếp. Kết quả là DeepSeek nhận một hội thoại thiếu trạng thái suy luận và trả về HTTP 400.

Proxy giải quyết đúng phần bị thiếu: ghi nhớ reasoning_content mà Cursor đã bỏ qua, rồi tiêm lại vào request tiếp theo.

Proxy hoạt động như thế nào?

deepseek-cursor-proxy làm ba việc chính:

  1. Lắng nghe request chat từ Cursor trên cổng cục bộ, mặc định là 9000.
  2. Lưu reasoning_content từ response của DeepSeek V4-Pro.
  3. Khi Cursor gửi request tiếp theo, proxy tìm phần reasoning_content phù hợp và thêm lại trước khi chuyển tiếp tới DeepSeek.

Proxy cũng mở tunnel qua ngrok vì cấu hình custom model của Cursor yêu cầu HTTPS và thường không chấp nhận localhost.

Cache mặc định nằm tại:

~/.deepseek-cursor-proxy/reasoning_content.sqlite3

Enter fullscreen mode Exit fullscreen mode

Proxy khóa cache bằng SHA-256 của prefix hội thoại đã chuẩn hóa, giúp các cuộc hội thoại song song không ghi đè lẫn nhau.

Điều kiện tiên quyết

Bạn cần:

  • Cursor 2.0 trở lên.
  • API key DeepSeek từ platform.deepseek.com.
  • Python 3.11 trở lên.
  • Tài khoản ngrok có authtoken.

Nếu chưa cài uv, xem tài liệu cài đặt uv. Với ngrok, xem hướng dẫn khởi động nhanh ngrok.

Bước 1: Cài đặt proxy

Cách nhanh nhất là dùng uv:

uv tool install deepseek-cursor-proxy

Enter fullscreen mode Exit fullscreen mode

Hoặc dùng pip bằng cách clone repo:

git clone https://github.com/yxlao/deepseek-cursor-proxy.git
cd deepseek-cursor-proxy
pip install -e .

Enter fullscreen mode Exit fullscreen mode

Kiểm tra lệnh đã có trong PATH:

deepseek-cursor-proxy --help

Enter fullscreen mode Exit fullscreen mode

Bước 2: Cấu hình ngrok

Thêm authtoken ngrok:

ngrok config add-authtoken YOUR_NGROK_AUTHTOKEN

Enter fullscreen mode Exit fullscreen mode

Nếu dùng gói miễn phí, mỗi lần restart có thể nhận một subdomain ngẫu nhiên mới. Nếu muốn URL ổn định hơn, tạo reserved domain trong dashboard ngrok và truyền vào proxy:

deepseek-cursor-proxy --ngrok-url https://your-reserved.ngrok-free.app

Enter fullscreen mode Exit fullscreen mode

Bước 3: Khởi động proxy

Chạy với cấu hình mặc định:

deepseek-cursor-proxy

Enter fullscreen mode Exit fullscreen mode

Output sẽ tương tự:

Starting deepseek-cursor-proxy
Tunnel: https://random-name.ngrok-free.app
Local:  http://127.0.0.1:9000
Cache:  /Users/you/.deepseek-cursor-proxy/reasoning_content.sqlite3

Enter fullscreen mode Exit fullscreen mode

Một số flag hữu ích:

# Đổi cổng local
deepseek-cursor-proxy --port 9001

# In request/response để debug
deepseek-cursor-proxy --verbose

# Không mở ngrok tunnel
deepseek-cursor-proxy --no-ngrok

# Không hiển thị reasoning block trong Cursor
deepseek-cursor-proxy --no-display-reasoning

Enter fullscreen mode Exit fullscreen mode

Giữ proxy chạy trong một terminal riêng. Cursor sẽ gọi proxy cho mỗi request tới model tùy chỉnh.

Bước 4: Thêm model tùy chỉnh trong Cursor

Trong Cursor, mở phần Settings → Models, sau đó thêm custom model.

Điền các trường:

  • Model name: deepseek-v4-pro
  • Base URL: URL ngrok kèm /v1

Ví dụ:

https://random-name.ngrok-free.app/v1

Enter fullscreen mode Exit fullscreen mode

  • API key: API key DeepSeek của bạn, thường bắt đầu bằng sk-.

Proxy không có lớp xác thực riêng. Nó chuyển tiếp API key tới DeepSeek.

Nếu Cursor báo lỗi khi verify model, kiểm tra lại:

  • Proxy còn chạy không.
  • URL ngrok có đúng không.
  • Base URL có kết thúc bằng /v1 không.
  • Log proxy có nhận request từ Cursor không.

Bước 5: Kiểm tra bằng một tool call

Trong Cursor chat, chọn custom model vừa tạo và thử prompt buộc Cursor dùng tool:

“Mở README trong repo này, liệt kê mọi khối mã, và cho tôi biết khối nào thiếu gợi ý ngôn ngữ.”

Luồng đúng sẽ là:

  1. Cursor gửi message tới proxy.
  2. Proxy chuyển tiếp tới DeepSeek.
  3. DeepSeek trả về content, reasoning_contenttool_calls.
  4. Proxy lưu reasoning_content.
  5. Cursor chạy tool, ví dụ read_file.
  6. Cursor gửi request tiếp theo nhưng thiếu reasoning_content.
  7. Proxy tìm cache phù hợp, tiêm lại reasoning_content.
  8. DeepSeek chấp nhận request và trả về câu trả lời cuối cùng.

Nếu chạy proxy với --verbose, bạn sẽ thấy quá trình tiêm lại trong log.

Chi phí thực tế

V4-Pro trong Cursor dùng giá API DeepSeek, không dùng quota model mặc định của Cursor. Theo mức giá được nêu trong bài gốc:

Loại token Giá mỗi 1 triệu token
Đầu vào cache miss $0.435
Đầu vào cache hit $0.003625
Đầu ra $0.87

Ví dụ một ngày dùng nhiều:

  • 50 lượt chat.
  • Mỗi lượt khoảng 8.000 input token.
  • Mỗi lượt khoảng 1.500 output token.

Tính nhanh:

50 × 8.000 × $0.435 / 1.000.000 = $1.74 input, trường hợp xấu nhất
50 × 1.500 × $0.87 / 1.000.000 = $0.065 output

Enter fullscreen mode Exit fullscreen mode

Nếu cache hit tốt cho phần prefix hệ thống và context, chi phí input có thể giảm đáng kể. Bài phân tích giá đầy đủ nằm ở DeepSeek V4-Pro Giảm Giá 75% Vĩnh Viễn.

Xem thêm:

Trải nghiệm V4-Pro trong Cursor

1. Reasoning token có thể hiển thị

Mặc định, proxy hiển thị reasoning của DeepSeek dưới dạng block markdown có thể thu gọn bằng <details>.

Nếu không muốn thấy phần này:

deepseek-cursor-proxy --no-display-reasoning

Enter fullscreen mode Exit fullscreen mode

Suy luận vẫn diễn ra, chỉ phần hiển thị bị ẩn.

2. Tool call đầu tiên có thể chậm hơn

V4-Pro là model tư duy nên thường cần thêm vài giây trước tool call đầu tiên. Sau đó các request tiếp theo chạy bình thường.

3. Refactor nhiều file có thể tốt hơn

Với các tác vụ như đổi tên, thay đổi chữ ký hàm hoặc refactor dựa trên config, reasoning chain của V4-Pro có thể giúp model theo dõi dependency nhiều file tốt hơn.

Các hướng dẫn DeepSeek + Cursor khác:

Kiểm tra thiết lập DeepSeek bằng Apidog

Tích hợp Cursor chỉ kiểm tra đường đi từ Cursor. Nếu bạn dùng V4-Pro cho bot CI, backend agent hoặc plugin IDE riêng, bạn nên có bộ test API độc lập.

Giao diện Apidog hiển thị một yêu cầu và phản hồi API.

Với Apidog, bạn có thể tạo environment trỏ tới:

https://api.deepseek.com/v1

Enter fullscreen mode Exit fullscreen mode

Sau đó nhập API key và schema OpenAI Chat Completion để:

  • Ghi lại response chuẩn từ V4-Pro và phát lại khi thay đổi prompt.
  • Validate tool_calls bằng JSON Schema.
  • So sánh V4-Pro và GPT-5.5 trên cùng một batch input.

Tải tại Apidog, import DeepSeek OpenAPI spec và bạn có thể dựng bàn test V4-Pro trong vài phút. Quy trình tương tự bài Cách sử dụng API DeepSeek V4.

Lỗi thường gặp

Lỗi 400 sau tool call đầu tiên

Đây là lỗi proxy được thiết kế để xử lý. Nếu vẫn gặp:

  • Kiểm tra proxy có đang chạy không.
  • Kiểm tra Cursor có trỏ đúng ngrok URL không.
  • Đảm bảo Base URL kết thúc bằng /v1.
  • Chạy proxy với --verbose để xem request có đi qua proxy không.

Ngrok tunnel liên tục đổi URL

Gói miễn phí có thể đổi URL sau khi restart. Nếu Cursor verify thành công rồi lỗi sau đó, có thể URL đã đổi.

Cách xử lý:

deepseek-cursor-proxy --ngrok-url https://your-reserved.ngrok-free.app

Enter fullscreen mode Exit fullscreen mode

Reasoning hiển thị trùng lặp

Có thể bạn đang chạy nhiều instance proxy dùng chung SQLite cache.

Cách xử lý:

pkill -f deepseek-cursor-proxy
rm ~/.deepseek-cursor-proxy/reasoning_content.sqlite3
deepseek-cursor-proxy

Enter fullscreen mode Exit fullscreen mode

Cache hit thấp

Prompt cache của DeepSeek cần prefix giống nhau theo byte. Nếu Cursor chèn timestamp hoặc session ID vào system prompt, cache hit sẽ giảm.

Bạn có thể:

  • Giảm nội dung biến đổi trong system prompt.
  • Chuyển nội dung động sang user message.
  • Chấp nhận chi phí cao hơn cho các phiên nhiều context.

Cursor báo “model not found”

Tên model trong Cursor phải là model DeepSeek hợp lệ. Ví dụ:

deepseek-v4-pro
deepseek-v4-flash
deepseek-v3-2-pro
deepseek-r1-1

Enter fullscreen mode Exit fullscreen mode

Proxy không dịch tên model. Nó chuyển tiếp nguyên chuỗi tới DeepSeek.

Nếu không muốn dùng proxy

Bạn có hai lựa chọn chính:

1. Dùng V4-Flash

deepseek-v4-flash không phải model tư duy và không trả về reasoning_content, nên Cursor có thể gọi trực tiếp mà không cần proxy. Đổi lại, bạn mất khả năng reasoning chain của V4-Pro.

2. Dùng IDE agent có hỗ trợ reasoning model

Một số công cụ như Cline, Continue hoặc plugin IDE AI khác có thể xử lý reasoning_content tự nhiên hơn trong tool calling.

Xem thêm: Trợ lý mã hóa mã nguồn mở tốt nhất năm 2026: các lựa chọn thay thế Cursor miễn phí.

Các tích hợp model khác với Cursor:

Câu hỏi thường gặp

Vì sao Cursor chưa hỗ trợ DeepSeek V4-Pro trực tiếp?

Cursor dùng schema OpenAI Chat Completions. reasoning_content là phần mở rộng riêng của DeepSeek, không thuộc schema OpenAI chuẩn. Cursor cần xử lý riêng cho provider này để giữ lại trường đó qua các tool call.

Proxy có hoạt động với DeepSeek R1 hoặc V3.2 không?

Có, miễn là model DeepSeek đó trả về reasoning_content và yêu cầu trường này trong request tiếp theo khi dùng tool calling.

Proxy có an toàn để chạy lâu dài không?

Có, nhưng lưu ý SQLite cache chứa nội dung reasoning thô từ phiên làm việc của bạn. Nếu dùng chung máy hoặc nhiều user, hãy giới hạn quyền truy cập thư mục cache.

Có thể dùng proxy không cần ngrok không?

Có:

deepseek-cursor-proxy --no-ngrok

Enter fullscreen mode Exit fullscreen mode

Khi đó proxy chỉ mở:

http://127.0.0.1:9000

Enter fullscreen mode Exit fullscreen mode

Tuy nhiên UI custom model của Cursor thường yêu cầu HTTPS, nên đa số trường hợp vẫn cần ngrok, Cloudflare Tunnel hoặc Tailscale Funnel.

Proxy thêm bao nhiêu độ trễ?

Proxy chỉ thêm một network hop cục bộ, một lần đọc SQLite và thao tác JSON nhỏ. Độ trễ thường không phải nút thắt cổ chai. Phần chậm hơn chủ yếu đến từ reasoning của model và tunnel HTTPS.

Proxy lưu cache theo cách nào?

Proxy băm prefix hội thoại bằng SHA-256, sau đó ánh xạ hash đó tới reasoning_content từ response DeepSeek gần nhất. Request tiếp theo được băm lại để tìm cache phù hợp. Cách này tránh việc hai hội thoại tương tự nhau làm nhiễu cache của nhau.

Kết luận

Vấn đề khi dùng DeepSeek V4-Pro trong Cursor không nằm ở khả năng model mà ở contract API: DeepSeek cần reasoning_content, còn Cursor bỏ trường đó khi tool calling. deepseek-cursor-proxy vá đúng khoảng trống này bằng cách lưu và tiêm lại reasoning state.

Ba bước nên làm tiếp theo:

  1. Cài proxy và test trên vài pull request hoặc task refactor thật trong repo của bạn.
  2. Kiểm tra system prompt của Cursor để giảm nội dung động làm hỏng prompt cache.
  3. Dùng Apidog để tạo bộ regression test cho endpoint DeepSeek trước khi đưa vào workflow production.