Same Credits, Nearly Double the Tasks: A Technical Breakdown of Qoder's Durability Optimization
Learn More about Qoder
Explore Qoder – Agentic Coding For Enterprise

The same Credits now go further. Over the past month, the average Credits consumed per Auto task fell from 4.43 to 2.6, a drop of about 41%. At that average, a quota that used to cover 10 tasks can now cover roughly 17. This is not a limited-time discount, but a real change that technical optimization has already delivered.
The reference consumption multiplier for Auto has likewise been updated from 0.5x to 0.3x, reflecting the improved consumption level. Why are we able to spend less? This article takes a deep dive into the cache hit rate optimizations behind it. We also address the key questions raised in earlier comments at the end of this article.
In a single development task, an agent may send dozens of rounds of requests to the model. Each round carries the tool definitions, the system prompt, and the entire conversation so far, yet what is actually new is usually just the latest tool result. Does all this resubmitted content have to be recomputed from scratch every round?
Model caching says no. If the input prefix matches content the model has already processed, the model can directly reuse the existing computation, and this portion of the input costs far less than reprocessing. For the cached portion, billing can drop to as little as one-tenth, or even one-twentieth, of the uncached rate. For Qoder, every point of cache hit rate we gain lets the same quota run more tasks, and that is what we mean by durability.
This article follows that thread: how Qoder raised its cache hit rate to make Credits go further.
Starting with a Single Hit: Three Indispensable Conditions
To raise the hit rate, we first need to understand what a single hit requires.
Caching matches the prefix of a request. Take Qwen as an example: a request is organized in the order “tool definitions → system prompt → conversation messages,” and a hit requires the content before the cache point to be identical word for word. Any change anywhere in between forces everything after it to be reprocessed.
But an identical prefix is only one of the conditions. The cache is stored on a specific resource and is only valid for a limited time. A hit therefore requires three conditions to hold at once:

The first condition determines whether there is a cache to hit at all; the latter two determine whether a request can find that cache. If any one of them fails, the corresponding cached prefix may be impossible to reuse. Each model also imposes its own limits on the minimum cacheable length and the number of cache points, which we will not cover here.
Along these three conditions, building on the explicit/implicit caching settings, we made three caching strategy optimizations, each aimed at a different scenario:

Strategy 1: Layering the System Prompt So Common Prefixes Can Be Reused
This strategy starts with how the request itself is organized, and it safeguards prefix consistency.
The Symptom: 5% of Requests to Some Models Get No Cache Hit
On explicit-caching models such as Qwen and overseas SOTA Model A, 5% of requests recorded zero cache hits.
Further analysis traced the problem to how the system prompt is organized. The system prompt contains both public rules shared by all users and personalized content that varies from user to user. Before the redesign it was a single block of text, so a cache point could only be placed at the end of the whole block. Once the personalized content changed, the prefix corresponding to that cache point changed with it, and the large, otherwise fixed chunk of Qoder's globally shared system prompt ahead of it could not be reused on its own. So per-user personalization blocked reuse of the common prefix, and the first request of a new session rarely hit the cache.
The Solution: Split Content by Variability, Then Place Cache Points per Layer
The idea was to separate what is the same for everyone from what varies per person. Qoder splits the system prompt into ordered content blocks, with the globally shared part first and the personalized part last:
{
"role": "system",
"content": [
{ "type": "text", "text": "<Qoder global shared system prompt: no user information>" },
{ "type": "text", "text": "<user personalization content>" }
]
}

Figure 1: Cache hits for a new session's first request, before and after the split

Figure 2: Distribution of cache points in an overseas SOTA Model A request after layering
These cache points are ordered from the widest reuse scope to the narrowest:
- End of built-in tools: Tool definitions come first, and once they change, every cache point after them is invalidated. Because the MCP tools users add themselves differ from user to user, this cache point sits after the last built-in tool and before the first MCP tool, so the built-in tool prefix is not affected by users’ own tools.
- End of the globally shared prompt: When the preceding tool definitions also match, new sessions from different users can reuse this shared prefix.
- End of the full system prompt: This covers personalized content and is reused only by the same user’s later sessions.
- End of the conversation: This moves forward with each round, covering the session’s growing history.
Reuse granularity thus narrows from “one whole system prompt” to “content layers with different scopes of change”: the earlier a layer, the more stable it is and the more chances there are to reuse it. Layering changes only the arrangement of the content and the positions of the cache points. The only thing reused across users is the common prefix that contains no user information whatsoever; prefixes that include personalized content and the conversation are reused only by the same user’s subsequent requests.
Qoder adapts the layered content and cache point placement to the caching mechanism each model supports, so that common prefixes are reused as much as possible.

