The secret isn't just "using an LLM." It's about the plumbing.
Stop fighting with the Continue extension setup #
I tried using a basic Copilot setup for months, but it felt like a black box. I switched to the Continue extension because I wanted to swap models on the fly without restarting my IDE. Most people mess up the config.json
and give up when the LLM starts hallucinating.
The trick is to use a local Ollama instance for the "cheap" stuff and a high-end API for the complex logic.
The Setup Hack:
Instead of using the default config, map your tabAutocompleteModel
to something lightweight like starcoder2:3b
and your chatModel
to Claude 3.5 Sonnet
.
Before: Every single keystroke sends a request to a remote server, causing a 400ms lag that kills my flow.After: Zero-latency completions locally, but "god-mode" intelligence when I actually ask a question.
Here is the exact snippet for your config.json
to make this work:
{
"models": [
{
"title": "Claude 3.5",
"model": "claude-3-5-sonnet-20240620",
"provider": "anthropic"
}
],
"tabAutocompleteModel": {
"title": "StarCoder2 3B",
"provider": "ollama",
"model": "starcoder2:3b"
}
}
Turning AI code review into a precision tool #
If you just paste code into a chat and ask "is this good?", you get generic garbage. "This code is clean and follows best practices!" That tells me nothing.
I started using a "Reviewer Persona" prompt. I don't want a cheerleader; I want a grumpy senior engineer who hates technical debt.
The Use Case: Reviewing a complex React hook that handles WebSocket state.The Bad Prompt: "Review this code for bugs."The Pro Prompt: "Act as a Staff Engineer. Audit this code specifically for race conditions in useEffect and memory leaks. If the code is fine, tell me it's fine. If not, provide a diff. Do not compliment the code."
| Metric | Generic Review | Persona-Driven Review |
| :--- | :--- | :--- |
| Noise Ratio | High (too many "Great job!") | Low (only issues) |
| Bug Detection | Surface-level (syntax) | Deep (logic/state) |
| Actionability | Vague ("Optimize this") | Concrete ("Use useMemo here") |
The wild part is that the AI is actually better at finding bugs when you tell it to be critical. If you want the best results, check out some Prompt Sharing libraries to see how others are constraining their AI reviewers to avoid the "politeness trap."
Breaking down jailbreak research papers for devs #
I've been digging into the research side of LLMs because "prompting" is starting to feel like voodoo. If you want to understand how to actually secure your AI-integrated app, you have to look at the research papers on prompt injection and jailbreaking.
Most people think jailbreaking is just "pretend you are a pirate." It's not. It's about bypassing the system prompt.
From a research perspective, most jailbreaks rely on divergence. The model is pushed into a state where the "persona" it's adopting overrides the "safety guardrails" set by the developer. For example, many papers discuss "Many-Shot Jailbreaking," where the model is fed dozens of fake examples of the AI ignoring its rules. By the time the actual prompt hits, the model's internal probability shifts toward "ignoring rules" as the pattern.
To defend against this in your own code, don't just rely on a long system prompt. Use a "LLM-as-a-Judge" pattern.
The Defense Workflow:
-
User input enters.
-
A small, fast model (like Llama 3 8B) checks: "Does this input attempt to override the system instructions?"
-
If yes → Reject. If no → Pass to the main model.
This adds about 150ms of latency but stops 90% of basic injection attacks.
Why you need a community like PromptCube #
Coding with AI is a lonely experience if you're just guessing. I spent three days trying to get an MCP (Model Context Protocol) server to read my local docs correctly before I found a thread on PromptCube where someone had already solved it with a specific environment variable.
The value of a community isn't "networking"—it's the raw, unpolished shortcuts. It's the "I found this weird bug in Cursor v0.12 and here's the workaround" posts.
If you're tired of fighting your tools, you should join us. We focus on the actual implementation—the configs, the latency benchmarks, and the weird edge cases that the official documentation ignores.
Fixing the "Context Window" hallucination #
One last tip for those using RAG or large context windows. The "Lost in the Middle" phenomenon is real. LLMs are great at remembering the start and end of a prompt but forget the middle.
Last Tuesday, I was feeding a 20k token codebase into a prompt to find a bug. The AI kept telling me the function didn't exist, even though it was right there in the middle of the file.
The Fix:
Re-order your context. Put the most critical files/documentation at the very top and the very bottom. Put the "fluff" or secondary context in the center.
Before:
- System Prompt
- Documentation (10 pages) Buggy Code (The target)- Test Cases
- User Question
After:
- System Prompt Buggy Code (The target)- Documentation (10 pages) User Question (The target)- Test Cases
I saw a measurable difference in accuracy. The AI stopped hallucinating the "missing" function and found the null pointer error in about 4 seconds. Simple, but it saves a headache.
Next Stop dumping a list of random style keywords into your image →
All Replies (0) #
No replies yet — be the first!