Repository navigation
Best practices for local Ollama (RTX 3090) + Cline: Handling timeouts, token limits, and improving Autonomy #14387
Replies: 3 comments 1 reply
|
Can't help much on the auto-approve side, but on a single 3090 the timeouts and empty replies are often a memory/context issue on the Ollama side, so here's the budget for
So ~64K fits comfortably at f16 and ~90K is about the ceiling. If the context is set to 128K+, Ollama has to put part of the model on the CPU and generation drops to a few tok/s, which is exactly when long Cline turns hit the body timeout or come back empty. The other direction bites too: Cline's system prompt + a 400-line file + tool history grows fast, and when the prompt is longer than the context, Ollama truncates it rather than erroring, which can give those odd empty or confused turns. Ollama's own docs suggest at least 64K for coding agents. For scale on speed: fully on the GPU, a 27B at ~Q4 on a 3090 should do roughly 26-36 tok/s at 32K context (936 GB/s / ~19 GB read per token ≈ 49 tok/s ceiling; real engines get 55-75% of that). A ~5K-token file rewrite plus thinking is a few minutes of generation, so nudging Cline toward |
|
Update: Significantly mitigated UND_ERR_BODY_TIMEOUT via strict rulesets (but data-heavy context still breaks it) After extensive testing with a single-model approach (qwen3.8:27b quantized to Q4_K_M) on a 24GB RTX 3090, I wanted to share what works and where the hard limits still lie regarding the UND_ERR_BODY_TIMEOUT.
Here is the exact markdown block I enforce: Why the Snippet Strategy works: By forcing the agent to create a snippet.js file first, it avoids loading massive files into the editor tool memory. In one recent task at ~49k tokens, the agent realized its generated code exceeded the tool limits, so it autonomously split the creation of the snippet into two separate tool calls (writing lines 1-83 first, then appending the rest). No timeout! 2. The Catch: Raw Data Overload Once the context window spiked to 78,000 tokens (surpassing my num_ctx: 64000 limit), the agent successfully ran its Python scripts but completely choked when trying to write a simple text response file (REPLY_MAIL.txt). The sheer weight of the context history caused the timeout. The takeaway for 24GB setups: I'd love to hear how others are navigating these limits! Have any of you found different workarounds for data-heavy tasks on 24GB setups, or are you also relying on frequent "New Task" resets to clear the context? Please share your experiences below! |
|
One more lever for the timeouts that are left, since they hit on long generations: raw decode speed. qwen3.8:27b has an MTP head, and how much you get out of it depends a lot on the runtime. I build llmash, an Ollama-compatible server on a llama.cpp fork. Same API, and it reads your existing Ollama models, so Cline needs no changes. In my benchmarks the same 27B decodes at 162-173 tok/s on llmash against 110-148 for Ollama's MTP q4_K_M build. That was on an RTX PRO 6000 and I haven't measured a 3090, so treat the ratio as the rough expectation rather than the numbers. Disclosure: it's my project. |
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I'm currently building custom agents and integrations for my e-commerce platform using Cline, connected to a local Ollama instance. My hardware is a single RTX 3090 (24GB VRAM). To optimize performance and eliminate VRAM thrashing, I recently locked my environment to a "Single-Model Policy" using
qwen3.8:27b.While this made the baseline highly stable, I am struggling with two main friction points when running more complex workflows. I would love some advice from anyone running a similar local setup:
When Cline attempts to write or append large chunks of code (for example, inserting Phase 1 types and multiple functions into a 400+ line TypeScript file), the local model struggles to output everything in one go. I frequently hit these three errors:
-
terminated: BodyTimeoutError: Body Timeout Error (UND_ERR_BODY_TIMEOUT)Model reached the maximum output token limit before completing the turn(generation cuts off mid-code block).Cline usually tries to recover (e.g., running
wc -lto find the end of the file and try again), but it often breaks the flow completely.I want to be able to start a larger refactoring or testing task late at night and let Cline run autonomously. However, it often halts after a short while, waiting for manual user approval to run a terminal command or edit a specific file.
I'm looking to optimize this setup for a smoother, more deterministic developer experience. Any tips, configuration tweaks, or workflow advice would be highly appreciated!
Thanks in advance.
All reactions