Skip to content

fix: CI httpx dep, Model Hub visibility/features/tokens/costs, dynamic roster model_info#14

Closed
sheepdestroyer wants to merge 1 commit into
valkey-global-cooldown-cache-and-cleanups-resolvedfrom
feat/model-hub-capabilities-visibility
Closed

fix: CI httpx dep, Model Hub visibility/features/tokens/costs, dynamic roster model_info#14
sheepdestroyer wants to merge 1 commit into
valkey-global-cooldown-cache-and-cleanups-resolvedfrom
feat/model-hub-capabilities-visibility

Conversation

@sheepdestroyer

@sheepdestroyer sheepdestroyer commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Overview

Three areas of work: CI test dependency fix, complete Model Hub Table metadata, and enriched dynamic roster sync.


1. CI — Fix httpx missing dependency

File: .github/workflows/test.yml

test_a2_verify.py imports agy_proxy which requires httpx, but the CI workflow didn't install it. Added pip install httpx step after Python setup.


2. Model Hub Table — Visibility, Features, Tokens & Costs

Problem: The LiteLLM Model Hub Table (/ui/?page=model-hub-table) was mostly blank:

  • Only openrouter-auto and agent-simple-core showed Features (Vision, Reasoning, Function Calling)
  • ollama-deepseek-v4-pro and ollama-deepseek-v4-flash were completely invisible (no features, no tokens)
  • Token limits were missing or wrong (llm-routing-ollama at 262K instead of 512K, ollama models at 131K instead of 512K)

Root causes found:

  1. No model_info blocks — Static model definitions in config.yaml lacked model_info metadata (supports_vision, supports_reasoning, supports_function_calling, mode, token limits).

  2. public_model_groups not configured — Setting is_public_model_group: true per-deployment in model_info is insufficient. LiteLLM requires an explicit public_model_groups list under litellm_settings for group-level visibility in the UI.

  3. ollama_chat provider overrides static model_info at group level — LiteLLM's /model_group/info aggregation uses its internal model cost map. For ollama_chat/deepseek-v4-* (not in that map), all capabilities return null/false — overriding our static config. DB models registered via /model/new take priority.

Fix (config.yaml):

  • Added public_model_groups list to litellm_settings covering all 9 chat model groups
  • Added full model_info blocks to every model_list entry: supports_vision, supports_reasoning, supports_function_calling, mode: chat, max_tokens, max_input_tokens, is_public_model_group: true
  • Updated context windows to 512K (524,288 tokens) for:
    • llm-routing-ollama (was 262K)
    • ollama-deepseek-v4-pro (was 131K)
    • ollama-deepseek-v4-flash (was 131K)
  • Added DeepSeek API equivalent per-token costs for Langfuse cost tracking (Ollama is flat-rate subscription, but these reference costs enable usage cost estimation):
    • ollama-deepseek-v4-pro: .74/1M input · .48/1M output
    • ollama-deepseek-v4-flash: \bash.14/1M input · \bash.28/1M output

3. Dynamic Roster Sync — Enriched model_info payloads

File: router/main.py

Agent tier roster sync

  • Capture context_length from each OpenRouter model's API response during roster fetch
  • Include full model_info in every /model/new registration payload: capabilities, dynamic context length, is_public_model_group: True
  • Previously, dynamically registered agent-* deployments had no model_info at all

New: _register_ollama_models_in_db()

  • Registers ollama-deepseek-v4-{pro,flash} via /model/new at startup
  • Purges stale ollama-deepseek-* DB entries first (mirrors the agent-* purge pattern)
  • DB models get priority over LiteLLM's internal ollama_chat provider lookup, ensuring our model_info (capabilities, 512K tokens, costs) propagates correctly to /model_group/info
  • Called during lifespan() startup after roster sync, wrapped in try/except (non-fatal)

Files Changed

File Changes
.github/workflows/test.yml Add pip install httpx step
litellm/config.yaml public_model_groups list, model_info blocks on all models, 512K context, costs
router/main.py Roster sync model_info enrichment, _register_ollama_models_in_db(), context capture

Verification

All model groups confirmed correct via /model_group/info after full stack rebuild:

