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

推荐订阅源

C
Check Point Blog
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
S
Security @ Cisco Blogs
W
WeLiveSecurity
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
NISL@THU
NISL@THU
T
Troy Hunt's Blog
L
LangChain Blog
L
LINUX DO - 最新话题
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
A
About on SuperTechFans
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
Martin Fowler
Martin Fowler
Y
Y Combinator Blog
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
T
Threat Research - Cisco Blogs
SecWiki News
SecWiki News
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
P
Proofpoint News Feed
H
Hacker News: Front Page
G
GRAHAM CLULEY
I
Intezer
V
V2EX
S
Secure Thoughts
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
Latest news
Latest news
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
博客园_首页
Webroot Blog
Webroot Blog
博客园 - 三生石上(FineUI控件)
AI
AI
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
Security Archives - TechRepublic
Security Archives - TechRepublic
B
Blog RSS Feed
美团技术团队

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Why I Migrated From GPT-4o to DeepSeek — A Backend Engineer's Notes
swift · 2026-06-22 · via DEV Community

Why I Migrated From GPT-4o to DeepSeek — A Backend Engineer's Notes

Six months ago, my monthly OpenAI bill crossed four figures and I finally snapped. Not because the cost was unbearable in absolute terms, but because I had a sneaking suspicion I was overpaying for marginal quality gains. So I did what any sane backend engineer would do: I instrumented my service to log token usage by endpoint, spun up parallel calls to every major Chinese model, and started comparing numbers like my paycheck depended on it. Spoiler — it kind of did.

This is the story of what I found when I actually ran Chinese AI models (DeepSeek, Qwen, Kimi, GLM) head-to-head against the US incumbents (GPT-4o, Claude 3.5 Sonnet, Gemini 1.5 Pro) on a real production workload. Not a synthetic benchmark, not a vibes-based Twitter thread — actual requests flowing through my service. Fwiw, the results were not what I expected.

The Pricing Problem Nobody Wants to Talk About

Let's start with the part CFOs care about. The price gap between US and Chinese models in 2026 isn't a rounding error — it's a yawning chasm. Here's what I'm currently paying (or would pay) per million tokens:

Model Origin Input $/M Output $/M Multiplier vs DeepSeek V4 Flash
DeepSeek V4 Flash 🇨🇳 $0.18 $0.25 1× (baseline)
Qwen3-32B 🇨🇳 $0.18 $0.28 1.1×
GPT-4o-mini 🇺🇸 $0.15 $0.60 2.4×
Kimi K2.5 🇨🇳 $0.59 $3.00 12×
GLM-5 🇨🇳 $0.73 $1.92 7.7×
Gemini 1.5 Pro 🇺🇸 $1.25 $5.00 20×
GPT-4o 🇺🇸 $2.50 $10.00 40×
Claude 3.5 Sonnet 🇺🇸 $3.00 $15.00 60×

Sixty times. Let that marinate. Claude 3.5 Sonnet's output pricing is 60× more than DeepSeek V4 Flash. For my workload — heavy on short-to-medium classification and extraction calls — that's the difference between $40/month and $2,400/month. Same corpus, same prompts, same downstream business logic.

The knee-jerk reaction is "yeah but you get what you pay for." Does that hold up? Let me show you the numbers.

Benchmark Numbers, Because Vibes Don't Ship to Production

I pulled community-average scores for the three categories I care about as a backend engineer: general reasoning (MMLU-style), code generation (HumanEval), and Chinese-language performance (C-Eval). These are approximate — your mileage will absolutely vary based on prompt format, temperature, and whether you remembered to escape your JSON properly. Imo, they paint a clear picture regardless.

General Reasoning

Model MMLU-style Score Output $/M
Claude 3.5 Sonnet 89.0 $15.00
GPT-4o 88.7 $10.00
Qwen3.5-397B 87.5 $2.34
Kimi K2.5 87.0 $3.00
GLM-5 86.0 $1.92
DeepSeek V4 Flash 85.5 $0.25

The spread between the best and worst here is about 3.5 points. That's not nothing, but it's also not 60× of anything. Under the hood, most of these models are converging on the same training-data-plus-RLHF plateau, and the differences come down to fine-tuning specifics rather than fundamental capability gaps.

Code Generation (HumanEval)

Model Score Output $/M
Claude 3.5 Sonnet 93.0 $15.00
GPT-4o 92.5 $10.00
DeepSeek V4 Flash 92.0 $0.25
Qwen3-Coder-30B 91.5 $0.35
DeepSeek Coder 91.0 $0.25

This is the section that made me audibly laugh when I first saw it. DeepSeek V4 Flash scores within one point of GPT-4o on HumanEval while charging 40× less for output tokens. And the specialized DeepSeek Coder variant — built specifically for this task — is a hair behind at 91.0 for the same $0.25/M. If you're not using these for code-adjacent workloads, you're leaving real money on the table.

Chinese Language (C-Eval)

Model Score Output $/M
GLM-5 91.0 $1.92
Kimi K2.5 90.5 $3.00
Qwen3-32B 89.0 $0.28
GPT-4o 88.5 $10.00
DeepSeek V4 Flash 88.0 $0.25

Shocking absolutely no one, models trained on Chinese corpora perform better on Chinese-language evaluations. GLM-5 and Kimi K2.5 top this list, with Qwen3-32B punching far above its weight at $0.28/M. Even DeepSeek V4 Flash, which is positioned as a generalist, beats GPT-4o on C-Eval — for 40× less money.

The Real Moat: Access, Not Quality

