Skip to content

fix(gateway): merge Portal API free recommendations into /model picker - #28931

Closed
LifeJiggy wants to merge 1 commit into
NousResearch:mainfrom
LifeJiggy:fix/gateway-portal-model-picker
Closed

fix(gateway): merge Portal API free recommendations into /model picker#28931
LifeJiggy wants to merge 1 commit into
NousResearch:mainfrom
LifeJiggy:fix/gateway-portal-model-picker

Conversation

@LifeJiggy

Copy link
Copy Markdown
Contributor

Summary

The gateway /model picker only uses the static model-catalog.json for the
Nous Portal provider, missing dynamically-recommended models like DeepSeek V4
Flash (announced May 14 via Novita Labs promotion). The interactive CLI already
calls union_with_portal_free_recommendations() — this teaches

list_authenticated_providers() (used by the gateway) to do the same.

Related Issue

Fixes #28886

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/model_switch.py:1169-1180 — after get_curated_nous_model_ids(),
    call union_with_portal_free_recommendations() to merge Portal API
    freeRecommendedModels into the nous provider's curated list. Falls back
    to the curated list on any error (silent degrade).

How to Test

  1. Authenticate with Nous Portal on a free tier (hermes login nous)
  2. Send /model via Discord or Telegram gateway
  3. Previously: DeepSeek V4 Flash (and other recent Portal free models) missing
  4. Now: Portal-recommended free models appear alongside the curated list

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard provider/nous Nous Research API (OAuth) labels May 19, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing PR: #26910 addresses the same issue (#28886) with likely the same fix path in list_authenticated_providers(). Please coordinate to avoid duplicate work.

@LifeJiggy
LifeJiggy force-pushed the fix/gateway-portal-model-picker branch from 43037a5 to 70599e2 Compare May 19, 2026 21:46
@LifeJiggy

LifeJiggy commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

@alt-glitch
Updated approach.

Instead of tier detection + conditional calls (check_nous_free_tier →

union_with_portal_free_recommendations or union_with_portal_paid_recommendations), this adds a new combined helper union_with_portal_recommendations() that calls the Portal endpoint once and merges both freeRecommendedModels and paidRecommendedModels in a single pass. Net result: same coverage as #26910 but in 1 API call instead of 2-3, no tier detection, no branching.

Happy to coordinate — either approach solves the issue. Mine trades a slightly larger helper function for fewer API calls/simpler call-site logic; #26910 reuses existing per-tier helpers. Let us know which direction you prefer.

…l picker

list_authenticated_providers() only loaded the curated (paid) model list
for Nous Portal, so the gateway /model picker never showed free models
like deepseek-v4-flash and stepfun/step-3.5-flash.

Adds union_with_portal_recommendations() — a single-call combined helper
that fetches the /api/nous/recommended-models endpoint ONCE and merges
BOTH freeRecommendedModels and paidRecommendedModels into the curated
list. This avoids the multi-call tier-detection pattern (check_nous_free_tier
+ conditional union_with_portal_free/paid_recommendations) used elsewhere.

The CLI hermes model command already handles Portal recommendations via
the separate helpers; this fix brings the same coverage to the shared
list_authenticated_providers() used by the gateway, in fewer API calls.
@LifeJiggy

Copy link
Copy Markdown
Contributor Author

@teknium1 PTAL

@teknium1

Copy link
Copy Markdown
Contributor

This is implemented on current main.

Automated hermes-sweeper review found the gateway /model path now uses Portal recommendation augmentation for Nous models:

  • gateway/slash_commands.py:948 imports list_authenticated_providers(), and gateway/slash_commands.py:1168 calls it when building the /model list.
  • hermes_cli/model_switch.py:1545 has a Nous-specific branch in list_authenticated_providers() that starts from the curated Nous list and mirrors the CLI picker behavior.
  • hermes_cli/model_switch.py:1558 imports check_nous_free_tier(), union_with_portal_free_recommendations(), and union_with_portal_paid_recommendations().
  • hermes_cli/model_switch.py:1573 calls the free recommendation union for free-tier users and the paid recommendation union otherwise, with a curated-list fallback on Portal failures.
  • hermes_cli/models.py:580 implements the free recommendation helper by reading Portal freeRecommendedModels and adding missing model IDs.
  • Blame attributes the main implementation to 51c68d4ab1a9e3c62fb1048fccb84144c409f0e7, which is contained in v2026.6.5.

This also matches the linked discussion: issue #28886 was already closed as implemented on main, and competing PR #26910 was closed after the behavior was present.

@teknium1 teknium1 closed this Jun 15, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists provider/nous Nous Research API (OAuth) sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gateway /model picker does not fetch dynamic Portal API recommendations

3 participants