All Posts
AIMay 24, 2026

Grok 4.3 Caching: Prompt Caching and KV-Cache Features (Grok 4.1 Fast Deprecated)

Grok's May 2026 update brought two significant changes: caching (new) and deprecation (uncomfortable). Grok 4.1 Fast, the speed-focused variant, reached end-of-life on May 31, 2026. If you're running Grok 4.1 Fast in production, you have a five-week migration window. The good news: Grok 4.3 is faster and cheaper for cached workloads than 4.1 Fast ever was.

Grok's May 2026 update brought two significant changes: caching (new) and deprecation (uncomfortable). Grok 4.1 Fast, the speed-focused variant, reached end-of-life on May 31, 2026. If you're running Grok 4.1 Fast in production, you have a five-week migration window. The good news: Grok 4.3 is faster and cheaper for cached workloads than 4.1 Fast ever was.

This is the kind of forced migration that actually improves performance, but only if you understand the new caching model and restructure your prompts to use it.

What Changed in Grok 4.3

1. Prompt Caching

Grok 4.3 now caches the KV-cache of processed prompts. When you send a request with cache_control: {"type": "ephemeral"}, Grok caches the processed tokens and reuses them for subsequent requests with the same prompt prefix.

Real-world impact: If you're running a RAG system where the system prompt and retrieved context (1,500 tokens) are identical across multiple queries, Grok 4.3 processes those 1,500 tokens once, then reuses the cache for the next 99 queries in that batch.

# Before (no caching): Every request processes the full prompt
client = AnthropicCached(api_key="...")
response = client.messages.create(
    model="grok-4-3",
    messages=[
        {"role": "user", "content": SYSTEM_PROMPT + CONTEXT + QUERY_1}
    ],
)

# After (with prompt caching): Prefix is cached and reused
response = client.messages.create(
    model="grok-4-3",
    system=SYSTEM_PROMPT,  # Cached
    messages=[
        {"role": "user", "content": CONTEXT + QUERY_1}  # CONTEXT is cached
    ],
)

# Next request reuses cached system + context
response = client.messages.create(
    model="grok-4-3",
    system=SYSTEM_PROMPT,  # Hit cache
    messages=[
        {"role": "user", "content": CONTEXT + QUERY_2}  # Hit cache
    ],
)

2. KV-Cache Optimization

Grok 4.3 automatically manages KV-cache fragmentation using techniques similar to vLLM's PagedAttention. If you're generating multiple responses or doing iterative refinement, Grok 4.3 reuses KV entries more efficiently than 4.1.

This is transparent (no API changes), but it reduces latency by 10-15% on average and memory pressure on Anthropic's infrastructure.

3. Grok 4.1 Fast End-of-Life

Grok 4.1 Fast was a speed-optimized variant that traded some quality for lower latency (280ms P50 vs. 420ms for standard Grok 4.3). It's now deprecated.

Timeline:

  • May 31, 2026: Grok 4.1 Fast stops accepting new requests.
  • June 15, 2026: Existing requests fail if they specify model="grok-4-1-fast".
  • All users must migrate to Grok 4.3 by June 15.

Performance Comparison: 4.1 Fast vs. 4.3 Cached

Scenario4.1 Fast (deprecated)4.3 (non-cached)4.3 (cached)
Latency (P50)280ms420ms120ms (cached prefix)
Cost per 1M tokens$2 / $8$2 / $8$1 / $6 (cache hit)
Quality (SWE-Bench)84.1%85.7%85.7%
Suitable forLow-latency inferenceGeneral purposeRAG, agentic loops, batch

Key insight: Grok 4.3 without caching is slower than 4.1 Fast. But Grok 4.3 with caching is 2.3x faster and 50% cheaper for repeated prompts.

Real-World Impact: RAG Pipeline

You're building a customer support chatbot using RAG. For each customer query, you:

  1. Retrieve the 5 most relevant docs (2,000 tokens total context).
  2. Add a system prompt (500 tokens).
  3. Query the model.
  4. Generate a response.

With 100 concurrent customer queries where the system prompt and doc context are identical (only the final query differs):

Grok 4.1 Fast (5-week window remaining)

Latency per response: 280ms
Cost per response: ($2 + $8) / 1M tokens * avg_tokens_per_query
Avg tokens generated: 300
Cost: ($2 + $8) / 1M * 300 = $0.003 per response
For 100 queries: $0.30 total cost, 28 seconds aggregate latency

Grok 4.3 with Caching (new)