Here's where I have to get real for a second. Picking Chinese models based on benchmarks alone is easy. Actually deploying them? That's where the friction lives. The obstacles aren't technical — they're commercial and regulatory:

Concern US Models Chinese Direct Global API
Payment Credit card ✅ WeChat/Alipay ❌ PayPal + cards ✅
Signup Email ✅ Chinese phone # ❌ Email ✅
Wire format OpenAI-compatible ✅ Custom per provider ❌ OpenAI-compatible ✅
Geo-restrictions None ✅ Often blocked ❌ None ✅
Docs language English ✅ Mostly Chinese ❌ English ✅
Support English ✅ Chinese ❌ Both ✅
Currency USD ✅ CNY only ❌ USD ✅

The primary barrier to Chinese models in 2026 isn't model quality — that's basically a solved problem. It's the sheer operational overhead of getting an account, getting verified, getting paid, and then dealing with N different SDK quirks from N different providers. Under the hood, most Chinese providers don't even speak the same wire format, which means you'd need to maintain N client implementations. RFC 7231 wouldn't approve.

That's why I ended up routing everything through Global API — it gives me OpenAI-compatible endpoints, USD billing, and PayPal support, which means I can A/B test providers without touching my application code.

Code Example: The Drop-In Replacement

Here's the beautiful thing about OpenAI-compatible APIs. Switching providers is literally a one-line config change in most codebases. Here's a simplified version of what my service looks like:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("GLOBAL_API_KEY"),
    base_url="https://global-apis.com/v1",
)

def classify_ticket(text: str) -> dict:
    response = client.chat.completions.create(
        model="deepseek-v4-flash",  # swap to gpt-4o, claude-3.5-sonnet, etc.
        messages=[
            {"role": "system", "content": "Classify the support ticket. Return JSON."},
            {"role": "user", "content": text},
        ],
        response_format={"type": "json_object"},
        temperature=0.0,
    )
    return response.choices[0].message.content

I run the exact same code path against gpt-4o, deepseek-v4-flash, qwen3-32b, kimi-k2.5, and glm-5 — the only thing that changes is the model string. This is what proper API design looks like, and frankly, the OpenAI spec has become the de facto standard (see also: every other provider scrambling to clone it). If you're not exploiting that portability, you're working too hard.

Head-to-Head: The Matchups That Mattered for Me

I won't bore you with every possible pairing. Here are the three that actually moved the needle in my workload.

DeepSeek V4 Flash vs GPT-4o

Dimension V4 Flash GPT-4o Winner
Output cost $0.25/M $10.00/M V4 Flash (40× cheaper)
General quality B+ A GPT-4o (small margin)
Code A A Tie
Throughput ~60 tok/s ~50 tok/s V4 Flash
Context window 128K 128K Tie
Vision input GPT-4o

My verdict: V4 Flash for everything except image-bearing requests. The quality delta is real but small — maybe 3-5% on my classification tasks. The cost delta is not small. If you need vision, pay the OpenAI tax and route through the same Global API proxy; otherwise, I don't see a defensible reason to default to GPT-4o in 2026.

Qwen3-32B vs GPT-4o-mini

Dimension Qwen3-32B GPT-4o-mini Winner
Output cost $0.28/M $0.60/M Qwen (2.1× cheaper)
General quality A- B+ Qwen
Code A- B+ Qwen
Chinese A B Qwen

My verdict: Qwen wins on every axis I tested. The pricing is close, but the quality gap isn't — Qwen3-32B consistently outperformed GPT-4o-mini on my extraction and rewriting tasks. If you're still defaulting to -mini for cost reasons, you should probably stop. The savings are an illusion once you account for retries and quality issues.

Kimi K2.5 vs Claude 3.5 Sonnet

Dimension K2.5 Claude 3.5 Sonnet Winner
Output cost $3.00/M $15.00/M K2.5 (5× cheaper)
Reasoning A+ A+ Tie (essentially)
Chinese A+ B K2.5
Long context 200K 200K Tie
Tool use A A+ Claude (small edge)

My verdict: This was the hardest call. Claude 3.5 Sonnet genuinely has the best tool-use behavior I've seen — fewer hallucinations, better structured outputs, more reliable function calling. If your product leans heavily on agentic workflows with multiple tool invocations, Claude's edge is real. But for pure reasoning, K2.5 ties it at 1/5 the price, and beats it outright on Chinese. Honestly, the right answer here might be "use K2.5 for the bulk path, fall back to Claude for tool-heavy flows" — which is exactly what I'm doing.

Code Example: The Fallback Pattern

Since I brought it up, here's how I implement the tiered routing. It's nothing fancy — just a wrapper that tries the cheap model first, escalates on low confidence:


python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("GLOBAL_API_KEY"),
    base_url="https://global-apis.com/v1",
)

def generate_with_fallback(prompt: str, complexity: str = "low") -> str:
    # Route based on request complexity heuristic
    if complexity == "low":
        primary = "deepseek-v4-flash"
        fallback = "gpt-4o"
    elif complexity == "tool_heavy":
        primary = "claude-3.5-sonnet"
        fallback = "kimi-k2.5"
    else:
        primary = "kimi-k2.5"
        fallback = "claude-3.5-sonnet"

    try:
        response = client.chat.completions.create(
            model=primary,
            messages=[{"role": "user", "content": prompt}],
            temperature=0.2,
        )
        return response.choices[0].message.content
    except Exception as e:
        # Log, alert, and escalate
        logger.warning(f"Primary {primary} failed: {e}, escalating to {fallback}")
        response = client.chat.completions.create(
            model=fallback,
            messages=[{"role": "user", "content": prompt}],
            temperature=0.2,
        )
        return response.choices[0].