New Open-Source LLM Preview: A Guide to Version Selection and Cost-Saving with Caching
This article explores strategies for optimizing costs when using the new preview versions of open-source large language models (LLMs). It covers the functional differences between the Pro and Flash versions, how to implement request routing for cost control, and a detailed breakdown of token-based pricing. Additionally, it explains the principles of context caching, provides best practices for maximizing cache hit rates, and offers architectural recommendations for enterprise deployment.
1. Version Differentiation: The Starting Point for Cost Control
The new preview of the open-source LLM is available in two specifications: Pro and Flash. The difference lies in the trade-off between capability and cost. The Pro version is designed for complex reasoning tasks, such as extensive code generation, multi-step logical deduction, and mathematical calculations. These tasks require high model capability and have a relatively higher tolerance for latency. The Flash version targets high-frequency, short-output scenarios, such as intent recognition, text classification, information extraction, and simple multi-turn conversations. Its focus is on response speed and concurrent throughput.
The practical value of version differentiation lies in routing. Developers can place a decision layer at the request entry point to first evaluate the request’s difficulty and then decide which version should handle it. This decision layer can be a rule engine or a small model performing intent recognition. For example, requests containing keywords like “prove,” “deduce,” or “multi-file refactor” are routed to the Pro version, while the rest go to the Flash version. After the routing rules go live, you should sample real traffic to check the response quality and user satisfaction of both versions, avoiding mistakenly routing requests meant for Pro to Flash.
2. Understanding Token-Based Pricing
LLMs typically charge separately for input and output tokens. The preview prices disclosed in the original text are: Flash version at approximately 1 RMB/Million tokens for input and 2 RMB/Million tokens for output; Pro version at approximately 12 RMB/Million tokens for input and 24 RMB/Million tokens for output. These figures come from the preview announcement, and the exact units and billing criteria must be verified against the current pricing page on the official website. Preview prices may be adjusted and could differ from the official release.
When estimating the cost of a single API call, you can use the following formula:
Total Cost = Uncached Input Tokens × Uncached Price + Cached Input Tokens × Cached Price + Output Tokens × Output Price
Take a customer service system processing one million requests per day as an example. Assume each request averages 2,000 input tokens, of which 1,500 are a fixed prefix and 500 are dynamic content, with an average of 200 output tokens. Based on the disclosed Flash version pricing, if the prefix fully hits the cache, the cost per request is about 0.0012 RMB; if the prefix entirely misses the cache, the cost per request is about 0.0024 RMB. Calculated over one million daily requests, the totals would be approximately 1,200 RMB and 2,400 RMB, respectively. These are illustrative values; actual costs must be recalculated using your own billing and traffic data.
3. Principles and Boundaries of Context Caching
When processing input, the LLM calculates the Prompt into a KV Cache (Key-Value Cache) used for attention computation. If the prefixes of two requests are exactly identical, the inference service can reuse the previously computed partial results, reducing redundant calculations. The prerequisite for a cache hit is that the prefix matches exactly and the cache has not expired or been evicted.
This means the benefit of caching depends on several conditions:
- The prefix must match word-for-word, including spaces and line breaks.
- The cache usually has a Time-to-Live (TTL) and capacity limit; high-frequency prefixes are more likely to be retained.
- Caches between different tenants must be isolated to prevent one customer’s content from being reused by another.
- Specific caching rules are determined by the service provider. Developers should rely on official documentation and empirical testing rather than assuming a hit based solely on principles.
Regarding price differences, the original text notes that the high-performance version offers a larger discount for cache hits. One explanation is that larger models consume more computing power for prefix computation, making the benefits of reusing the cache more pronounced. Another possibility is a deliberate pricing strategy. Both explanations require support from official statements and cannot be inferred simply from parameter size.
4. Best Practices for Improving Cache Hit Rates
- Fix System Prompts. Place role definitions, tool calling instructions, and few-shot examples at the very beginning of the Prompt and keep the text exactly consistent. Any modifications to these should be managed as version updates rather than dynamically spliced at runtime.
- Standardize Multi-Turn Conversation History. Historical messages should be appended in a fixed order and format. Avoid inserting, deleting, or rewriting existing turns in the middle. This allows previous turns to continue hitting the cache, requiring incremental computation only for the new round.
- Place Dynamic Information at the End. Fields like current time, random UUIDs, user IDs, and request tracking numbers make the prefix different for every request. If the model truly needs this information, place it at the end of the Prompt. If it is only for logging purposes, record it in request headers or server logs instead of splicing it into the Prompt.
- Be Mindful of Sensitive Information. The premise of cache reuse is that the content can be shared. Content containing personal information, API keys, or other sensitive data should not be placed in a reusable prefix to avoid data isolation issues.
- Establish Cache Hit Rate Monitoring. Record the input tokens, cached tokens, and output tokens for each request, and calculate the daily hit rate. If the hit rate continuously declines, check whether the system prompt was recently modified or if dynamic fields were introduced.
5. Architectural Considerations for Enterprise Deployment
At a large scale, the main challenges typically involve high availability of the inference service, elastic auto-scaling, and cache scheduling. Developers can evaluate three approaches: directly calling the official API (where the service provider handles inference and caching); deploying the open-source model weights on your own GPU cluster or container platform (managing the inference engine and cache yourself); or a hybrid approach (routing peak traffic to the cloud API while keeping stable traffic on your own cluster).
Each approach has a different cost structure. The official API bills per token and has low operational overhead, but data must pass through a third-party service and is subject to the provider’s quotas and price adjustments. Self-hosted deployment offers better control over data and latency but requires you to bear the costs of GPU procurement or rental, inference service tuning, and maintenance. When choosing, consider data compliance requirements, peak concurrency, team capabilities, and Total Cost of Ownership (TCO).
Regardless of the approach, stress testing should be completed before going live to verify latency, error rates, and cache hit rates under target concurrency. Concurrently, assess data security and compliance requirements to clarify which data can be sent to external models.
6. Conclusion and Actionable Recommendations
The value of the preview model lies in providing finer choices for different tasks. The division between Pro and Flash allows developers to allocate computing power based on task difficulty, while the caching mechanism reduces the cost of repetitive prefixes—provided the Prompt structure remains stable.
It is recommended to proceed in the following order: first, use real business data to analyze the prefix stability of existing Prompts; second, use the formula above to estimate costs for both versions; third, conduct a small-traffic routing experiment to compare quality and cost; finally, gradually expand the scope supported by billing and hit rate monitoring. Prices, caching rules, and model capabilities may change upon the official release, so your plans should allow room for adjustments.
