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

推荐订阅源

S
SegmentFault 最新的问题
A
About on SuperTechFans
NISL@THU
NISL@THU
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
小众软件
小众软件
博客园 - Franky
罗磊的独立博客
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Hugging Face - Blog
Hugging Face - Blog
云风的 BLOG
云风的 BLOG
MongoDB | Blog
MongoDB | Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
The GitHub Blog
The GitHub Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
Hacker News - Newest:
Hacker News - Newest: "LLM"
Cyberwarzone
Cyberwarzone
C
CXSECURITY Database RSS Feed - CXSecurity.com
Project Zero
Project Zero
Security Latest
Security Latest
L
Lohrmann on Cybersecurity
AWS News Blog
AWS News Blog
The Hacker News
The Hacker News
I
Intezer
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Privacy International News Feed
月光博客
月光博客
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园_首页
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
The Last Watchdog
The Last Watchdog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org

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
Running Qwen 2.5 Coder 14B Locally in Cursor with Ollama
yann ortodor · 2026-05-23 · via DEV Community

I've been leaning on AI inside my editor for a while now, and Cursor is the tool that finally made it stick. It sits right in the IDE, understands my files, genuinely good at the boring stuf, refactors...

But the more I leaned on it, the more one number kept nagging at me: tokens. Every prompt, every file I dragged in, every "explain this" : all of it burns through cloud usage, and on a busy day that adds up fast. The hard, occasional problems were worth it. The endless little ones weren't, and those were most of my day.

So the real question wasn't "is the cloud good enough". It was: why am I paying cloud tokens for work a local model could handle for free? I wanted the Cursor experience for the everyday grind without metering every keystroke against a usage limit. So I wired Cursor up to Ollama and ran Qwen 2.5 Coder 14B on my own server.

The privacy angle came along for the ride and turned out to be a genuine bonus : private repos, client code, and internal logic now stay on my own box. Saving tokens is what got me to actually do this, everything else was upside.

The thing that makes this possible is that Ollama speaks the OpenAI API : /v1/models, /v1/chat/completions, all of it. So anything expecting an OpenAI-style endpoint can be pointed at a local model instead. Cursor included.

Why bother running it locally?

I want to be clear up front: the goal was never to ditch cloud models entirely but to stop spending tokens on work that doesn't need them.

The cloud is still where I go for big architectural reasoning, nasty multi-file debugging, product strategy: the stuff where you really want the strongest model you can get, and where the token cost is genuinely worth it.

The local model handles everything else, and "everything else" turns out to be most of my day: explain this file, generate a small component, review this diff, refactor a function, draft some SQL, clean up a prompt. None of that justifies a metered cloud cal once it's can run locally.

My main project has a lot of moving parts: backend services, a Vue frontend, a pile of admin screens, complex rules, data, generated assets, modules tangled into other modules. Running the model myself gives me room to poke at all of it without second-guessing where it's going.

Why this model in particular?

I tried a handful through Ollama before settling:

  • qwen2.5-coder:7b
  • qwen2.5-coder:14b
  • deepseek-coder-v2:16b
  • qwen3:8b
  • qwen3:14b

The 7B is quick and light, and honestly fine for small tasks. But once you're asking for real code help, the 14B is just the better trade. It's the sweet spot between "runs comfortably on my hardware" and "actually writes decent code."

The official Qwen2.5-Coder-14B-Instruct page lists it at 14.7B parameters. Its native context is 32,768 tokens, and it stretches up to 131,072 with YaRN, a length-extrapolation trick. That headroom is what sold me, because Cursor eats context for breakfast : code, chat history, instructions, all stacked into one request...

What I was aiming for

The shape of it is simple:

Cursor (Windows)
        ↓
OpenAI-compatible API
        ↓
Ollama (Linux server)
        ↓
Qwen 2.5 Coder 14B

Enter fullscreen mode Exit fullscreen mode

My Ollama box lives at http://my-ollama-host:11434, and the OpenAI-compatible endpoint is just that with /v1 tacked on http://my-ollama-host:11434/v1. That /v1 URL is the one Cursor wants as its OpenAI Base URL override. (Swap in your own hostname or IP wherever you see my-ollama-host.)

Step 1 — Pull the model

On the Linux server:

ollama pull qwen2.5-coder:14b

Enter fullscreen mode Exit fullscreen mode

Check what's installed:

ollama list

Enter fullscreen mode Exit fullscreen mode

Mine looks something like:

qwen3:8b
qwen2.5-coder:7b
deepseek-coder-v2:16b
qwen2.5-coder:14b
qwen3:14b
llama3.2:1b
llama3.2:3b

Enter fullscreen mode Exit fullscreen mode

And confirm the API responds:

curl http://localhost:11434/v1/models

Enter fullscreen mode Exit fullscreen mode

If Ollama's happy, you get back a JSON list of models.

Step 2 — Make sure Windows can actually reach it

This is the part people skip and then waste an hour on. Cursor was on Windows, Ollama was on Linux, so before touching any config I just checked that the two could talk.

From the Linux box itself:

curl http://my-ollama-host:11434/v1/models

Enter fullscreen mode Exit fullscreen mode

Then from Windows PowerShell:

curl.exe http://my-ollama-host:11434/v1/models

Enter fullscreen mode Exit fullscreen mode

Use curl.exe, not curl. On Windows, plain curl is usually an alias for Invoke-WebRequest, which is a different beast and will give you confusing results. The .exe forces the real thing.

Once Windows got the model list back cleanly, I knew the network was fine. Server reachable, model present, API working. Whatever broke next wasn't going to be one of those.

Step 3 — Point Cursor at it (and hit a wall)

Here's what I plugged into Cursor, which by all rights should have just worked:

  • Model: qwen2.5-coder:14b
  • OpenAI API Key: ollama
  • OpenAI Base URL override: http://my-ollama-host:11434/v1

Ollama uses model:tag names like qwen2.5-coder:14b totally standard. Cursor wasn't having it:

AI Model Not Found
Model name is not valid: "qwen2.5-coder:14b"

Enter fullscreen mode Exit fullscreen mode

I went back and checked everything twice. Name was right. Endpoint was right. The model showed up fine in /v1/models. The model wasn't missing at all Cursor just didn't like the name. Something in its validation doesn't accept arbitrary custom model names.

The hack that fixed it

The trick is to give Ollama an alias with a name Cursor will accept, and have that alias point at the real model.

I called mine gpt-4o-mini. It does not touch OpenAI. It's Qwen, wearing a name tag Cursor recognizes.

One caveat worth saying out loud: the name doesn't have to be gpt-4o-mini. It just has to be something on Cursor's list of recognized models. I picked an OpenAI name because I knew it'd pass, pick any allowlisted name you can live with.

On the Ollama server:

cat > Modelfile.gpt-4o-mini <<'EOF'
FROM qwen2.5-coder:14b
EOF

ollama create gpt-4o-mini -f Modelfile.gpt-4o-mini

Enter fullscreen mode Exit fullscreen mode

Now ollama list shows both, the alias and the thing it wraps:

gpt-4o-mini
qwen2.5-coder:14b

Enter fullscreen mode Exit fullscreen mode

So the sleight of hand is just: Cursor thinks it's using gpt-4o-mini, Ollama quietly serves qwen2.5-coder:14b. That's it. That's the whole fix. Modelfiles exist precisely for this you describe a model and stamp out a new named one from it with ollama create.

The working Cursor config ended up being:

  • Model: gpt-4o-mini
  • API Key: ollama
  • Base URL override: http://my-ollama-host:11434/v1
  • What's actually running: qwen2.5-coder:14b

Stretching the context window

Once it was running, I wanted more room. Two different limits matter here and people mix them up constantly:

  • Context window : how much the model can see at once.
  • Output length : how much it can write back in one go.

For coding in Cursor, the context window is the one that bites you, because Cursor crams code, prior conversation, instructions, and file snippets into a single request. Run out of room and it quietly starts forgetting things.

Ollama controls this with num_ctx. Its docs describe context length as the max tokens the model keeps in memory, and they ship VRAM-based defaults:

Available VRAM Default context
< 24 GiB 4k
24–48 GiB 32k
>= 48 GiB 256k

I've got 128 GiB of VRAM, so I could in theory go wild. But here's the catch nobody mentions: VRAM doesn't make a model good at long context. It just makes it possible. Push past what the model was actually trained for and you get a model that technically accepts 200k tokens and then makes things up about the first half.

And this is where that native-versus-extended distinction matters. Qwen2.5-Coder-14B is natively a 32 768-token model, the 131 072 figure only holds when you run it with YaRN extrapolation, which right now basically means vLLM. Ollama serves the GGUF build and doesn't do YaRN, so when I set num_ctx 131072 here, I'm pushing the model way past its native window without the trick that's supposed to make that work. It'll happily accept the tokens, it just gets less reliable the deeper into that range you go. So 131 072 is my hard ceiling because nothing above it is even claimed, but I treat the upper half as "use with a little suspicion" rather than gospel. In practice I run 65 536 for normal work and only reach for 131 072 when I genuinely need it. Forcing 256k for this model is pointless either way.

My two go-to configs

For everyday use:

cat > Modelfile.gpt-4o-mini <<'EOF'
FROM qwen2.5-coder:14b
PARAMETER num_ctx 65536
PARAMETER num_predict 4096
PARAMETER temperature 0.2
EOF

ollama create gpt-4o-mini -f Modelfile.gpt-4o-mini
ollama stop gpt-4o-mini

Enter fullscreen mode Exit fullscreen mode

For heavier review sessions, crank it:

cat > Modelfile.gpt-4o-mini <<'EOF'
FROM qwen2.5-coder:14b
PARAMETER num_ctx 131072
PARAMETER num_predict 8192
PARAMETER temperature 0.2
EOF

ollama create gpt-4o-mini -f Modelfile.gpt-4o-mini
ollama stop gpt-4o-mini

Enter fullscreen mode Exit fullscreen mode

What the knobs do: num_ctx is the context window, num_predict is how long a single response can run, and temperature 0.2 keeps it boring which is exactly what you want for code.

Double-checking it took

After recreating the alias:

ollama show --modelfile gpt-4o-mini

Enter fullscreen mode Exit fullscreen mode

You should see your FROM line and the three PARAMETER lines staring back. Then just make sure Cursor's still pointed at gpt-4o-mini on http://my-ollama-host:11434/v1 and you're set.

The pattern I've landed on with this much VRAM is keeping both configs around 65k for fast and snappy work, 131k for when I want it chewing on a lot at once.

Where it shines, and where it doesn't

In daily use this thing pulls real weight. Reviewing Vue components, tidying admin screens, explaining backend services, refactoring a module in isolation, writing SQL, sanity-checking API logic, knocking out tests, sharpening prompts, reading through private code I'd rather not upload anywhere. On my project specifically it's been great for the admin UI, game data, skills and spells logic, world-state and movement systems, NPC and quest structures, backend performance passes, and the prompt engineering behind generated assets.

What it won't do is stand in for a top-tier cloud model on complex problems. A 14B model with a big context window is still a 14B model. Full-repo architecture reviews, gnarly multi-file refactors, debugging that spans a dozen layers, product strategy, anything security-sensitive, big design calls is still cloud territory for me.

Which is the whole point, really. Local for the frequent, cheap, fast stuff that would otherwise quietly drain your token budget. Cloud for the rare, expensive, high-stakes thinking that's worth paying for. Use both, don't pretend one replaces the other.

What I'd tell past me

  • If /v1/models answers from Windows, stop blaming Ollama and the network. They're fine. The problem is somewhere else.
  • Cursor will reject perfectly valid Ollama model names. qwen2.5-coder:14b worked everywhere except in Cursor's name check.
  • The fastest fix is an alias Cursor accepts : gpt-4o-mini -> qwen2.5-coder:14b did it for me.
  • With lots of VRAM, raise the context but cap it at what the model can actually handle. For this one, 131 072 is the advertised ceiling (and even that leans on YaRN, which Ollama doesn't apply), so I treat the top of that range with some caution.

Wrapping up

Running a local coding model inside Cursor isn't just a party trick is something I reach for every day. Cursor, Ollama, Qwen 2.5 Coder 14B, the OpenAI-compatible API, a fat context window, and enough VRAM to not worry about it: that combination is a legitimately good local dev assistant.

And the funny part is the hardest piece wasn't what I expected. Not Ollama, not the network, not the model. It was Cursor refusing a model name. Once that clicked, the fix was almost embarrassingly small: alias the model to a name Cursor likes, point Cursor at it, serve Qwen behind it, and bump num_ctx to taste.

The payoff is a setup that keeps my token spend for the work that actually deserves it for the daily work of writing, reviewing, and refactoring, it more than holds its own, and it does it without touching a usage meter.

Final result in cursor :