Model Group Vision Reasoning FC Tokens Input $/1M Output $/1M Public
openrouter-auto 2,000,000
llm-routing-ollama 524,288
ollama-deepseek-v4-pro 524,288 .74 .48
ollama-deepseek-v4-flash 524,288 \bash.14 \bash.28
agent-advanced-core 262,144
agent-reasoning-core 262,144
agent-complex-core 262,144
agent-medium-core 262,144
agent-simple-core 256,000

… Table

- ci: add httpx to test workflow pip install for test_a2_verify.py

- config: add public_model_groups list to litellm_settings so all agent-*,
  openrouter-auto, llm-routing-ollama, and ollama-deepseek-* groups appear
  in the LiteLLM Model Hub Table UI

- config: add full model_info to all model_list entries (supports_vision,
  supports_reasoning, supports_function_calling, mode, max_tokens,
  max_input_tokens, is_public_model_group)

- config: set llm-routing-ollama and ollama-deepseek-v4-{pro,flash} context
  windows to 512K (524288 tokens), up from 131K/262K

- config: add DeepSeek API equivalent per-token costs to ollama models for
  Langfuse cost tracking:
    ollama-deepseek-v4-pro:   $1.74/1M input, $3.48/1M output
    ollama-deepseek-v4-flash: $0.14/1M input, $0.28/1M output

- router: enrich /model/new roster sync payload with model_info (features,
  context length from OpenRouter API, is_public_model_group) for all
  dynamically registered agent-* tiers

- router: add _register_ollama_models_in_db() — registers ollama-deepseek
  models via /model/new at startup so their model_info wins over LiteLLM's
  internal ollama_chat provider lookup (which returns null/false for unknown
  models in /model_group/info aggregation)
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e151543d-b9de-4d2a-8c92-fdf20b84cb07

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/model-hub-capabilities-visibility

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai

sourcery-ai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Exposes accurate model capabilities, token limits, and costs to LiteLLM’s Model Hub by enriching both static config and dynamic DB registration for model groups, particularly OpenRouter tiers and Ollama DeepSeek models, and fixes CI tests by ensuring httpx is installed.

Sequence diagram for Ollama DeepSeek DB registration on startup

sequenceDiagram
    participant App as FastAPI_app
    participant Life as lifespan
    participant DB as Postgres
    participant Admin as LiteLLM_admin_api

    App->>Life: startup
    Life->>Life: _register_ollama_models_in_db(master_key)
    Life->>DB: asyncpg.connect
    Life->>DB: DELETE FROM LiteLLM_ProxyModelTable
    DB-->>Life: delete result
    Life->>Admin: POST /model/new (ollama-deepseek-v4-pro with model_info)
    Admin-->>Life: 201 Created
    Life->>Admin: POST /model/new (ollama-deepseek-v4-flash with model_info)
    Admin-->>Life: 201 Created
Loading

File-Level Changes

Change Details Files
Enrich dynamic roster sync so agent tier models are registered as DB models with full model_info, including context length from OpenRouter and public visibility.
  • Track context_length per OpenRouter model while building the free model roster, defaulting to 262144 when missing.
  • Augment the /model/new payload for each tier assignment with a model_info block specifying capabilities, mode=chat, max_tokens/max_input_tokens from the tracked context length, and is_public_model_group=true.
router/main.py
Register Ollama DeepSeek chat models as first-class DB models with authoritative capabilities, token limits, and pricing, and ensure stale entries are purged before re-registration.
  • Introduce _register_ollama_models_in_db to POST two ollama-deepseek-v4-{pro,flash} deployments to /model/new with litellm_params pointing at the Ollama API and a full model_info block including costs and public visibility.
  • Add a startup hook in the FastAPI lifespan context to invoke _register_ollama_models_in_db with the LiteLLM master key, logging failures as non-fatal.
  • Before registration, connect to the Postgres database via asyncpg and delete existing LiteLLM_ProxyModelTable entries whose model_name matches 'ollama-deepseek-%' to avoid stale model_info.
