<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-stopped-my-local-llm-agent-from-running-out-of-context-and-now-it-handles-what-claude-code-does-kfav6uv6k" -->

---
title: I stopped my local LLM agent from running out of...
description: Local AI agent tools like Eigent hit context-limit errors quickly because runners such as LM Studio, Ollama, and llama.cpp default to tiny context windows...
canonical: https://daily.dev/posts/i-stopped-my-local-llm-agent-from-running-out-of-context-and-now-it-handles-what-claude-code-does-kfav6uv6k
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I stopped my local LLM agent from running out of context, and now it handles what Claude Code does | daily.dev
og:description: Local AI agent tools like Eigent hit context-limit errors quickly because runners such as LM Studio, Ollama, and llama.cpp default to tiny context windows...
og:url: https://daily.dev/posts/i-stopped-my-local-llm-agent-from-running-out-of-context-and-now-it-handles-what-claude-code-does-kfav6uv6k
og:image: https://api.daily.dev/og/posts/KfAv6Uv6k.png
og:image:alt: I stopped my local LLM agent from running out of context, and now it handles what Claude Code does
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I stopped my local LLM agent from running out of context, and now it handles what Claude Code does

**[XDA Developers](https://daily.dev/sources/xda-developers)** · 4 min read · 0 upvotes · 0 comments

## Summary

Local AI agent tools like Eigent hit context-limit errors quickly because runners such as LM Studio, Ollama, and llama.cpp default to tiny context windows (2k-4k tokens) to protect VRAM. Raising the context window alone isn't enough; quantizing the KV cache (K and V set to Q8_0 in LM Studio) and disabling the Thinking/reasoning setting frees up enough budget for multi-step agent tasks to complete without errors, even on an 8GB GPU, though runs remain slower than cloud tools like Claude Code.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.xda-developers.com/stopped-my-local-llm-agent-from-running-out-of-context>

## Questions this post answers

### Why does my local LLM agent keep saying context size has been exceeded during multi-step tasks?

Local model runners default to very small context windows to avoid crashing consumer GPUs, since context is reserved in VRAM. LM Studio defaults to around 2k-4k tokens, Ollama drops to 4k on cards under 24GB VRAM despite recommending at least 64,000 for agents, and llama.cpp also defaults to roughly 4k, causing multi-step agent tasks to run out of room.

_daily.dev surfaces practical fixes like this for developers wrestling with local agent setups and VRAM limits._

### How can I fit a larger context window for a local LLM agent on an 8GB GPU?

Quantize the KV cache instead of only raising the context slider. Setting both K and V cache to Q8_0 in LM Studio, with Flash Attention enabled, frees enough VRAM to run multi-step agent tasks without context errors, even on an 8GB card, though going to 4-bit KV cache risks losing precision and remains labeled experimental.

_Developers tuning local agents around VRAM constraints can find these workflow tricks through daily.dev._

### Does disabling the Thinking or reasoning setting help a local LLM agent avoid running out of context?

Yes, reasoning tokens consume part of the context budget, so keeping the Thinking setting off preserves more room for actual task steps. Small Qwen 3.5 models are supposed to ship with reasoning off by default, but reasoning tokens still appeared in some logs, so explicitly disabling it is recommended for agentic runs.

_daily.dev helps developers track these kinds of configuration gotchas when running agentic workflows locally._

## Similar posts on daily.dev

- [Your local LLM is quietly wasting RAM on context you never use, and one setting gives it back](https://daily.dev/posts/your-local-llm-is-quietly-wasting-ram-on-context-you-never-use-and-one-setting-gives-it-back-axfdmnnrk) · XDA Developers · 3 upvotes · 1 comments
- [Can a Local LLM Run My AI Assistant?](https://daily.dev/posts/can-a-local-llm-run-my-ai-assistant--k8pjpamza) · Towards Data Science · 0 upvotes · 0 comments
- [Optimizing LLM Context Windows: Practical Techniques for AI Engineers](https://daily.dev/posts/optimizing-llm-context-windows-practical-techniques-for-ai-engineers-vtwtnw8lw) · PromptLayer Blog · 1 upvotes · 0 comments
- [Context window in AI: why every token is a budget decision](https://daily.dev/posts/context-window-in-ai-why-every-token-is-a-budget-decision-reskx1u2b) · Redis · 0 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#local-ai](https://daily.dev/tags/local-ai), [#ollama](https://daily.dev/tags/ollama), [#lm-studio](https://daily.dev/tags/lm-studio)

[View this post on daily.dev](https://daily.dev/posts/i-stopped-my-local-llm-agent-from-running-out-of-context-and-now-it-handles-what-claude-code-does-kfav6uv6k)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I stopped my local LLM agent from running out of context, and now it handles what Claude Code does","url":"https://daily.dev/posts/i-stopped-my-local-llm-agent-from-running-out-of-context-and-now-it-handles-what-claude-code-does-kfav6uv6k","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-stopped-my-local-llm-agent-from-running-out-of-context-and-now-it-handles-what-claude-code-does-kfav6uv6k"},"datePublished":"2026-09-27T10:02:16.396Z","dateModified":"2026-09-27T10:02:54.524Z","description":"Local AI agent tools like Eigent hit context-limit errors quickly because runners such as LM Studio, Ollama, and llama.cpp default to tiny context windows...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/22420989c01769fa5c1e5323a95b83a0?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/22420989c01769fa5c1e5323a95b83a0?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"XDA Developers","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"XDA Developers","logo":"https://media.daily.dev/image/upload/s--kCg6yyAP--/f_auto,q_auto/v1774964407/logos/xda-developers?_a=BAMAMiWQ0","url":"https://daily.dev/sources/xda-developers"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-stopped-my-local-llm-agent-from-running-out-of-context-and-now-it-handles-what-claude-code-does-kfav6uv6k","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,local-ai,ollama,lm-studio","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"XDA Developers","item":"https://daily.dev/sources/xda-developers"},{"@type":"ListItem","position":3,"name":"I stopped my local LLM agent from running out of context, and now it handles what Claude Code does"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-stopped-my-local-llm-agent-from-running-out-of-context-and-now-it-handles-what-claude-code-does-kfav6uv6k#faq","mainEntity":[{"@type":"Question","name":"Why does my local LLM agent keep saying context size has been exceeded during multi-step tasks?","acceptedAnswer":{"@type":"Answer","text":"Local model runners default to very small context windows to avoid crashing consumer GPUs, since context is reserved in VRAM. LM Studio defaults to around 2k-4k tokens, Ollama drops to 4k on cards under 24GB VRAM despite recommending at least 64,000 for agents, and llama.cpp also defaults to roughly 4k, causing multi-step agent tasks to run out of room. daily.dev surfaces practical fixes like this for developers wrestling with local agent setups and VRAM limits."}},{"@type":"Question","name":"How can I fit a larger context window for a local LLM agent on an 8GB GPU?","acceptedAnswer":{"@type":"Answer","text":"Quantize the KV cache instead of only raising the context slider. Setting both K and V cache to Q8_0 in LM Studio, with Flash Attention enabled, frees enough VRAM to run multi-step agent tasks without context errors, even on an 8GB card, though going to 4-bit KV cache risks losing precision and remains labeled experimental. Developers tuning local agents around VRAM constraints can find these workflow tricks through daily.dev."}},{"@type":"Question","name":"Does disabling the Thinking or reasoning setting help a local LLM agent avoid running out of context?","acceptedAnswer":{"@type":"Answer","text":"Yes, reasoning tokens consume part of the context budget, so keeping the Thinking setting off preserves more room for actual task steps. Small Qwen 3.5 models are supposed to ship with reasoning off by default, but reasoning tokens still appeared in some logs, so explicitly disabling it is recommended for agentic runs. daily.dev helps developers track these kinds of configuration gotchas when running agentic workflows locally."}}]}
```

