You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using BYOK custom models routed through a LiteLLM proxy (v1.81.15), the context usage indicator in the CLI status bar always shows <1% regardless of actual context consumption. The /cost command also shows Input: 0 tokens (related to #157).
Environment
Droid CLI: v0.81.0
macOS (arm64)
BYOK config: provider: "anthropic" pointing to a LiteLLM proxy backed by Azure/Bedrock
LiteLLM version: 1.81.15
Models affected: All custom BYOK models (both Anthropic and OpenAI provider types)
showTokenUsageIndicator: true in settings.json
Steps to Reproduce
Configure a BYOK model with provider: "anthropic" pointing to a LiteLLM proxy
Start a droid session using the custom model
Run several prompts that consume meaningful context
Observe the context usage indicator -- always shows <1%
Run /cost -- input tokens show as 0
Investigation: The proxy IS returning correct usage data
I tested the LiteLLM proxy directly with curl and confirmed all token usage fields are correctly populated in every response path:
Streaming with extended thinking: Also returns correct input_tokens and output_tokens.
All Anthropic SSE event types (message_start, message_delta, message_stop) contain properly structured usage data. The proxy is fully compliant with the Anthropic streaming format.
Likely Root Causes
Context window size unknown for custom models: The proxy's /v1/models endpoint returns minimal metadata (no max_tokens or context_window field). Droid likely computes context % as input_tokens / context_window_size, and without knowing the context window for a custom model, it may default to 0 or an extremely large value, yielding <1%.
Token accumulation not working for BYOK streaming: Even though usage data is present in streaming events, Droid may not be parsing/accumulating input_tokens from the message_start event for BYOK provider models (per [Bug] /cost only shows partial token counts when using BYOK models #157).
Expected Behavior
Context usage indicator should reflect actual token consumption as a percentage of the model's context window
For BYOK models where context window is unknown, Droid could either:
Allow users to specify context_window in the BYOK config
Use a sensible default based on the model name (e.g., claude-* → 200K)
Fall back to showing raw token count instead of a percentage
Description
When using BYOK custom models routed through a LiteLLM proxy (v1.81.15), the context usage indicator in the CLI status bar always shows
<1%regardless of actual context consumption. The/costcommand also showsInput: 0 tokens(related to #157).Environment
provider: "anthropic"pointing to a LiteLLM proxy backed by Azure/BedrockshowTokenUsageIndicator: truein settings.jsonSteps to Reproduce
provider: "anthropic"pointing to a LiteLLM proxy<1%/cost-- input tokens show as 0Investigation: The proxy IS returning correct usage data
I tested the LiteLLM proxy directly with curl and confirmed all token usage fields are correctly populated in every response path:
Non-streaming:
Streaming (message_start event):
Streaming (message_delta event):
Streaming (message_stop event):
Streaming with extended thinking: Also returns correct
input_tokensandoutput_tokens.All Anthropic SSE event types (
message_start,message_delta,message_stop) contain properly structured usage data. The proxy is fully compliant with the Anthropic streaming format.Likely Root Causes
Context window size unknown for custom models: The proxy's
/v1/modelsendpoint returns minimal metadata (nomax_tokensorcontext_windowfield). Droid likely computes context % asinput_tokens / context_window_size, and without knowing the context window for a custom model, it may default to 0 or an extremely large value, yielding<1%.Token accumulation not working for BYOK streaming: Even though usage data is present in streaming events, Droid may not be parsing/accumulating
input_tokensfrom themessage_startevent for BYOK provider models (per [Bug] /cost only shows partial token counts when using BYOK models #157).Expected Behavior
context_windowin the BYOK configclaude-*→ 200K)Related
/costshows partial token counts for BYOK models)