The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(local-models): recommend nothing when no model reaches the speed floor
emozillaf560c14e7386
diff --git a/apps/desktop/src/i18n/de_local_models.ts b/apps/desktop/src/i18n/de_local_models.tsindex 7f0f49696ab..6516f8790ca 100644--- a/apps/desktop/src/i18n/de_local_models.ts+++ b/apps/desktop/src/i18n/de_local_models.ts@@ -29,13 +29,11 @@ export const deLocalModels: TranslationOverride<Translations['settings']['localM'best-quality-resident':'Das Modell mit der höchsten Qualität, das komplett auf Ihrer GPU mit voller Geschwindigkeit läuft. Die Auswahl wägt Qualität gegen die erwartete Geschwindigkeit auf dieser Hardware ab.','speed-gated-quality':- 'Ein besseres Modell würde auf diesen Rechner passen, aber bei seiner Speicherbandbreite zu langsam reagieren — das ist das beste Modell, das schnell bleibt.',- 'fastest-resident':- 'Kein Modell erreicht volle Geschwindigkeit auf dieser Hardware; dieses kommt am nächsten und läuft komplett im GPU-Speicher.'+ 'Ein besseres Modell würde auf diesen Rechner passen, aber bei seiner Speicherbandbreite zu langsam reagieren — das ist das beste Modell, das schnell bleibt.'},noRecommendationTitle: 'Keine automatische Empfehlung für diesen Rechner',noRecommendationDetail:- 'Die automatische Einrichtung braucht ein kuratiertes Modell, das vollständig in den Grafikspeicher oder den gemeinsamen Speicher passt. Sie können unten trotzdem ein Modell wählen oder weitere Modelle durchsuchen.',+ 'Die automatische Einrichtung braucht ein kuratiertes Modell, das vollständig im Grafikspeicher oder im gemeinsamen Speicher mit voller Geschwindigkeit läuft. Sie können unten trotzdem ein Modell wählen oder weitere Modelle durchsuchen.',noRecommendationAction: 'Modelle durchsuchen',downloaded: 'Heruntergeladen',downloadAction: size => `Download · ${size}`,diff --git a/apps/desktop/src/i18n/en_local_models.ts b/apps/desktop/src/i18n/en_local_models.tsindex 6d51a56d465..5ef86d3ba90 100644--- a/apps/desktop/src/i18n/en_local_models.ts+++ b/apps/desktop/src/i18n/en_local_models.ts@@ -30,13 +30,11 @@ export const enLocalModels: Translations['settings']['localModels'] = {'best-quality-resident':'The highest-quality model that runs entirely on your GPU at full speed. Picks weigh quality against predicted speed on this hardware.','speed-gated-quality':- 'A higher-quality model fits this machine but would respond too slowly on its memory bandwidth — this is the best model that stays fast.',- 'fastest-resident':- 'No model reaches full speed on this hardware; this one comes closest while running entirely in GPU memory.'+ 'A higher-quality model fits this machine but would respond too slowly on its memory bandwidth — this is the best model that stays fast.'} as Record<string, string>,noRecommendationTitle: 'No automatic recommendation for this machine',noRecommendationDetail:- 'Automatic setup requires a curated model that fits entirely in GPU or unified memory. You can still choose a model below or browse more models.',+ 'Automatic setup requires a curated model that runs entirely in GPU or unified memory at full speed. You can still choose a model below or browse more models.',noRecommendationAction: 'Browse models',downloaded: 'Downloaded',downloadAction: size => `Download · ${size}`,diff --git a/apps/desktop/src/i18n/es_local_models.ts b/apps/desktop/src/i18n/es_local_models.tsindex 209d8b0b9e5..7df7b3d0a30 100644--- a/apps/desktop/src/i18n/es_local_models.ts+++ b/apps/desktop/src/i18n/es_local_models.ts@@ -29,13 +29,11 @@ export const esLocalModels: TranslationOverride<Translations['settings']['localM'best-quality-resident':'El modelo de mayor calidad que se ejecuta por completo en tu GPU a máxima velocidad. La selección equilibra la calidad con la velocidad prevista en este hardware.','speed-gated-quality':- 'Cabe un modelo de mayor calidad en este equipo, pero respondería demasiado lento por el ancho de banda de su memoria; este es el mejor modelo que se mantiene rápido.',- 'fastest-resident':- 'Ningún modelo alcanza la velocidad máxima en este hardware; este es el que más se acerca ejecutándose por completo en la memoria de la GPU.'+ 'Cabe un modelo de mayor calidad en este equipo, pero respondería demasiado lento por el ancho de banda de su memoria; este es el mejor modelo que se mantiene rápido.'},noRecommendationTitle: 'No hay recomendación automática para este equipo',noRecommendationDetail:- 'La configuración automática requiere un modelo seleccionado que quepa por completo en la memoria de la GPU o unificada. Aun así, puedes elegir un modelo abajo o explorar más modelos.',+ 'La configuración automática requiere un modelo seleccionado que se ejecute por completo en la memoria de la GPU o unificada a máxima velocidad. Aun así, puedes elegir un modelo abajo o explorar más modelos.',noRecommendationAction: 'Explorar modelos',downloaded: 'Descargado',downloadAction: size => `Descargar · ${size}`,diff --git a/apps/desktop/src/i18n/fr_local_models.ts b/apps/desktop/src/i18n/fr_local_models.tsindex 875dce6ae43..d960633909f 100644--- a/apps/desktop/src/i18n/fr_local_models.ts+++ b/apps/desktop/src/i18n/fr_local_models.ts@@ -29,13 +29,11 @@ export const frLocalModels: TranslationOverride<Translations['settings']['localM'best-quality-resident':"Le modèle de meilleure qualité qui tient entièrement dans votre GPU et s'exécute à pleine vitesse. La sélection équilibre qualité et vitesse prévue sur ce matériel.",'speed-gated-quality':- 'Un modèle de meilleure qualité tient sur cette machine, mais sa bande passante mémoire le rendrait trop lent. Celui-ci est le meilleur modèle qui reste rapide.',- 'fastest-resident':- "Aucun modèle n'atteint sa pleine vitesse sur ce matériel. Celui-ci s'en approche le plus tout en tenant entièrement dans la mémoire GPU."+ 'Un modèle de meilleure qualité tient sur cette machine, mais sa bande passante mémoire le rendrait trop lent. Celui-ci est le meilleur modèle qui reste rapide.'},noRecommendationTitle: 'Aucune recommandation automatique pour cette machine',noRecommendationDetail:- "La configuration automatique nécessite un modèle présélectionné qui tient entièrement dans la mémoire GPU ou unifiée. Vous pouvez toujours choisir un modèle ci-dessous ou parcourir d'autres modèles.",+ "La configuration automatique nécessite un modèle présélectionné qui tient entièrement dans la mémoire GPU ou unifiée et s'exécute à pleine vitesse. Vous pouvez toujours choisir un modèle ci-dessous ou parcourir d'autres modèles.",noRecommendationAction: 'Parcourir les modèles',downloaded: 'Téléchargé',downloadAction: size => `Télécharger · ${size}`,diff --git a/apps/desktop/src/i18n/ja_local_models.ts b/apps/desktop/src/i18n/ja_local_models.tsindex fdec53b7695..a4863d017b4 100644--- a/apps/desktop/src/i18n/ja_local_models.ts+++ b/apps/desktop/src/i18n/ja_local_models.ts@@ -29,13 +29,11 @@ export const jaLocalModels: TranslationOverride<Translations['settings']['localM'best-quality-resident':'GPU に完全に載り、フルスピードで動くモデルの中で最高品質です。おすすめは品質とこのハードウェアでの予測速度を両立させて選ばれます。','speed-gated-quality':- 'より高品質なモデルもこのマシンに載りますが、メモリ帯域の制約で応答が遅くなります — これは速度を保てる最良のモデルです。',- 'fastest-resident':- 'このハードウェアでフルスピードに達するモデルはありません。GPU メモリ内で動くものの中で最速です。'+ 'より高品質なモデルもこのマシンに載りますが、メモリ帯域の制約で応答が遅くなります — これは速度を保てる最良のモデルです。'} as Record<string, string>,noRecommendationTitle: 'このマシン向けの自動推奨モデルはありません',noRecommendationDetail:- '自動セットアップには、GPU メモリまたはユニファイドメモリに完全に収まる厳選モデルが必要です。下の一覧から選ぶか、ほかのモデルを探すこともできます。',+ '自動セットアップには、GPU メモリまたはユニファイドメモリに完全に載り、フルスピードで動く厳選モデルが必要です。下の一覧から選ぶか、ほかのモデルを探すこともできます。',noRecommendationAction: 'モデルを探す',quickstartConfigure: '自分で選ぶ',downloaded: 'ダウンロード済み',diff --git a/apps/desktop/src/i18n/overlay-gaps.json b/apps/desktop/src/i18n/overlay-gaps.jsonindex 563636e6e47..4d96c781c8b 100644--- a/apps/desktop/src/i18n/overlay-gaps.json+++ b/apps/desktop/src/i18n/overlay-gaps.json@@ -1500,7 +1500,6 @@"settings.localModels.ram": ["ar","ru"],"settings.localModels.recommended": ["ar","ru"],"settings.localModels.recommendedReason.best-quality-resident": ["ar","ru"],- "settings.localModels.recommendedReason.fastest-resident": ["ar","ru"],"settings.localModels.recommendedReason.product-default": ["ar","ru"],"settings.localModels.recommendedReason.speed-gated-quality": ["ar","ru"],"settings.localModels.runtimeInstalled": ["ar","ru"],diff --git a/apps/desktop/src/i18n/zh-hant_settings.ts b/apps/desktop/src/i18n/zh-hant_settings.tsindex f42f19b9ca2..f8d8bee14e9 100644--- a/apps/desktop/src/i18n/zh-hant_settings.ts+++ b/apps/desktop/src/i18n/zh-hant_settings.ts@@ -1104,12 +1104,11 @@ export const zhHantSettings = {'product-default': '這台機器的預設模型,由其製造商選定。','best-quality-resident': '在完全駐留 GPU 且保持全速的模型中品質最高。推薦會在品質與該硬體的預計速度之間權衡。','speed-gated-quality':- '有更高品質的模型可以裝入這台機器,但受記憶體頻寬限制回應會太慢——這是保持流暢的最佳模型。',- 'fastest-resident': '沒有模型能在該硬體上達到全速;這是完全駐留 GPU 記憶體中最快的一個。'+ '有更高品質的模型可以裝入這台機器,但受記憶體頻寬限制回應會太慢——這是保持流暢的最佳模型。'} as Record<string, string>,noRecommendationTitle: '此裝置暫無自動推薦模型',noRecommendationDetail:- '自動設定需要一個可完全放入 GPU 記憶體或統一記憶體的精選模型。你仍可在下方自行選擇,或瀏覽更多模型。',+ '自動設定需要一個可完全駐留 GPU 記憶體或統一記憶體並保持全速的精選模型。你仍可在下方自行選擇,或瀏覽更多模型。',noRecommendationAction: '瀏覽模型',quickstartConfigure: '讓我選擇',downloaded: '已下載',diff --git a/apps/desktop/src/i18n/zh_local_models.ts b/apps/desktop/src/i18n/zh_local_models.tsindex 88f11a9bd1d..b7c3828b794 100644--- a/apps/desktop/src/i18n/zh_local_models.ts+++ b/apps/desktop/src/i18n/zh_local_models.ts@@ -36,11 +36,11 @@ export const zhLocalModels: TranslationOverride<Translations['settings']['localMrecommendedReason: {'product-default': '这台机器的默认模型,由其制造商选定。','best-quality-resident': '在完全驻留 GPU 且保持全速的模型中质量最高。推荐会在质量与该硬件的预计速度之间权衡。',- 'speed-gated-quality': '有更高质量的模型可以装入这台机器,但受内存带宽限制响应会太慢——这是保持流畅的最佳模型。',- 'fastest-resident': '没有模型能在该硬件上达到全速;这是完全驻留 GPU 内存中最快的一个。'+ 'speed-gated-quality': '有更高质量的模型可以装入这台机器,但受内存带宽限制响应会太慢——这是保持流畅的最佳模型。'} as Record<string, string>,noRecommendationTitle: '此设备暂无自动推荐模型',- noRecommendationDetail: '自动设置需要一个可完全放入显存或统一内存的精选模型。你仍可在下方自行选择,或浏览更多模型。',+ noRecommendationDetail:+ '自动设置需要一个可完全驻留显存或统一内存并保持全速的精选模型。你仍可在下方自行选择,或浏览更多模型。',noRecommendationAction: '浏览模型',downloaded: '已下载',downloadAction: size => `下载 · ${size}`,diff --git a/apps/desktop/src/types/hermes.ts b/apps/desktop/src/types/hermes.tsindex 5106d1c233d..b41f8f929d5 100644--- a/apps/desktop/src/types/hermes.ts+++ b/apps/desktop/src/types/hermes.ts@@ -1494,8 +1494,8 @@ export interface LocalCatalogModel {native_context_label: stringrecommended: boolean/** Why the resolver picked this entry (recommended rows only):- * product-default | best-quality-resident | speed-gated-quality | fastest-resident |- * least-painful-spilled. Renders as the Recommended badge's tooltip. */+ * product-default | best-quality-resident | speed-gated-quality.+ * Renders as the Recommended badge's tooltip. */recommended_reason?: string | nulldownloaded: booleandownloaded_model_id?: string | nulldiff --git a/hermes_cli/local_runtime/catalog.py b/hermes_cli/local_runtime/catalog.pyindex 241cc9a5acf..e84b35a5b9d 100644--- a/hermes_cli/local_runtime/catalog.py+++ b/hermes_cli/local_runtime/catalog.py@@ -253,9 +253,9 @@ def recommended_entry(budget: HardwareBudget,Callers pass pre-filtered entries when some are ineligible for reasons the catalog can't know(engine too old). Reasons: product-default (the product's maker chose this entry and it runsresident); best-quality-resident (quality won among resident entries clearing the pleasant- floor); speed-gated-quality (same, but the floor eliminated a HIGHER quality candidate);- fastest-resident (nothing resident clears the floor). Returns None when no eligible entry- runs resident; spilled models remain available for explicit selection.+ floor); speed-gated-quality (same, but the floor eliminated a HIGHER quality candidate).+ Returns None when no eligible entry runs resident at the pleasant floor; slower and spilled+ models remain available for explicit selection."""pool = CATALOG if entries is None else entriesfitting = [(e, c) for e in pool if (c := select_variant(e, budget)) is not None]@@ -275,9 +275,7 @@ def recommended_entry(budget: HardwareBudget,pick = max(pleasant, key=lambda t: (t[0].quality, -t[1].variant.size_bytes))[0]floor_gated = any(e.quality > pick.quality for e, _ in resident)return (pick, "speed-gated-quality" if floor_gated else "best-quality-resident")- if resident:- return (max(resident, key=speed)[0], "fastest-resident")- # A spilled model may be usable, but it is not a recommendation. Keep it+ # A slow or spilled model may be usable, but it is not a recommendation. Keep it# discoverable through Browse so the user can opt in with the degradation visible.return Nonediff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.jsonindex 1592180bfcf..9a2c4cc0ebe 100644--- a/locales/_keys.desktop.json+++ b/locales/_keys.desktop.json@@ -3361,7 +3361,6 @@"settings.localModels.ram","settings.localModels.recommended","settings.localModels.recommendedReason.best-quality-resident",- "settings.localModels.recommendedReason.fastest-resident","settings.localModels.recommendedReason.product-default","settings.localModels.recommendedReason.speed-gated-quality","settings.localModels.runtimeInstalled",diff --git a/tests/hermes_cli/test_local_recommendation.py b/tests/hermes_cli/test_local_recommendation.pyindex 508c3c7088d..e5a46eac901 100644--- a/tests/hermes_cli/test_local_recommendation.py+++ b/tests/hermes_cli/test_local_recommendation.py@@ -35,16 +35,16 @@ from hermes_cli.local_runtime.estimator import HardwareBudget_GIB = 1 << 30-def _discrete(size_gb: int) -> HardwareBudget:- total = size_gb * _GIB+def _discrete(size_gb: float) -> HardwareBudget:+ total = int(size_gb * _GIB)margin = max(2 * _GIB, int(total * 0.09))return HardwareBudget(usable_vram_bytes=max(0, total - margin),total_device_bytes=total,ram_available_bytes=64 * _GIB, uma=False)-def _unified(size_gb: int) -> HardwareBudget:- total = size_gb * _GIB+def _unified(size_gb: float) -> HardwareBudget:+ total = int(size_gb * _GIB)return HardwareBudget(usable_vram_bytes=int(total * 0.80),total_device_bytes=total,ram_available_bytes=0, uma=True)@@ -222,6 +222,22 @@ def test_unified_never_recommends_a_below_floor_dense_model():assert predicted_decode_tok_s(entry, choice.variant, budget) >= PLEASANT_FLOOR_TOK_S[email protected]("budget", [+ *(_unified(gb) for gb in (16, 24, 31.5, 32, 48, 64, 96, 128, 256)),+ *(_discrete(gb) for gb in (8, 12, 16, 24, 32, 48, 96)),+], ids=lambda b: f"{'unified' if b.uma else 'discrete'}-{b.total_device_bytes / _GIB:g}")+def test_a_derived_recommendation_always_clears_the_floor(budget):+ """A machine where nothing resident reaches the floor gets no recommendation. A "32 GB" laptop+ reads 31.5 GB, where only the 27B fits and runs well under the floor on an iGPU or the CPU;+ it stays one click away in Browse."""+ picked = recommended_entry(budget)+ if picked is None or picked[1] == "product-default":+ return+ choice = select_variant(picked[0], budget)+ assert choice is not None and choice.zero_spill+ assert predicted_decode_tok_s(picked[0], choice.variant, budget) >= PLEASANT_FLOOR_TOK_S++def test_quality_decides_where_speed_permits():"""On big discrete hardware every resident entry clears the floor, sothe pick must be the highest-quality fitting entry — the axis thatdiff --git a/website/docs/user-guide/local-models.md b/website/docs/user-guide/local-models.mdindex d215eaad220..5674e265d28 100644--- a/website/docs/user-guide/local-models.md+++ b/website/docs/user-guide/local-models.md@@ -78,6 +78,12 @@ build spilled to system RAM simply can't run that model.Models that don't fit stay visible with the reason, so you always knowwhat a hardware upgrade would unlock.+Hermes recommends the highest-quality model that runs entirely in GPU or+unified memory at a predicted 20 tokens per second or more. A machine's+maker can set a different default, and Hermes recommends that model+whenever it fits. When no model reaches the floor, Hermes recommends none,+and you can still choose any model that fits.+## How memory management worksLocal models live or die by memory placement, so Hermes manages it