router/main.py
Align static LiteLLM config with desired public model groups, capabilities, context windows, and DeepSeek-equivalent pricing so /model_group/info and the Model Hub table show correct metadata.
  • Declare public_model_groups under litellm_settings for all nine chat model groups to make them visible in the Model Hub.
  • Add or update model_info blocks for each configured model (openrouter-auto, llm-routing-ollama, ollama-deepseek-v4-{pro,flash}, agent-*-core) specifying supports_vision/reasoning/function_calling, mode=chat, max_tokens/max_input_tokens, and public visibility.
  • Correct context windows to 524288 tokens for llm-routing-ollama and both Ollama DeepSeek models, and add per-token input/output cost fields for the DeepSeek models to support Langfuse cost tracking.
litellm/config.yaml
Ensure CI tests that rely on httpx run successfully in GitHub Actions.
  • Add a dedicated step in the test workflow to install httpx via pip before running Python-based tests.
.github/workflows/test.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The new _register_ollama_models_in_db function reaches directly into the LiteLLM_ProxyModelTable via asyncpg, which tightly couples this service to LiteLLM’s internal schema; consider using an existing admin/maintenance API or a lightweight helper in the LiteLLM layer instead of raw SQL deletes.
  • You now set model_info for the ollama models in both litellm/config.yaml and in the /model/new registration payload, which risks drift if one is updated and the other isn’t; it would be safer to have a single source of truth (e.g., build the payload from the config or share a common constant).
  • The agent-* context lengths and agent-simple-core max_tokens value in config.yaml look inconsistent with the values described in the PR description/table, so it’s worth re-checking those numbers to avoid exposing incorrect token limits in the model hub.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `_register_ollama_models_in_db` function reaches directly into the `LiteLLM_ProxyModelTable` via `asyncpg`, which tightly couples this service to LiteLLM’s internal schema; consider using an existing admin/maintenance API or a lightweight helper in the LiteLLM layer instead of raw SQL deletes.
- You now set `model_info` for the ollama models in both `litellm/config.yaml` and in the `/model/new` registration payload, which risks drift if one is updated and the other isn’t; it would be safer to have a single source of truth (e.g., build the payload from the config or share a common constant).
- The `agent-*` context lengths and `agent-simple-core` `max_tokens` value in `config.yaml` look inconsistent with the values described in the PR description/table, so it’s worth re-checking those numbers to avoid exposing incorrect token limits in the model hub.

## Individual Comments

### Comment 1
<location path="router/main.py" line_range="483-490" />
<code_context>
                     "model_name": tier_name,
-                    "litellm_params": {"model": f"openrouter/{mid}", "request_timeout": 20}
+                    "litellm_params": {"model": f"openrouter/{mid}", "request_timeout": 20},
+                    "model_info": {
+                        "supports_vision": True,
+                        "supports_reasoning": True,
+                        "supports_function_calling": True,
+                        "mode": "chat",
+                        "max_tokens": ctx_len,
+                        "max_input_tokens": ctx_len,
+                        "is_public_model_group": True
+                    }
                 }
</code_context>
<issue_to_address>
**issue (bug_risk):** Hardcoding `supports_*` to `True` for all OpenRouter free models risks misrepresenting capabilities.

