Moving 35KB Prompts Off Opus: Ollama Migration Notes

Moving 35KB Prompts Off Opus: Ollama Migration Notes

Big preprompts break in ways small demos never show. Here is what changes when you move a 35KB system prompt from a frontier API to a self-hosted Ollama model.

What you will learn

  • Why a 35KB preprompt is a different engineering problem from a short prompt
  • How context windows, tokenization and instruction-following shift when you leave a frontier model
  • Concrete steps to port a large prompt to a self-hosted Ollama model without fooling yourself
  • Where self-hosted models still lose to hosted frontier models, and how to decide if that matters
  • Why this kind of migration note is worth reading even if you never self-host

What a 35KB preprompt actually is

A 35KB preprompt is not a prompt in the casual sense. It is a document: policies, tool descriptions, few-shot examples, formatting rules, edge-case handling, maybe a whole operating manual for an agent. At that size you are no longer asking a model a question. You are loading a context and hoping the model treats it as binding law rather than background noise.

That is exactly why moving one off Anthropic's Opus and onto a local Ollama model is interesting. Small prompts migrate easily. Big ones expose every assumption you made about the hosted model: how faithfully it follows long instructions, how it handles ordering, how much of the middle of a long context it actually attends to, and how much you were quietly relying on the provider's tokenizer and chat template to shape the result.

Patrick McCanna's notes on this migration, surfaced on Hacker News, are worth your time precisely because they are notes rather than a victory lap. The genre matters: migration write-ups from people who hit the wall are more useful than benchmark tables, because they tell you which wall.

Why migrating a large prompt is harder than it looks

The first trap is assuming tokens are tokens. A 35KB prompt is roughly tens of thousands of tokens, but the exact count depends on the tokenizer, and the exact behavior depends on the chat template the Ollama model ships with. A prompt tuned against one provider's formatting can arrive at a local model wearing the wrong clothes: role markers in the wrong place, system instructions demoted to a user turn, examples that no longer look like examples.

The second trap is instruction dilution. Frontier models are heavily trained to obey long system prompts. Smaller self-hosted models often follow the first few instructions and the last few, and treat the middle as scenery. If your 35KB preprompt buries a critical rule on page nine, a local model may simply ignore it while a frontier model catches it. That is not a bug you can prompt your way out of; it is a capability gap you have to design around.

The third trap is evaluation. If you test the migrated prompt with three examples and they look fine, you have learned almost nothing. Large preprompts fail on the long tail: the weird input, the conflicting instruction, the format that only appears once a week. You need a regression set before you move, not after.

If you are already thinking about cost and control, this is the same argument behind Headroom: Cut LLM Token Bills Without Changing Answers — the interesting question is never 'can I switch' but 'what breaks when I do'.

Moving 35KB Prompts Off Opus: Ollama Migration Notes

How to move a large preprompt to Ollama without fooling yourself

Here is a practical sequence, drawn from the shape of the problem rather than any single benchmark.

  1. Freeze a baseline first. Run your current Opus setup against a fixed set of real inputs and save the outputs. This is your reference. Without it, every later comparison is vibes.
  2. Measure the prompt in the target tokenizer. Do not trust the token count from the hosted API. Tokenize the exact string with the local model's tokenizer and check it fits the context window with room for the response. A 35KB prompt plus a long conversation can blow past a modest local context fast.
  3. Rebuild the message structure for the local chat template. Check the model card for how system, user and assistant turns are expected. If the template does not support a true system role, fold your preprompt into the first user turn deliberately, and test whether the model treats it as authoritative.
  4. Split before you shrink. If the preprompt is a manual, consider splitting it into a stable system section and task-specific sections loaded per request. Smaller, focused contexts often outperform one giant blob on local models.
  5. Run the regression set and read the failures. Classify them: ignored instruction, format drift, hallucinated tool use, context truncation. Each class has a different fix.
  6. Keep a hosted fallback. Route hard cases to the frontier model and easy cases local. Hybrid is usually the honest answer.

You can run a local model with a command as simple as ollama run <model>, but the model name and context settings are the least of your problems. The prompt architecture is the work.

The same lesson shows up across the agent tooling space. claude-mem: Give Every AI Agent a Memory is interesting because memory is a context-management problem, and Memdoor: An AI Coding Agent That Lets a Small Model Win is worth reading for the opposite claim: small models can win when the scaffolding is right.

Where self-hosted Ollama still loses

Be clear-eyed. Self-hosting buys you privacy, predictable cost, offline operation and full control of the stack. It does not buy you frontier-level instruction adherence on a 35KB preprompt. If your preprompt is long because your task is genuinely complex, a smaller local model will likely drop rules, drift on format, and degrade quietly rather than loudly.

The honest framing from the migration notes is that the gotchas are not exotic. They are the ordinary ones — context limits, template mismatches, weaker following of long instructions — amplified by prompt size. That is useful because it tells you where to spend effort: on prompt structure and evaluation, not on hoping a bigger local model fixes everything.

If you are weighing hosted versus local across a team, the trade-offs rhyme with Runner Puts Claude Code, Codex and Copilot CLI on One Task: the tooling is converging, and the differentiator is how well you manage context and routing.

The takeaway

Read the migration notes as a checklist, not a verdict. A 35KB preprompt is a stress test for any model, and moving one to Ollama will teach you more about your own prompt design than any benchmark. Freeze a baseline, tokenize for the target, respect the chat template, split the monolith, and evaluate on the long tail. Do that and self-hosting becomes a real option rather than a demo.

Source and attribution

Hacker News
Notes on gotchas while migrating 35kb preprompts from Opus to self-hosted Ollama

Discussion

Add a comment

0/5000
Loading comments...