Why My Cursor IDE Chat Was Unreadable and How I Fixed It with Simple CSS Tweaks
June 19, 2025How I Mastered Custom AI Prompts in Cursor IDE with @Prompts for Effortless Workflows
June 19, 2025As a developer who often works offline, I kept hitting walls with Cursor IDE’s AI features. After trial and error, I found a way to run local LLMs directly in Cursor. Let me show you exactly how I made it work.
The Problem: Coding Without Internet
I rely on Cursor’s AI for coding help, but it needs cloud access. When my internet dropped during travel, I couldn’t even debug simple errors. I needed offline access for syntax checks and explanations.
The Fix: Local API Endpoints
Turns out, Cursor lets you reroute its AI requests. By pointing it to a local API, I could use models running directly on my laptop. Ollama became my go-to tool for this.
Setting Up Local LLMs: My Process
- Install Ollama: Grab it from ollama.ai. The setup takes minutes.
- Get a Model: In terminal, run
ollama pull codellama
. CodeLlama handles coding tasks well. Mistral’s another favorite of mine. - Configure Cursor: Go to Settings > AI Configurations. Change the base URL to
http://localhost:11434
(Ollama’s default port). - Test It: With Ollama running, ask Cursor something like “What’s wrong with this function?” You’ll see responses immediately.
What Worked (And What Didn’t)
On my 16GB M2 MacBook, CodeLlama handled syntax questions and error logs perfectly. It won’t replace GPT-4 for complex logic, but offline? It saved me countless times. Response times felt native—no waiting.
Solving Roadblocks
When I tried openrouter.ai first, nothing happened. The fix? Triple-check your API keys in settings and restart Cursor. I now keep a text file with my endpoints—switching between local and cloud takes seconds.
Why This Matters
Last month, I coded through a 5-hour flight with zero internet. Was it magic? No. But having local AI help felt like coding with a teammate. Try it yourself—start with CodeLlama, then experiment with other models.