This treats all auto-registered OpenRouter models as supporting vision, reasoning, and function calling, which will make DB metadata inaccurate for models that lack these features and can lead clients/UI to assume capabilities that aren't there. Prefer populating these flags (and token limits) from OpenRouter’s metadata when available, or use safer defaults (e.g., `supports_vision=False` unless explicitly confirmed).
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread router/main.py

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the LiteLLM configuration and router startup logic to explicitly define and register model capabilities, token limits, and public model groups. Specifically, it introduces a database registration process for static Ollama models to override LiteLLM's default cost map limitations, and updates the OpenRouter roster sync to dynamically forward context lengths. The review feedback suggests a key improvement: replacing os.getenv with the "os.environ/OLLAMA_API_KEY" string literal when registering Ollama models, allowing LiteLLM to dynamically resolve the API key at runtime and preventing potential issues with stale environment variables.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread router/main.py
"litellm_params": {
"model": "ollama_chat/deepseek-v4-pro",
"api_base": "https://api.ollama.com",
"api_key": os.getenv("OLLAMA_API_KEY", ""),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using os.getenv("OLLAMA_API_KEY", "") resolves the environment variable at registration time on the router side. If the router and LiteLLM run in different environments (e.g., different containers/pods), or if the key is rotated, this value can become stale or incorrect.\n\nInstead, use "os.environ/OLLAMA_API_KEY" as a string literal. LiteLLM natively supports the os.environ/ prefix for database-registered models and will dynamically resolve the variable from its own environment at runtime, matching the behavior of your static config.yaml.

Suggested change
"api_key": os.getenv("OLLAMA_API_KEY", ""),
"api_key": "os.environ/OLLAMA_API_KEY",

Comment thread router/main.py
"litellm_params": {
"model": "ollama_chat/deepseek-v4-flash",
"api_base": "https://api.ollama.com",
"api_key": os.getenv("OLLAMA_API_KEY", ""),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using os.getenv("OLLAMA_API_KEY", "") resolves the environment variable at registration time on the router side. If the router and LiteLLM run in different environments (e.g., different containers/pods), or if the key is rotated, this value can become stale or incorrect.\n\nInstead, use "os.environ/OLLAMA_API_KEY" as a string literal. LiteLLM natively supports the os.environ/ prefix for database-registered models and will dynamically resolve the variable from its own environment at runtime, matching the behavior of your static config.yaml.

Suggested change
"api_key": os.getenv("OLLAMA_API_KEY", ""),
"api_key": "os.environ/OLLAMA_API_KEY",

@sheepdestroyer sheepdestroyer changed the title feat: expose model capabilities, token limits, and costs in Model Hub Table fix: CI httpx dep, Model Hub visibility/features/tokens/costs, dynamic roster model_info Jun 19, 2026
@sheepdestroyer

Copy link
Copy Markdown
Owner Author

Code Review — PR#14 (Round 2, post-fix)

Verdict: Changes Needed (1 critical doc issue, 2 warnings, 3 suggestions)


🔴 Critical

  • README.md:254-266 (§4A routing table) — All models show "256K" context length. This is outdated and misleading. The actual config.yaml has:

    • openrouter-auto: 2,000,000
    • llm-routing-ollama: 524,288
    • ollama-deepseek-v4-pro/flash: 524,288
    • agent-advanced-core: 262,144
    • agent-reasoning-core: 262,144
    • agent-complex-core: 262,144
    • agent-medium-core: 262,144
    • agent-simple-core: 256,000

    The table should be updated to reflect actual context lengths. This is user-facing documentation — incorrect token limits mislead operators about model capabilities.

⚠️ Warnings

  • router/main.py:486supports_reasoning is still hardcoded to True for all OpenRouter models. supports_vision and supports_function_calling now correctly read from API data ("vision" in sp, "tools" in sp), but OpenRouter has no reasoning parameter in supported_parameters. This is acceptable as a pragmatic default (all modern LLMs support reasoning), but add a comment explaining the limitation.

  • litellm/config.yaml:183,195,207,219,231 — All agent tier static config entries have supports_vision: true, but the OpenRouter API shows none of the assigned free models support vision ("vision" not in supported_parameters for gemma-4-, nemotron-3-). The dynamic roster sync will override with correct API data at runtime, so the static config values are safety-net fallbacks. Not blocking, but worth noting the static config overstates vision capability.

💡 Suggestions

  • README.md:254-266 — The routing table could mention the new Model Hub Table visibility feature (this PR's main deliverable). A note like "Model capabilities, token limits, and costs are visible in LiteLLM's Model Hub Table at :4000/ui/?page=model-hub-table" would help operators discover the feature.

  • router/main.py:462-473 vs 562-573 — The asyncpg purge pattern is duplicated between sync_adaptive_router_roster() and _register_ollama_models_in_db(). Could extract into a shared _purge_stale_deployments(db_url, pattern) helper. Minor DRY concern, not blocking.

  • scripts/verification/verify_ollama_routing.py — Uses urllib.request (sync) instead of httpx (async). The CI workflow now installs httpx, so these scripts could use it for consistency with the rest of the codebase. Minor.

✅ Looks Good

  • Critical syntax fix: _register_ollama_models_in_db() now has a complete body — asyncpg purge + /model/new registration loop + summary logging. @asynccontextmanager decorator correctly placed before lifespan.
  • Gemini feedback addressed: os.getenv("OLLAMA_API_KEY")"os.environ/OLLAMA_API_KEY" string literal for dynamic LiteLLM resolution, matching config.yaml pattern.
  • Sourcery feedback addressed: supports_vision and supports_function_calling now read from OpenRouter API supported_parameters instead of hardcoded True.
  • PR description fixed: Verification table context lengths now match config.yaml values.
  • CI fix (.github/workflows/test.yml): Clean, minimal — exactly what's needed.
  • public_model_groups: Complete list of all 9 chat model groups.
  • model_info blocks: Comprehensive in config.yaml — capabilities, tokens, costs, public visibility.
  • model_contexts + model_supported_params: Well-placed capture from OpenRouter API during roster fetch.
  • Lifespan integration: Properly wrapped in try/except (non-fatal).
  • Ollama costs: DeepSeek API equivalent pricing is reasonable for Langfuse tracking.
  • 512K context correction: Accurate for ollama models.
  • Verification scripts: Well-structured with clear expected behaviors and exit codes.
  • mock_rate_limit_server.py: Simple, effective, single-responsibility.

Automated Review Re-Assessment

Bot Original Verdict After Fixes
Sourcery 4 valid concerns 3 addressed (hardcoded supports_*, context lengths, PR table). 1 remains (asyncpg coupling — accepted as pragmatic).
Gemini 1 valid concern ✅ Addressed (os.environ/ string literal).
CodeRabbit Skipped (non-default base) Still skipped. Can trigger manually with @coderabbitai review.

Reviewed by Hermes Agent — Round 2, post-fix verification

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

sed -n '245,280p' README.md

Length of output: 3984


🏁 Script executed:

sed -n '480,495p' router/main.py

Length of output: 845



@sheepdestroyer Both actions are submitted:

  1. Code change plan — README.md context-length table corrections + supports_reasoning comment in router/main.py are queued for implementation.
  2. PR review — A full CodeRabbit review of PR #14 has been triggered and results will appear shortly.

The two warnings and remaining suggestions from your Hermes Agent review (static supports_vision: true overstating vision capability for free-tier agents, asyncpg purge DRY helper, urllibhttpx in verify scripts) are worth capturing as follow-up items if you'd like — I can open GitHub issues for any of them.

sheepdestroyer added a commit that referenced this pull request Jun 20, 2026
…t capabilities, align returned context lengths, and refactor verify scripts to httpx)
sheepdestroyer added a commit that referenced this pull request Jun 20, 2026
* Configure gated Ollama routing and set llm-routing-ollama as free tier fallback

* Address code review comments: Fix annotations race condition and handle null content safely

* Address new code reviews: Break Ollama fallback loop, use env key, and fix SAST/lint comments

* fix: sanitize triage router 429 detail and force immediate LiteLLM cooldown for llm-routing-ollama on rate limit

* docs: update fallback diagrams and cooldown behavior for Ollama models

* fix: implement router-side Ollama cooldown to prevent crashloop

LiteLLM Community Edition's deployment cooldown is unreliable for
single-deployment model groups and fallback-target groups. The previous
approach (multi-deployment replicas, allowed_fails_policy) did not
reliably cool down llm-routing-ollama, causing crashloops when Ollama
was rate-limited.

New approach: the triage router manages Ollama cooldowns internally.
When Ollama fails (429/502/503), the router activates a 5-minute
cooldown (configurable via OLLAMA_COOLDOWN_SECONDS env var). During
cooldown, all Ollama requests are immediately rejected:
- Auto modes: silently fall back to the free tier
- Direct/fallback mode: return 429 so LiteLLM skips to openrouter-auto

Changes:
- router/main.py: Add _ollama_cooldown_until state, cooldown check
  before Ollama proxy call, and activation on failure. Add Prometheus
  metrics (ollama_cooldown_active, ollama_cooldown_remaining_seconds).
- litellm/config.yaml: Remove test-fallback-model, remove duplicate
  llm-routing-ollama deployment (127.0.0.2), restore Ollama api_base
  to production (api.ollama.com), remove enterprise-only
  allowed_fails_policy.
- README.md: Update sequence diagrams, Fallback and Cooldown Behavior
  section, and metrics table to document router-side cooldown.

* chore: tidy up repository, remove hello world dummies, move and document verification scripts

* fix: resolve hardcoded worktree leaks and LiteLLM auth errors

* Address PR comments: robust httpx client teardown, dynamic path escaping in sed, expected model asserts in tests, synced metrics documentation

* Implement Valkey global cooldown cache sync, standard HTTPX client lifecycles, and handle transient exception status codes

* Address PR#11 code reviews: multimodal message extraction, concurrent breaker Valkey calls, generic error detail messages, SSE stream token counting, secure YAML rendering, and robust verification script exit codes

* Address PR #12 code review comments

- Decouple agy_proxy from main by introducing CooldownPersistence protocol and passing client/cooldown_persistence parameters.
- Manage http client lifetime cleanly in agy_proxy.
- Reset Valkey client state and cache last init attempt on exceptions to enforce the 5s retry cooldown.
- Add isinstance(msg, dict) guards to prevent crashes on malformed payloads.
- Use incremental UTF-8 decoder in stream generator to prevent character corruption.
- Remove dead should_close_client variables and conditions.
- Guard test_antigravity_connection when agentapi is missing.
- Fix typo in README.

* feat: expose model capabilities, token limits, and costs in Model Hub Table

- ci: add httpx to test workflow pip install for test_a2_verify.py

- config: add public_model_groups list to litellm_settings so all agent-*,
  openrouter-auto, llm-routing-ollama, and ollama-deepseek-* groups appear
  in the LiteLLM Model Hub Table UI

- config: add full model_info to all model_list entries (supports_vision,
  supports_reasoning, supports_function_calling, mode, max_tokens,
  max_input_tokens, is_public_model_group)

- config: set llm-routing-ollama and ollama-deepseek-v4-{pro,flash} context
  windows to 512K (524288 tokens), up from 131K/262K

- config: add DeepSeek API equivalent per-token costs to ollama models for
  Langfuse cost tracking:
    ollama-deepseek-v4-pro:   $1.74/1M input, $3.48/1M output
    ollama-deepseek-v4-flash: $0.14/1M input, $0.28/1M output

- router: enrich /model/new roster sync payload with model_info (features,
  context length from OpenRouter API, is_public_model_group) for all
  dynamically registered agent-* tiers

- router: add _register_ollama_models_in_db() — registers ollama-deepseek
  models via /model/new at startup so their model_info wins over LiteLLM's
  internal ollama_chat provider lookup (which returns null/false for unknown
  models in /model_group/info aggregation)

* chore: address review feedback on PR #14 (DRY purge helper, safety-net capabilities, align returned context lengths, and refactor verify scripts to httpx)

* chore: address PR #15 code review fixes and fix CI workflow triggers

* chore(deps): adjust dependabot root docker update time to 02:55 UTC (04:55 local)

* chore: address code review feedback (YAML list indentation, raise_for_status in metrics fetch, detailed HTTP routing diagnostics, and defensive config type checking)

* chore: trigger CI

* Address code reviews for PR #25

* Address new PR reviews and CodeRabbit feedback

* Address Gemini Code Assist review feedback on null text handling and empty choices fallback

* chore: address PR review feedback on DATABASE_URL, fallback password, and max_tokens clamping

* chore: address CodeRabbit and PR #27 review feedback

* chore: address Gemini Code Assist review feedback on PR #28

* fix: change session fingerprint hash to SHA-256 to satisfy CodeQL

* perf: upgrade session fingerprint hash function to SOTA blake2b

* fix: safely handle usage returned as null in api response

* fix: resolve missing LiteLLM request logs on Admin UI and fix Langfuse bad requests

* fix: address PR 30 review feedback including postgres password and circuit breaker fixes

* fix: address PR 31 review feedback
@sheepdestroyer
sheepdestroyer deleted the feat/model-hub-capabilities-visibility branch June 20, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant