Token-checked LLM call
If the prompt is over the budget, the pipeline stops and the model never sees a prompt that only half fits. Count the tokens in a prompt and stop the ...
tag
7 posts tagged #tok
If the prompt is over the budget, the pipeline stops and the model never sees a prompt that only half fits. Count the tokens in a prompt and stop the ...
You see which files are too big for your context window before you paste them into a prompt. Count the tokens in every source file and list the ...
If the page is too long, the pipeline stops before the API call, so you do not pay for a request that cannot fit. Fetch a web page as markdown, check ...
A diff that is too big fails fast and cheap, instead of being cut off halfway through the review. Check the token count of a git diff, then send it ...
The counter refuses the call once the daily limit is reached, so a runaway loop cannot use up your API budget. Add each prompt's token count to a kv ...
throttle releases filenames at a fixed rate, so each API call stays inside the rate limit. Process a large set of documents at a fixed request rate, ...
If an agent handles user data, mask it first, so secrets never reach the LLM or the kv store. Mask secrets, check the token budget, call the LLM, and ...