---
title: "Making open models work for long-horizon agentic workloads"
description: "Agentic coding workloads resend the whole growing transcript each turn while emitting short tool calls, so they are prefill-dominated and depend on prefix caching, which only reuses work up to the first changed token."
url: "https://swe.quest/articles/making-open-models-work-for-long-horizon-agentic-workloads-904e5a2645303fb2"
canonical: "https://www.together.ai/blog/making-open-models-work-for-long-horizon-agentic-workloads"
source: "Together AI"
published: "2026-11-16"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 12
tags: ["inference","ai-agents","caching","llms","load-balancing"]
---

# Making open models work for long-horizon agentic workloads

A post on [Together AI](https://swe.quest/sources/together.md), published 2026-11-16, 12 min read, Deep dive. Original: [https://www.together.ai/blog/making-open-models-work-for-long-horizon-agentic-workloads](https://www.together.ai/blog/making-open-models-work-for-long-horizon-agentic-workloads)

## Summary

Agentic coding workloads resend the whole growing transcript each turn while emitting short tool calls, so they are prefill-dominated and depend on prefix caching, which only reuses work up to the first changed token. On the harness side that means keeping the system prompt and tool list identical, appending late-loaded tool definitions at the end, fixing reasoning effort for the session, truncating tool output with explicit range markers, and choosing between inheriting context or sending briefs to subagents. On the engine side it means cache-aware and load-aware routing (prompt\_cache\_key or longest-prefix hashing), offloading idle caches to CPU memory, PagedAttention and continuous batching, and disaggregated prefill/decode clusters linked over RDMA. Cache memory headroom, not compute, usually limits concurrency, so both sides must cooperate to keep long sessions fast.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Load balancing](https://swe.quest/tags/load-balancing.md) (Infrastructure)

## Prerequisites

- LLM inference basics ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))
- KV cache ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- tool-calling agents ([easy posts on AI agents](https://swe.quest/tags/ai-agents.md?difficulty=easy))

## Keywords

prefix caching, KV cache, PagedAttention, continuous batching, Ollama, Together AI, GLM-5.3, RDMA

## Related posts

- [Continuous batching from first principles](https://swe.quest/articles/continuous-batching-from-first-principles-b2a5a3d9c00e56be.md): Hugging Face · 2025-11-25 · Medium · 17 min read · Inference & serving, LLMs, Performance engineering
  Continuous batching falls out naturally once you optimize LLM serving for throughput, and the post derives it step by step from attention, causal masking, KV caching and chunked prefill.
- [ThunderAgent: 2x Faster Agentic Inference for Synthetic Data Generation at Scale](https://swe.quest/articles/thunderagent-2x-faster-agentic-inference-for-synthetic-data-generation-at-scale-7560ef73731954d5.md): Together AI · 2026-07-29 · Hard · 6 min read · Inference & serving, AI agents, Scheduling, Performance engineering, LLMs
  ThunderAgent is a scheduling layer between agent clients and inference backends that treats each multi-turn agentic workflow as a schedulable program instead of independent requests, preventing KV cache thrashing when agents pause for tool calls.
- [Cache-aware prefill–decode disaggregation (CPD) for up to 40% faster long-context LLM serving](https://swe.quest/articles/cache-aware-prefill-decode-disaggregation-cpd-for-up-to-40-faster-long-context-7f727a0ea889f194.md): Together AI · 2026-03-04 · Hard · 9 min read · Inference & serving, Caching, LLMs, Performance engineering, Scheduling
  Cache-aware prefill–decode disaggregation (CPD) extends standard PD serving with a dedicated pre-prefill tier for low-reuse (cold) long prompts, a router that estimates prefix-cache reuse per request, and a three-level KV cache hierarchy (GPU memory, host DRAM, RDMA-connected distributed cache).
- [Prefill and Decode for Concurrent Requests - Optimizing LLM Performance](https://swe.quest/articles/prefill-and-decode-for-concurrent-requests-optimizing-llm-performance-66a6db57e54903ca.md): Hugging Face · 2025-04-16 · Medium · 10 min read · Inference & serving, LLMs, Performance engineering, Hardware
  LLM token generation splits into a compute-bound prefill phase, which processes all prompt tokens in parallel to produce the first token, and a memory-bandwidth-bound decode phase, which produces later tokens one at a time.
- [How Long Prompts Block Other Requests - Optimizing LLM Performance](https://swe.quest/articles/how-long-prompts-block-other-requests-optimizing-llm-performance-d2ca64ef1cd69733.md): Hugging Face · 2025-06-12 · Hard · 7 min read · Inference & serving, LLMs, Performance engineering, Scheduling
  Under vLLM's default chunked-prefill scheduling, a single long prompt blocks the prefill queue, and any prefill running alongside decodes slows token generation for requests already in progress.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