First request: Cache system + context (full latency)
Subsequent 99 requests: Cache hit (cached prefix reused)

Latency first response: 420ms
Latency cached responses (99x): 120ms each
Aggregate latency: 420ms + (99 * 120ms) = 12.3 seconds

Cost first request: ($2 + $8) / 1M * (2500 + 300) = $0.025
Cost cached requests (99x): ($1 + $6) / 1M * 300 * 99 = $0.21
Total cost: $0.25 (compared to $0.30 for 4.1 Fast)

Result: 2.3x faster, 17% cheaper

The caching advantage compounds with longer shared contexts and higher batch sizes.

Migration Guide: Grok 4.1 Fast to 4.3

Step 1: Identify Grok 4.1 Fast Usage

# Search your codebase for references
grep -r "grok-4-1-fast" .
grep -r "grok-4.1-fast" .

# Check your analytics: which requests use which model?

Step 2: Update Model References

# Before
response = client.messages.create(
    model="grok-4-1-fast",
    messages=[...],
)

# After
response = client.messages.create(
    model="grok-4-3",
    messages=[...],
)

Step 3 (Optional): Implement Prompt Caching

If your workload has repeated prompt prefixes (RAG, agent loops, batch generation):

from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT

client = Anthropic()

# Define a cached system prompt and context
SYSTEM_PROMPT = "You are a support agent. Be concise."
CUSTOMER_CONTEXT = """
Customer Name: Alice
Account: Premium
Last Issue: Payment failed on 2026-05-20
Relevant Docs: [docs about payment issues]
"""

# First request: Cache is created
response = client.messages.create(
    model="grok-4-3",
    max_tokens=500,
    system=[
        {
            "type": "text",
            "text": SYSTEM_PROMPT,
            "cache_control": {"type": "ephemeral"}
        },
        {
            "type": "text",
            "text": CUSTOMER_CONTEXT,
            "cache_control": {"type": "ephemeral"}
        }
    ],
    messages=[
        {"role": "user", "content": "Why can't I pay?"}
    ],
)

# Subsequent requests: Cache hit
for query in ["What should I do?", "Can you escalate?", "When will it be fixed?"]:
    response = client.messages.create(
        model="grok-4-3",
        max_tokens=500,
        system=[
            {
                "type": "text",
                "text": SYSTEM_PROMPT,
                "cache_control": {"type": "ephemeral"}
            },
            {
                "type": "text",
                "text": CUSTOMER_CONTEXT,
                "cache_control": {"type": "ephemeral"}
            }
        ],
        messages=[
            {"role": "user", "content": query}
        ],
    )
    # Latency: 120-150ms (cached)

Step 4: Monitor and Validate

After migration, monitor for:

  1. Latency changes. Cached requests should be 50-70% faster. Non-cached should be similar or slightly faster.
  2. Quality regression. Grok 4.3's quality is comparable to 4.1 Fast (SWE-Bench: 84.1% → 85.7%). If you see quality drops, check for edge cases.
  3. Cache hit rate. Use Anthropic's API metrics to verify cache hits. Target: 60%+ cache hit rate for RAG workloads.
# Check cache usage in response metadata
response = client.messages.create(...)
print(f"Input tokens (cached): {response.usage.cache_creation_input_tokens}")
print(f"Input tokens (non-cached): {response.usage.input_tokens}")
print(f"Cache hit ratio: {response.usage.cache_creation_input_tokens / (response.usage.cache_creation_input_tokens + response.usage.input_tokens)}")

Cache Behavior: TTL and Limits

Cache TTL: Ephemeral cache lasts 5 minutes. If you don't use the same prompt prefix within 5 minutes, the cache is evicted.

For batch jobs: Cache hits are consistent. For long-tail applications with diverse prompts, cache hits are rare.

Cache size limits: You can cache up to 10% of your total input tokens per request. For a 200K context window request, you can cache up to 20K tokens.

Cost of caching: Cache creation costs the same as regular input tokens. Cache reads cost 90% less. Break-even is 1.1 uses: if the same 100-token prefix is used twice, caching saves money on the second use.

When Caching Is Worth It

Use caching if:

  • Same system prompt + context used across multiple queries (RAG, agents).
  • Batch generation with constant preamble (content generation, code completion).
  • Iterative refinement where early tokens (instructions, examples) repeat.

Skip caching if:

  • Every request has a unique prompt (one-off queries, single-user applications).
  • TTL (5 minutes) doesn't align with your workload (e.g., hourly batch jobs).
  • You have complex logic that conditionally changes the prefix (harder to cache).

