Commit 142bd62
committed
feat(misc): add token counting and context window management notebook
Techniques for managing Claude's 200k token context window: pre-call
token counting via count_tokens API, ConversationTracker for running
totals, sliding-window truncation that preserves system prompt and
last user message, extended thinking budget configuration, cache token
usage via response.usage, and CostEstimator for per-model cost tracking.1 parent 34022c5 commit 142bd62
1 file changed
Lines changed: 805 additions & 0 deletions
0 commit comments