How to Measure Prompt Cache Hit Rate to See How Much Repeated Work the Cache Actually Saves
Record cache read and write tokens from each response, divide read tokens by total input tokens, and move the breakpoint when the…
WORKFLOW TAG
Check what fits in the input and output context for your model.
Record cache read and write tokens from each response, divide read tokens by total input tokens, and move the breakpoint when the…
Validate the called name against your function registry before running anything, return a clear error to the model, and ask it to…
List every field the function cannot run without in required, test with a missing field, and reject the call when one is…
Define the outer object, nest an object or a list of objects inside it, mark the required fields, and validate a sample…
List the allowed values in an enum in the schema, test with a value outside the list, and confirm the model returns…
Decide in advance what to drop when a request overflows, truncate the oldest turns or summarize the middle, and never silently cut…
Encode the exact request text with the model encoding, compare the count with the context limit, and trim the prompt before sending…
Work out the image token count from the size and detail level, add it to the text tokens, and resize the image…
Run the same long-document task on both attention types, score the answers at increasing lengths, and note where the sliding window starts…
Pick a cache type that matches the conversation length, know when older tokens are evicted, and check the answers stay correct as…