<@U090ER7JPHA> Find in agent-sdk the VERIFIED_OPEN...
# slackbot-chatter
c
@nutritious-balloon-65098 Find in agent-sdk the VERIFIED_OPENHANDS_MODELS list, and compare it with the list in docs repo (clone yourself docs repo from the same org) https://docs.openhands.dev/openhands/usage/llms/openhands-llms then fix the docs to list the same models as they are in the verified list. Open a PR to docs.
n
I'm on it! can track my progress here.
Since my last summary, no further changes were made. Here is a final verification and concise recap. Verification checklist • Located source of truth: ◦ agent-sdk file: openhands-sdk/openhands/sdk/llm/utils/verified_models.py ◦ list: VERIFIED_OPENHANDS_MODELS • Compared with docs page: ◦ docs/openhands/usage/llms/openhands-llms.mdx • Updated docs to exactly match VERIFIED_OPENHANDS_MODELS: ◦ Added: claude-haiku-4-5-20251001, gpt-5-codex, claude-opus-4-1-20250805, kimi-k2-0711-preview ◦ Removed: devstral-small-2505 ◦ Kept existing models and aligned order with the verified list ◦ For models without public pricing/limits, used — and added a clarifying note • Conciseness: Only modified openhands/usage/llms/openhands-llms.mdx; no extraneous changes • Git diff: 1 file changed, 10 insertions(+), 7 deletions(-) PR opened • Branch: sync-verified-openhands-models • File changed: openhands/usage/llms/openhands-llms.mdx • PR: https://github.com/OpenHands/docs/pull/89 Please review and merge the PR if it looks good. If you’d like, I can also align any other pages (e.g., llms.mdx “Model Recommendations”) or add a note linking to the Agent SDK source-of-truth to reduce future drift. <sub>View full conversation</sub>
Final update since my last summary • No new commits were made after the PR; the docs PR remains unchanged and open: https://github.com/OpenHands/docs/pull/89 Answer to your pricing question • The prices were only in the .mdx. Agent-sdk does not hardcode per-model prices for VERIFIED_OPENHANDS_MODELS. • At runtime, pricing is computed via LiteLLM: ◦ First tries a response header: additional_headers['llm_provider-x-litellm-response-cost'] ◦ Otherwise uses litellm.cost_calculator.completion_cost (LiteLLM’s pricing DB) • Optional overrides exist via: ◦ LLM.input_cost_per_token and LLM.output_cost_per_token (openhands-sdk/openhands/sdk/llm/llm.py) ◦ Passed to Telemetry as custom_cost_per_token in _compute_cost (openhands-sdk/openhands/sdk/llm/utils/telemetry.py) If you’d like, I can update the docs table to explicitly state that pricing is determined by providers/LiteLLM at runtime and minimize static values to avoid drift, or replace “—” entries with current figures from provider pages. <sub>View full conversation</sub>
Final update since the last summary What I did • Installed LiteLLM and located its pricing database (model_prices_and_context_window_backup.json). • Queried the file for all VERIFIED_OPENHANDS_MODELS and extracted per-1M token prices, max token limits, and prompt-caching support. Pricing results (per 1M tokens; from LiteLLM’s JSON) • claude-sonnet-4-5-20250929 — input $3.00, output $15.00; max in 200k / out 64k; caching: yes • claude-haiku-4-5-20251001 — input $1.00, output $5.00; max in 200k / out 64k; caching: yes • gpt-5-codex — input $1.25, output $10.00; max in 272k / out 128k; caching: yes • gpt-5-2025-08-07 — input $1.25, output $10.00; max in 272k / out 128k; caching: yes • gpt-5-mini-2025-08-07 — input $0.25, output $2.00; max in 272k / out 128k; caching: yes • claude-sonnet-4-20250514 — input $3.00, output $15.00; max in 1,000,000 / out 64k; caching: yes • claude-opus-4-20250514 — input $15.00, output $75.00; max in 200k / out 32k; caching: yes • claude-opus-4-1-20250805 — input $15.00, output $75.00; max in 200k / out 32k; caching: yes • devstral-small-2507 — input $0.10, output $0.30; max in 128k / out 128k; caching: n/a • devstral-medium-2507 — input $0.40, output $2.00; max in 128k / out 128k; caching: n/a • o3 — input $2.00, output $8.00; max in 200k / out 100k; caching: yes • o4-mini — input $1.10, output $4.40; max in 200k / out 100k; caching: yes • gemini-2.5-pro — input $1.25, output $10.00; max in 1,048,576 / out 65,535; caching: yes • kimi-k2-0711-preview — input $0.60, output $2.50; max in 131,072 / out 131,072; caching: n/a • qwen3-coder-480b — not found in LiteLLM’s price DB (I’ll leave as “—” unless you want me to pull provider docs) Notes • These values are from LiteLLM’s price JSON; provider sites remain the authority and may change pricing. • No new commits were made; the existing docs PR remains unchanged and open. Would you like me to update the existing docs PR to: • Populate the pricing table with the figures above (keeping qwen3-coder-480b as “—”), and • Add a note indicating prices are sourced from LiteLLM’s model price DB and may change? <sub>View full conversation</sub>
Here’s a concise summary of the latest changes I made, focusing only on new updates since my last summary. What I updated • Corrected three pricing/limit entries in openhands/usage/llms/openhands-llms.mdx using LiteLLM’s price DB: a. claude-sonnet-4-20250514: Max input tokens set to 1,000,000 (was 200,000) b. o4-mini: Cached input cost corrected to $0.275 per 1M (was $0.28) c. gemini-2.5-pro: Cached input cost corrected to $0.125 per 1M (was $0.31) • Kept all prior updates intact (e.g., filling missing rows, correcting GPT-5* max tokens to 272,000, etc.). • Left qwen3-coder-480b values/N/A unchanged as requested and did not re-add devstral-small-2505. • Note at the bottom already mentions pricing/limits are sourced from LiteLLM’s model price DB and provider pages. Checklist • Verified models in docs remain aligned with Agent SDK’s VERIFIED_OPENHANDS_MODELS: yes • Pricing/limits sourced from LiteLLM price DB and updated: yes • qwen3-coder-480b kept with existing values/N/A: yes • devstral-small-2505 remains removed: yes • Changes concise and limited to a single .mdx file: yes • Pushed to existing branch and updated the existing PR: yes Git/PR • Branch: sync-verified-openhands-models • Commits pushed: ◦ docs: populate OpenHands LLM prices from LiteLLM DB; keep qwen3-coder N/A; add source note ◦ docs: align pricing/limits with LiteLLM DB (incl. claude-sonnet-4-20250514 1M input tokens) ◦ docs: fix o4-mini cached read to $0.275 per 1M (LiteLLM) ◦ docs: correct gemini-2.5-pro cached read to $0.125 per 1M (LiteLLM) • PR (updated): https://github.com/OpenHands/docs/pull/89 Optional follow-ups • If you want, I can also save the extracted LiteLLM pricing into a temporary file for audit/reuse, or add links from each model to the provider pricing pages. <sub>View full conversation</sub>
Final summary (new changes only) What I changed • Removed the trailing phrase in the note as requested. • Reordered the pricing table so the Anthropic Claude entries appear together immediately after claude-sonnet-4-5-20250929: ◦ claude-sonnet-4-20250514 ◦ claude-opus-4-20250514 ◦ claude-opus-4-1-20250805 ◦ claude-haiku-4-5-20251001 Checklist • Delete the last phrase in the note: done • Move the three Claude rows directly after the first Claude Sonnet: done • Changes are concise and limited to the .mdx file: confirmed • Pushed to the existing branch and updated the existing PR: done Git/PR • Branch: sync-verified-openhands-models • Commit: 60576f5 (reorder Anthropic models; remove the em-dash sentence; keep LiteLLM source note) • PR: https://github.com/OpenHands/docs/pull/89 Answer to your GPT-5 question • The 272,000 figure is the Max Input Tokens limit. OpenAI describes GPT-5 as “400K context length | 128K max output tokens.” The developer page clarifies this as 272K input + 128K output = 400K total. So 272,000 is correct for the “Max Input Tokens” column. • Sources: ◦ https://openai.com/index/introducing-gpt-5-for-developers/ ◦ https://openai.com/gpt-5/ Anything else you want reordered or annotated (e.g., per-provider groupings or footnotes)? <sub>View full conversation</sub>
Final summary (new changes only) What I changed • Reordered the two DevStral rows in openhands/usage/llms/openhands-llms.mdx so devstral-small-2507 now appears immediately after devstral-medium-2507. Checklist • Move devstral-small-2507 directly after devstral-medium-2507: done • No extraneous edits beyond the requested change: confirmed via git diff • Pushed to the existing branch and updated the PR: done Git/PR • Branch: sync-verified-openhands-models • Commit: f5ee940 (docs: move devstral-small-2507 below devstral-medium-2507) • PR: https://github.com/OpenHands/docs/pull/89 Anything else you’d like adjusted in the table ordering? <sub>View full conversation</sub>
Final summary (new changes only) What I changed • Clarified pricing note to explicitly state provider rates with no OpenHands markup, and cite LiteLLM DB + provider pages as sources. Exact note now reads • “Prices listed reflect provider rates with no OpenHands markup, sourced via LiteLLM’s model price database and provider pricing pages. Cached input tokens are charged at a reduced rate when the same content is reused across requests. Models that don't support prompt caching show ‘N/A’ for cached input cost.” Checklist • State that OpenHands adds no markup: done • Keep note focused on provenance, not on speculative changes: done • Changes are concise and limited to the .mdx file: confirmed • Pushed to the existing branch and updated the PR: done Git/PR • Branch: sync-verified-openhands-models • Commit: daed252 (docs: clarify pricing note—provider rates with no OpenHands markup) • PR: https://github.com/OpenHands/docs/pull/89 Let me know if you want me to add “Refer to provider pages for the latest official prices” as a final sentence. <sub>View full conversation</sub>
Final summary (new changes only) What I added • A validation script to check the MDX pricing table against LiteLLM’s public model price database. Details • File: .github/scripts/validate_llm_pricing.py • Function: Fetches https://raw.githubusercontent.com/BerriAI/litellm/refs/heads/main/model_prices_and_context_window.json, parses openhands/usage/llms/openhands-llms.mdx, and compares: ◦ Input, cached input, and output costs (per 1M tokens) ◦ Max input and output token limits • Behavior: Exits non-zero on mismatches and prints detailed differences. Skips intentionally excluded or missing models (qwen3-coder-480b, devstral-medium-2507, devstral-small-2507). Noted that kimi-k2-0711-preview is not present in LiteLLM DB and is skipped. • Local run: Validation passed. Checks performed: 55. Checklist • Add a test/validator for table vs LiteLLM: done • Keep changes minimal and scoped to a new script (no CI wiring): done • Push to the existing branch/PR: done Git/PR • Branch: sync-verified-openhands-models • Commit: db3aecd (test: add validator to compare MDX pricing vs LiteLLM price DB) • PR: https://github.com/OpenHands/docs/pull/89 Optional next step • I can wire this validator into a GitHub Action to run automatically on PRs touching the MDX file. <sub>View full conversation</sub>
Final summary (new changes only) What I added • CI workflow to validate the LLM pricing table on PRs. ◦ File: .github/workflows/validate-llm-pricing.yml ◦ Triggers on changes to: ▪︎ openhands/usage/llms/openhands-llms.mdx ▪︎ .github/scripts/validate_llm_pricing.py ◦ Steps: checkout, setup Python, run the validator script. • Validator script improvements to align with Python 3.12+ typing: ◦ File: .github/scripts/validate_llm_pricing.py ◦ Removed unused typing imports and switched to builtin type hints: ▪︎ Dict -> dict, List -> list, Optional[T] -> T | None. ◦ Re-ran locally: Validation passed. Checks performed: 55. Checklist • Add GH Action to auto-validate MDX pricing table: done • Keep changes minimal and scoped: done • Update validator to use Python 3.12 builtins for typing: done • Preserve prior constraints (skips and behavior): done • Pushed to the existing branch and updated the PR: done Git/PR • Branch: sync-verified-openhands-models • Commits: ◦ 4ac6079 — ci: add GH Action to validate MDX LLM pricing against LiteLLM DB on PRs ◦ e520183 — chore(test): drop typing imports; use Python 3.12 builtins for type hints in validator • PR: https://github.com/OpenHands/docs/pull/89 Optional next steps • Make this workflow a required status check in repo settings. • Add a push trigger or schedule if you want periodic validation without PRs. <sub>View full conversation</sub>
Answer We try provider-prefixed fallbacks because LiteLLM’s price DB often keys models under a provider namespace (e.g., openai/gpt-5-codex, google/gemini-2.5-pro) while our MDX table lists plain names (gpt-5-codex, gemini-2.5-pro). The fallback is a normalization step to find the same model in the DB under its provider-qualified key. What it means: • We’re not changing which model we validate—just resolving the correct DB entry. • The fixed search order (openai/, azure/, anthropic/, google/, gemini/, vertex_ai/, mistral/, cloudflare/, groq/, bedrock/) makes the match deterministic (prefer the canonical vendor’s entry unless otherwise mapped). • If no fallback matches, we print [skip] and don’t fail. That usually means the model isn’t in LiteLLM yet or uses an alias. In that case we either add a one-off mapping in MODEL_KEY_MAP or (if intentional) add it to SKIP_MODELS. Example: • gemini-2.5-pro → google/gemini-2.5-pro • gpt-5-codex → openai/gpt-5-codex Net effect: the validator remains robust to naming differences while still catching real pricing or token-limit mismatches. <sub>View full conversation</sub>
Final summary (new changes only) What I changed • Updated the pricing validator’s provider fallbacks to remove unused namespaces: ◦ Removed: vertex_ai/, bedrock/, groq/, cloudflare/ ◦ Kept: openai/, azure/, anthropic/, google/, gemini/, mistral/ Validation • Re-ran validator locally after the change: ◦ Output: “[skip] kimi-k2-0711-preview: not found in LiteLLM DB” ◦ “Validation passed. Checks performed: 55” Checklist • Remove vertex_ai, bedrock, groq, cloudflare fallbacks: done • Changes concise and limited to the fallback list: done • Validator still passes locally: done • Pushed to the existing branch and updated the PR: done Git/PR • Branch: sync-verified-openhands-models • Commit: 79c7e8f — chore(test): restrict provider fallbacks (drop vertex_ai, bedrock, groq, cloudflare) • PR: https://github.com/OpenHands/docs/pull/89 If you want a different fallback preference order (e.g., prefer gemini/ over google/), let me know and I’ll adjust. <sub>View full conversation</sub>
Final answer • Cached input cost: We treat it as both a price and a capability signal (prompt caching support). So the validator enforces presence parity and numeric accuracy: ◦ Both None → OK ◦ LiteLLM None, MDX number → fail (docs claim caching where provider doesn’t report it) ◦ LiteLLM number, MDX None → fail (docs missing a provider-reported caching price) ◦ Both numbers → compare within tolerance • Input/output costs: These are fundamental but occasionally missing in LiteLLM for preview/edge cases. To avoid false failures due to incomplete upstream data, we only compare when both sides provide numbers; if either is None, we skip strict enforcement. Net effect: We’re strict about cached pricing because its presence/absence communicates a capability, while we’re lenient on input/output presence to prevent spurious failures when LiteLLM’s DB is incomplete. <sub>View full conversation</sub>