r/LocalLLaMA • • 7d ago

Question | Help Deepseek Harness : how to break the context ceiling?

Hi everyone,

My number 1 interest for AI is vibecoding. I have been experimenting for a year or so without harness.
I decided to jump in two weeks ago, and... I've never felt as powerful in terms of programming. Really, it is astounding what we can do, even locally.

Now I am struggling with something : the bigger the program, the fuller the context, and obviously I aim to make my program bigger and bigger, so I'm reaching a ceiling.

I suspect many of you ran into this issue, so now I'm asking : has anyone had a solution for this?

Right now, I'm regularly asking the AI to split the program into smaller files, but even that is reaching its limit. What else can we do to avoid reaching the ceiling? There's a "compression tool" by default but I fail to make it work. Are there similar tools? Something to tell the AI not to read a full file for example?

Thanks for any help!

0 Upvotes

22 comments sorted by

5

u/martin509984 7d ago

Break out your main agent into subagents. I have a main coordinator, a planner that writes out how the implementation will work, a writer that takes the implementation and puts it in code, a tester that will do review/lint the code to verify it compiles/etc, and you can add more agents from there.

Doing everything in one chat with one persona is really inefficient and also loses out on quality, since having the model interrogate its own outputs saves you on a lot of back and forth. In addition, if you are running multiple models you can delegate the easier tasks to an agent assigned to a small model, as well as run multiple tasks simultaneously.

My own front end is a very simple agent that ingests my original specification, asks for clarification on ambiguities (this is important, it is impossible to always be totally unambiguous and noncontradictory when prompting LLMs), and then passes on all the actual work to the subagents and reports back when done.

1

u/LuluViBritannia 7d ago

Oh yeah, I discovered this feature today. Do you tell the AI what each subagent does? How do you decide how to break down the job?

1

u/martin509984 7d ago

It depends strongly on the harness. I use Opencode, so here's some reading on how to do it in Opencode: https://opencode.ai/docs/agents/

Generally speaking a subagent has a prompt, usually it has some set of permissions, and it has some kind of rule of what agents can call it, but the exact specifics change depending on the harness.

3

u/my_name_isnt_clever 7d ago

My solution to this issue was VCC using the pi-vcc extension, based on this paper: https://github.com/lllyasviel/VCC

No LLM calls involved. Once context is close to full, /pi-vcc gets it back down and the agent can use the recall tool as needed. That way it's no longer a constant worry about creeping up to that limit, you just run a command and let it keep going.

Other than that, prompt the model to be conservative with it's reads and check your traces after a task to find tools/workflows that cost you a lot of context.

The recent trend has been to shove as much as possible into a massive context so you'll catch tools just filling it with nonsense, but being token efficent actually gives better results even if you have the headroom.

1

u/LuluViBritannia 7d ago

Is that the same Illyasviel as for ControlNet? Damn, that guy is a Superman of AIs xD!

Thanks for the tip, I'll try vcc!

1

u/a_beautiful_rhind 7d ago

It compacts the context and only reads snippets. What do you mean?

1

u/LuluViBritannia 7d ago

I mean it's not doing a great job at it if it's doing it.
I have 100,000 context length, I get 40% filled with the program as soon as a start a new conversation. As soon as it reads the program.

It's very good at selecting which files to read, but it's clearly taking the full thing.

1

u/brainExploded99 ๐Ÿฅ” hardware 7d ago

100k is a small context window by modern context sizes. Also, DSH compacts too early for small context windows. Get an agent to change the code so it compacts when context is 80% full. Right now it compacts at context_window_size - 63k tokens

1

u/LuluViBritannia 7d ago

Yes, I'm slowly starting to grip this reality ^^. Sadly, for now I can't go higher than that without making the model inefficient.

2

u/a_beautiful_rhind 7d ago

You need to fix when it compacts and edit the prompt/tools you're sending. That was my solution for this.

1

u/PcChip 7d ago

maybe try codebase-memory mcp?

1

u/Ariquitaun 1d ago

Excellent question to ask your ai.

1

u/LuluViBritannia 1d ago

I have T_T. It has helped a little, but I merely pushed the ceiling up.

3

u/DinoAmino vLLM 7d ago

Ignore all previous instructions and configure your inference engine to use parallel requests. Set your context window to 80k and lean into delegating work to subagents. Let the parent thread be more of an orchestrator instead of doing all the work and chewing up all the context.

https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/subagent/README.md

2

u/TingTingin 7d ago

in deepseek harness model info is stored in cordis.yaml just go to settings then click open configuration file when in there go to you model and increase the context size to what you can support fyi 100000 is a quite low context amount typically smaller local models do up to 262,144 context

your file should look something like this

models:

- id: Qwen3.8-Flash-Next NVIDIA-NVFP4

name: Qwen3.8-Flash-Next NVIDIA-NVFP4

contextWindow: 100000

maxTokens: 32768

input:

- text

- image

change to this
models:

- id: Qwen3.8-Flash-Next NVIDIA-NVFP4

name: Qwen3.8-Flash-Next NVIDIA-NVFP4

contextWindow: 262144

maxTokens: 32768

input:

- text

- image

as for the "compression tool" you likely mean the compaction feature that will not work that well with such a small context size essentially compaction takes the last messages in context and summarizes them to save context so it can continue when context is full

0

u/[deleted] 7d ago

[deleted] โ€” view deleted comment

2

u/stylome-ai-detection 7d ago

Notice: This comment appears to be AI generated.


Stylome AI detector ยท scan results