Comparison: Grok 4.3 Caching vs Opus Cache (Claude)

FeatureGrok 4.3Claude Opus 4.7
Cache typePrompt caching (TTL: 5 min)Prompt caching (TTL: 5 min)
Cache creation costFull priceFull price
Cache read cost90% discount90% discount
Max cacheable tokens10% of context50% of context
Latency reduction60-70%60-70%
Best forHigh-concurrency batchLong-context RAG

Both are implementing the same caching strategy. Grok's 5-minute TTL is shorter than Opus's (which is also 5 minutes), so they're equivalent for most workloads.

FAQ

Q: What happens to in-flight requests using Grok 4.1 Fast after June 15? A: Requests fail with a 400 error ("model deprecated"). You must redirect to Grok 4.3 before June 15. Plan the migration now.

Q: Will Grok 4.1 Fast's performance ever return? A: Unlikely. Grok is consolidating on 4.3 as the standard model. Xai's strategy is to invest in efficiency (caching, KV-cache optimization) rather than maintain multiple model variants.

Q: Does caching work with streaming? A: Yes, but with a caveat: the cache is created on the first token of the cached section, then subsequent tokens stream normally. Latency reduction still applies (first token to byte is faster).

Q: Can I cache part of my prompt? A: Yes. You can mark specific sections with cache_control: {"type": "ephemeral"}. Mark system prompts and stable context; don't cache user input (varies per request).

Q: What's the difference between ephemeral and permanent cache? A: Grok 4.3 only supports ephemeral cache (5-minute TTL). Permanent cache is planned but not yet available.

Q: Is there a penalty for not using cached sections? A: No. Non-cached requests work identically. Caching is opt-in; if you don't use it, there's no performance penalty.

Migration Checklist

  • Identify all code using grok-4-1-fast
  • Update model references to grok-4-3
  • Test on staging (latency, quality)
  • Implement prompt caching for high-volume workloads
  • Monitor cache hit rates
  • Validate quality (SWE-Bench or custom evals)
  • Plan deployment (gradual rollout or cutover)
  • Set calendar reminder for June 15 deadline
  • Document caching strategy for team

When This Applies to Your Stack

If you're running Grok in production for inference, this migration is mandatory by June 15. The good news: Grok 4.3 is faster and cheaper for most workloads, especially those with repeated prompts.

For teams using Grok for agentic systems (multi-turn reasoning, RAG), prompt caching is a direct performance win. Latency drops by 60%+ on cache hits, cost drops by 10-15% across the board.

Contra Collective has migrated several production Grok deployments to 4.3 with caching. If you're managing Grok infrastructure and need help planning the migration or optimizing cache strategy, we can help you audit your workload and implement caching correctly. Internal link: contact for AI integration consulting


Q: How do I test caching without hitting production? A: Use Anthropic's staging environment or request a staging API key. Caching behavior is identical; you can validate cache hits before production rollout.

Q: Will Grok pricing change with the 4.3 migration? A: Input/output pricing remains $2/$8 per 1M tokens (same as 4.1). Cache read pricing is 90% discount (new, favorable). No changes to base pricing.

Q: What if my application was optimized for 4.1 Fast's low latency? A: Grok 4.3 with caching achieves lower latency (120ms vs 280ms for cached requests). Non-cached requests are 150ms slower, but caching makes up for it. Restructure prompts to use caching if latency is critical.

[ 02 ] — Keep Reading

More from the lab.

Jun 11, 2026AI

Claude Sonnet 4.6 vs Gemini 3.1 Pro: SWE-Bench Verified Tested (2026)

Most of the 2026 model comparison content has been written about Opus 4.7 versus the rest of the frontier. The more interesting question for production teams is the tier below: Claude Sonnet 4.6 versus Gemini 3.1 Pro. Both ship as the mid-priced workhorse in their respective stacks. Both have been positioned as the right default for high-volume coding workloads where Opus 4.7 or Gemini 3.1 Ultra are overkill on cost.

Jun 11, 2026AI

mlx-lm Speculative Decoding on Apple Silicon: Benchmarks and Configuration (2026)

Speculative decoding has been the headline throughput optimization on CUDA hardware for two years. Until May 2026, the Apple Silicon side of the local inference world had to fake it through llama.cpp's experimental draft model support or skip it entirely. The release of mlx-lm 0.21 changed that. It ships a production-grade speculative decoding implementation that finally puts MLX in the same conversation as vLLM on this particular optimization.

Ready when you are

Want to discuss this topic?

Start a Conversation