After layering, a single overseas SOTA Model A request carries up to 4 cache points. When a matching cache already exists and the hit conditions are met, even the first request of a new session can reuse the built-in tool definitions; when the tool definitions also match, it can go further and reuse the globally shared prompt.
Strategy 2: Affinity Routing That Sends Multi-Turn Requests Back to the Cache
Whether a cache exists and whether a request can find it are two different things. This strategy addresses the other two conditions: being in the same scope, and still within the validity period.
Background: How a Request Gets Scheduled
When an Auto request reaches Qoder, the scheduling layer makes two choices in sequence: first it selects the model pool, then it selects the resource within that pool to serve the request.
The Problem: The Prefix Matches, but the Cache Is on Another Resource
Model cache is stored on the resource that created it. Suppose the first round lands on Resource A, reads the code, and builds a cache. If the second round, just seconds later, is scheduled to Resource B, then even though the two prefixes are identical, B does not hold that cache and the entire content has to be written from scratch again.
The Solution: Two-Level Session Affinity
To address this, we added a two-level session affinity layer ahead of default scheduling: a request first checks what this session chose in the previous round and keeps that choice when it can, falling back to the regular selection above only when it cannot.

Figure 3: Two-level session affinity sends a session’s next request back to its original resource
Model pool affinity keeps a session from switching models midway, while resource affinity keeps requests, inside that pool, on the resource used in the previous round. Both levels are indispensable: switch the model and the cache naturally cannot be reused; keep the model but switch the resource and the cache cannot be found either.
Cache lifetimes differ from model to model, so the validity period of an affinity record must be aligned with the cache lifetime of the corresponding model.
Strategy 3: Parent–Child Session Inheritance That Extends Caching Beyond the Session
Affinity is recorded per session, but not all requests occur within the same session.
The Problem: The Context Is Inherited, but the Affinity Is Broken
A user finishes discussing an implementation plan and opens a side task to add tests, or forks a branch from the current progress to try a different approach. These new sessions have their own session identifiers, yet they inherit the parent session’s context.
To the scheduling layer, it is a brand-new session, so it picks the model pool and resource again; from the input’s perspective, its prefix has already been fully processed in the parent session. The session boundary cuts exactly where the parent session had already established its affinity.
The Solution: Child Sessions Inherit the Parent’s Model Pool and Resource
Qoder includes the originating session identifier in the request and uses it to establish the parent–child relationship. A child session’s first request directly follows the model pool and resource of the parent’s last request; after that, the child session writes its own affinity record and proceeds independently.

Figure 4: Parent–child session inheritance lets a child session’s first request pick up the parent’s cache
The first requests of side tasks and forked sessions can now reuse the main session’s cache too.
Final Thoughts
- Layered system prompts, so that even a new session’s first request can hit the model cache;
- Affinity routing, so that a session’s multiple rounds return to where the cache lives;
- Parent–child session inheritance, so that side tasks and forked sessions pick up the parent’s cache.
From the first round of a new session, through successive rounds of edits, to branched tasks, we are reducing every unnecessary recomputation. These optimizations are already reflected in Auto’s actual consumption: average Credits per task are down about 41%, letting the same quota support more work. We will keep bringing technical optimizations into every task you actually run. No manual configuration is required; just use Auto to benefit from them.
Answers to Your Questions About the Auto Tier
Q: Is the model fixed under the Auto tier?
No, it is not. The Auto tier is not backed by one specific model. After you select the Auto tier, routing picks the best fit from the Auto tier’s model pool based on your task type. You might be routed to Model A this time, and to Model B next time if the task is different.
Q: Is the 0.3x Credits consumption multiplier for the Auto tier a fixed charge?
0.3x is a reference consumption multiplier designed for the Auto tier based on aggregate usage, to help you estimate the approximate cost. Actual billing follows the model you are routed to. In other words, if you are routed to a cheaper model, you pay that model’s price. Auto will not make you pay more.
Q: If the Auto tier routes to different models, can the cache still be reused?
Routing under the Auto tier applies cache affinity. Under normal conditions, the model is not switched while the cache is still valid; a model is selected only when a new session joins and there is no cache affinity. So dynamic model selection in Auto does not create extra cost.
Read previous post:
Your Credits Go Further: Qoder Auto Cuts Per-Task Usage by 41%
-
-
Alibaba Cloud Community
1,610 posts | 526 followers
Follow
Comments
-
-
Alibaba Cloud Community
1,610 posts | 526 followers
Follow
Related Products
-
Token Plan
Build more, spend less. One plan, every modality.
Learn More -
Qoder
From Assisted to Autonomous — Adapting to Every Programming Need
Learn More -
Alibaba Cloud Model Studio
A one-stop generative AI platform to build intelligent applications that understand your business, based on Qwen model series such as Qwen-Max and other popular models
Learn More -
Qwen
Full-range, open-source, multimodal, and multi-functional
Learn More
More Posts by Alibaba Cloud Community
- Your Credits Go Further: Qoder Auto Cuts Per-Task Usage by 41%
- Qwen4-Max: One Flagship for Complex Work, at a Price That Scales
- Qwen4-Max at Work: Six Real-World Scenarios for an Always-On AI Teammate
- Alibaba Cloud Named a Leader in Gartner® Magic Quadrant for Container Management for Fourth Consecutive Year
- The Easiest Way to Try the Latest Models in One Place: Token Plan Starting at $3 for the First Month
- 一個平台輕鬆試用最新 AI 模型:Token Plan 首月低至 $3
- Alibaba Cloud Advances AI Adoption in Malaysia with Nationwide Youth Contest and Industry Collaborations
- Alibaba Cloud Unveils New AI Initiatives at Hong Kong Summit to Advance the City’s AI Ecosystem
- QoderWake: Digital Workers Take the Initiative — No Need to @ Every Time