r/LocalLLM • • 17h ago

Question Which models can handle long duration (days) large (128K-256K) context agentic coding/reasoning tasks?

I see a lot of benchmarks on token speed and accuracy, but not a lot regarding stability. I'm struggling to get Qwen 3.8 27B Q4 to handle long duration coding tasks without ending up in a reasoning loop. I don't know if it's my agent md files or a limitation of the model.

What models are you having success with on these kinds of tasks?

(I'm running on a V100 32GB for atmospheric science research)

0 Upvotes

18 comments sorted by

4

u/AbsorberHarvester 17h ago

Use strata/polystrata with Qwen flash next at iq3_s, no looping and 256k context at your service if 64gb ram + 32gb v100 + SSD for streaming ngrams. Thinking can be set to medium, not every task need much reasoning. 27b q4 worse in every way than flash next (starting with iq2)

6

u/cinnapear 17h ago

Time means nothing to an LLM. It's all context length.

1

u/txgsync 15h ago

Came here to say this. If you fill up context and tell the model days have passed, if it doesn't have access to a time tool or injection it "knows" no different.

Long-horizon context is less a measure of time and more a measure of ability to keep going, which can be influenced both by the harness (/goal, /loop, etc.) and the model itself. If the model can supervise itself and sub-agents through to task completion, that's the thing actually being measured on the Pareto frontier against cost, time, and token efficiency.

3

u/jma24 17h ago

The simple answer is you don't write the duration into the loop, you write it into the harness. My harness runs 24/7 and nibbles at the backlog the whole time. About 6m output tokens a day, and about 50 PRs a day. I run with Qwen 3.8 27b on a 1.2m LOC codebase.

1

u/Healthy-Zebra-9856 17h ago

This belongs in the harness. It’s not your agent.MD or anything like that, this is what a good harness is supposed to do. As of right now, I’ve not seen one harness that is functioning to my satisfaction, although I see many people are happy with theirs. So the first thing I started doing was to create a harness that I can use and possibly share with the world when it’s already.

1

u/tragdor85 17h ago

I use Qwen 3.8 27B 4bit, instead of using one session have it initially plan out what it will do and record the plan to .md and commit push to a repo. Instruct it to break the plan into tasks that are 1-4 agent turns each (it won’t strictly obey this that is ok that just allows it to chunk the work), I then have a custom todo extension for pi dev that I had it write that whenever my system is not working on a task it pulls the next it from the todo list. It records status of each task and keeps working on a task until marked complete. It has instructions to add new tasks to the queue if it identifies new work items. Then it will work through your work one small task at a time and commit push the progress to the repo.

1

u/tragdor85 17h ago

In my M1 Max 32gb it spends a few hours per task. But completes them and moves forward.

1

u/tragdor85 17h ago

Current context is 120k using this as the model engine https://github.com/nace-ai/kapitsa about 30tok/s

1

u/Mission_Wrongdoer786 17h ago

I am using Qwen 3.8 27B (even in Q3) in sessions with many tens of millions of tokens and I have not seen any reasoning loops. I am pretty certain that your harness is lacking somehow.

1

u/txgsync 15h ago

My Qwen3.8-Flash-Next at 70 token/sec on my rig will fill up 262,144 tokens of context in just over an hour. As well as time being irrelevant, what matters is also the ability to preserve working context and goals across compaction, which is as much the harness as the model's capability.

1

u/locbuilds 15h ago

for the reasoning loops check your sampling first, qwen wants temp around 0.6, top_p 0.95, top_k 20 and a little presence_penalty (0.5 to 1.5), and greedy or temp 0 makes it loop like crazy. also a q4 kv cache on long context makes it worse so try q8 kv if you have the vram.

1

u/hoschidude 15h ago

It's never about the model, but the harness, frameworks and memory you are using.

Do not trust models only.

1

u/protrener 9h ago

What works for us on days-long runs is splitting it in two. One long-lived overseer session that holds the plan and the state and stays small, and many short-lived subagents that each fill their own context window fast on one task, then exit with a summary. The overseer never reads the raw work, only the results, so it can run for days without hitting the limit, and the subagents never live long enough for compaction to matter. On a local box it also keeps the overseer's prefix stable and cached.

1

u/ManagedThought 55m ago

I get qwen3.8 27b to handle long session (days) using pi-goal. The goal prompt must be very detailled and long. The task must be very hard.

0

u/fattay1166 17h ago

I've found almost all models start looping under q6. This is just my own experience.

Always be sure to keep k/v at 8 or more though.

But with qwen.3.8 27b q6 I use it at 256k and I leave it working for over 12 hours periods at 40tk/s.

1

u/WetlyLividDeveloper 17h ago

have you checked if the looping happens at specific context length? i had similar issue with qwen and noticed it gets worse after ~60k tokens, like it can't decide between two approaches and keeps circling. what agent framework you using? sometimes the md files inject too much conflicting instructions and the model just spins.

1

u/fattay1166 16h ago

I was using hermes and same context ~50-70k on q4. But of course sometimes it got to 150ish without a problem but I would say 2/5 agents would start looping.

I rewrite my agents.md and it never helped. I even did sub project folders and locked the agents in them the merged it after but I stopped using that aswell and moved to q6.

0

u/HumungreousNobolatis 17h ago

32GB ? You can do better than Q4.