7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.
TypeScript
Show time-window rate-limit usage badges in the model table (#921)
suantea (asuan_suan)065a9cd81d32
diff --git a/client/src/components/model-table.tsx b/client/src/components/model-table.tsxindex ce77c76e..fe6044db 100644--- a/client/src/components/model-table.tsx+++ b/client/src/components/model-table.tsx@@ -14,7 +14,9 @@ import {memberEndpointTitle,memberProviderLabel,providerLabel,+ tightestRateLimit,type ModelGroupRow,+ type RateLimitUsageRow,type Row,} from '@/lib/routing'@@ -242,7 +244,7 @@ export const dragDots = (// The collapsed header row for a logical-model group: name, provider count,// union vision/tools badges, the best member's axis bars + score, and a single// switch that enables/disables every provider in the group.-export function GroupHeaderCells({ group, rank, dragHandle, onToggleGroup, allRows }: {+export function GroupHeaderCells({ group, rank, dragHandle, onToggleGroup, allRows, rateUsage }: {group: ModelGroupRowrank: numberdragHandle?: ReactNode@@ -251,12 +253,22 @@ export function GroupHeaderCells({ group, rank, dragHandle, onToggleGroup, allRo// model id land in different display groups the moment one copy is renamed,// so the group's own members are not a complete sibling set (#651).allRows?: readonly Row[]+ // Time-window rate-limit usage by model db id (#876). Fetched ONCE at the page+ // level and passed down: a query hook here would open one observer and one+ // 15s poll timer per row, i.e. hundreds of them on a real catalog.+ rateUsage?: ReadonlyMap<number, RateLimitUsageRow>}) {const { t } = useI18n()const anyEnabled = group.members.some(m => m.enabled)const solo = group.members.length === 1const best = group.members.reduce((b, m) => ((m.score ?? -1) > (b.score ?? -1) ? m : b), group.members[0])const guard = (best.headroom ?? 1) * (best.rateLimit ?? 1)+ // Remaining time-window quota for this group (#876): the member with the most+ // headroom decides the badge, since the group stays routable while any one of+ // its providers can serve. Lookup is O(members) against the shared map.+ const tightest = rateUsage+ ? tightestRateLimit(group.members.flatMap(m => rateUsage.get(m.modelDbId) ?? []))+ : null// Honest group display (#580): reliability/speed ranges come only from// members that were actually measured; when none were, show "no data" rather// than the shared exploration priors. Intelligence is catalog metadata, so@@ -295,6 +307,11 @@ export function GroupHeaderCells({ group, rank, dragHandle, onToggleGroup, allRo{quota.text}</span>)}+ {tightest && (+ <span title={t('models.rateLimitUsageTitle')} className={`text-[10px] rounded-full px-1.5 py-0.5 tabular-nums ${tightest.used >= tightest.limit ? 'bg-red-600/15 text-red-700 dark:text-red-400' : tightest.used / tightest.limit >= 0.7 ? 'bg-amber-600/15 text-amber-700 dark:text-amber-400' : 'bg-muted text-muted-foreground'}`}>+ {t('models.rateLimitUsage', { kind: tightest.kind, used: tightest.used, limit: tightest.limit })}+ </span>+ )}{maxCtx > 0 && (<span title={t('models.ctxTitle')} className="text-[10px] rounded-full px-1.5 py-0.5 bg-muted text-muted-foreground tabular-nums">{t('models.ctxBadge', { size: formatContext(maxCtx) })}@@ -341,11 +358,12 @@ export function GroupHeaderCells({ group, rank, dragHandle, onToggleGroup, allRo)}-export function SortableGroupRow({ group, rank, onToggleGroup, allRows }: {+export function SortableGroupRow({ group, rank, onToggleGroup, allRows, rateUsage }: {group: ModelGroupRowrank: numberonToggleGroup: (memberIds: number[], enabled: boolean) => voidallRows?: readonly Row[]+ rateUsage?: ReadonlyMap<number, RateLimitUsageRow>}) {const { t } = useI18n()const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: `grp:${group.key}` })@@ -370,7 +388,7 @@ export function SortableGroupRow({ group, rank, onToggleGroup, allRows }: {onClick={() => navigate(`/models/chat/${detailId}`)}className={`group/row border-b last:border-0 bg-card cursor-pointer transition-colors hover:[&>td]:bg-muted/50 [&>td:first-child]:rounded-l-lg [&>td:last-child]:rounded-r-lg ${isDragging ? 'opacity-50' : ''} ${anyEnabled ? '' : 'opacity-50'}`}>- <GroupHeaderCells group={group} rank={rank} dragHandle={handle} onToggleGroup={onToggleGroup} allRows={allRows} />+ <GroupHeaderCells group={group} rank={rank} dragHandle={handle} onToggleGroup={onToggleGroup} allRows={allRows} rateUsage={rateUsage} /></tr>)}diff --git a/client/src/i18n/locales/am.json b/client/src/i18n/locales/am.jsonindex 2c4c261c..326a3f32 100644--- a/client/src/i18n/locales/am.json+++ b/client/src/i18n/locales/am.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "ተመን-የተገደበ - ምንም ቋሚ ወርሃዊ የማስመሰያ በጀት የለም።",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "የጊዜ መስኮት የፍጥነት ገደብ አጠቃቀም (ጥቅም ላይ የዋለ / ገደብ) ለቀረው አቅም ከፍተኛ ለሆነው አቅራቢ","splitOut": "ይህን ቅጂ አያዋህዱት","splitOutHint": "የዚህን አቅራቢ ቅጂ ወደ የተዋሃደ ሞዴል ከማዋሃድ ይልቅ የራሱ የሆነ ግቤት ይስጡት። ከቅጂው ገጽ መልሰው ሊያዋህዱት ይችላሉ።","splitUndo": "መልሰው ይቀላቀሉ",diff --git a/client/src/i18n/locales/ar.json b/client/src/i18n/locales/ar.jsonindex 772da644..92f851b2 100644--- a/client/src/i18n/locales/ar.json+++ b/client/src/i18n/locales/ar.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "السعر محدود – لا توجد ميزانية رمزية شهرية ثابتة",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "استخدام حد المعدل ضمن النافذة الزمنية (المستخدم / الحد) لدى المزوّد الأكثر سعة متبقية","splitOut": "لا تقم بدمج هذه النسخة","splitOutHint": "امنح نسخة هذا الموفر إدخالاً منفصلاً خاصًا بها بدلاً من دمجها في النموذج الموحد. يمكنك دمجها مرة أخرى من الصفحة الخاصة بالنسخة.","splitUndo": "دمج مرة أخرى",diff --git a/client/src/i18n/locales/az.json b/client/src/i18n/locales/az.jsonindex d61c717c..4cfc36ce 100644--- a/client/src/i18n/locales/az.json+++ b/client/src/i18n/locales/az.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Tarif məhdudiyyəti — sabit aylıq token büdcəsi yoxdur",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Zaman pəncərəsində sürət limiti istifadəsi (istifadə olunan / limit), ən çox ehtiyatı olan provayder üzrə","splitOut": "Bu nüsxəni birləşdirməyin","splitOutHint": "Bu provayderin nüsxəsini vahid modeldə birləşdirmək əvəzinə onun ayrıca girişini verin. Siz onu nüsxənin öz səhifəsindən birləşdirə bilərsiniz.","splitUndo": "Geri birləşdirin",diff --git a/client/src/i18n/locales/bg.json b/client/src/i18n/locales/bg.jsonindex 8f631ff0..f331d637 100644--- a/client/src/i18n/locales/bg.json+++ b/client/src/i18n/locales/bg.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Ограничен процент — няма фиксиран месечен токен бюджет",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Използване на ограничението за скорост във времевия прозорец (използвано / лимит) при доставчика с най-голям резерв","splitOut": "Не обединявайте това копие","splitOutHint": "Дайте на копието на този доставчик собствен отделен запис, вместо да го обедините в единния модел. Можете да го обедините обратно от собствената страница на копието.","splitUndo": "Обединяване обратно",diff --git a/client/src/i18n/locales/bn.json b/client/src/i18n/locales/bn.jsonindex 6beee6a7..c147f3ef 100644--- a/client/src/i18n/locales/bn.json+++ b/client/src/i18n/locales/bn.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "হার-সীমিত — কোনো নির্দিষ্ট মাসিক টোকেন বাজেট নেই",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "সময়-উইন্ডো রেট লিমিট ব্যবহার (ব্যবহৃত / সীমা), সবচেয়ে বেশি অবশিষ্ট ক্ষমতাসম্পন্ন প্রদানকারীর","splitOut": "এই অনুলিপি একত্রিত করবেন না","splitOutHint": "এই প্রদানকারীর অনুলিপিটিকে ইউনিফাইড মডেলে মার্জ করার পরিবর্তে এর নিজস্ব আলাদা এন্ট্রি দিন৷ আপনি অনুলিপির নিজস্ব পৃষ্ঠা থেকে এটি আবার মার্জ করতে পারেন।","splitUndo": "ফিরে একত্রিত",diff --git a/client/src/i18n/locales/cs.json b/client/src/i18n/locales/cs.jsonindex f6633740..6da54703 100644--- a/client/src/i18n/locales/cs.json+++ b/client/src/i18n/locales/cs.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Omezení sazeb — žádný pevný měsíční rozpočet tokenů",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Využití limitu rychlosti v časovém okně (využito / limit) u poskytovatele s největší rezervou","splitOut": "Neslučujte tuto kopii","splitOutHint": "Dejte kopii tohoto poskytovatele vlastní samostatnou položku místo toho, abyste ji slučovali do jednotného modelu. Můžete jej sloučit zpět z vlastní stránky kopie.","splitUndo": "Sloučit zpět",diff --git a/client/src/i18n/locales/da.json b/client/src/i18n/locales/da.jsonindex 0469c9d7..e4f2184f 100644--- a/client/src/i18n/locales/da.json+++ b/client/src/i18n/locales/da.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Rentebegrænset — intet fast månedligt token-budget",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Forbrug af hastighedsgrænse i tidsvinduet (brugt / grænse) for udbyderen med mest plads tilbage","splitOut": "Flet ikke denne kopi","splitOutHint": "Giv denne udbyders kopi sin egen separate post i stedet for at flette den ind i den forenede model. Du kan flette den tilbage fra kopiens egen side.","splitUndo": "Flet tilbage",diff --git a/client/src/i18n/locales/de.json b/client/src/i18n/locales/de.jsonindex f76588f8..2f494d42 100644--- a/client/src/i18n/locales/de.json+++ b/client/src/i18n/locales/de.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Begrenzte Rate – kein festes monatliches Token-Budget",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Ratenlimit-Nutzung im Zeitfenster (genutzt / Limit) beim Anbieter mit dem meisten Spielraum","splitOut": "Führen Sie diese Kopie nicht zusammen","splitOutHint": "Geben Sie der Kopie dieses Anbieters einen eigenen separaten Eintrag, anstatt sie im einheitlichen Modell zusammenzuführen. Sie können es von der eigenen Seite der Kopie aus wieder zusammenführen.","splitUndo": "Zurück verschmelzen",diff --git a/client/src/i18n/locales/el.json b/client/src/i18n/locales/el.jsonindex c892a161..f50bf14b 100644--- a/client/src/i18n/locales/el.json+++ b/client/src/i18n/locales/el.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Περιορισμένος ρυθμός — χωρίς σταθερό μηνιαίο προϋπολογισμό token",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Χρήση ορίου ρυθμού στο χρονικό παράθυρο (σε χρήση / όριο) για τον πάροχο με το μεγαλύτερο περιθώριο","splitOut": "Μην συγχωνεύσετε αυτό το αντίγραφο","splitOutHint": "Δώστε στο αντίγραφο αυτού του παρόχου τη δική του ξεχωριστή καταχώρηση αντί να το συγχωνεύσετε στο ενοποιημένο μοντέλο. Μπορείτε να το συγχωνεύσετε από τη σελίδα του αντιγράφου.","splitUndo": "Συγχώνευση πίσω",diff --git a/client/src/i18n/locales/en.json b/client/src/i18n/locales/en.jsonindex acb013bf..de445287 100644--- a/client/src/i18n/locales/en.json+++ b/client/src/i18n/locales/en.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Rate-limited — no fixed monthly token budget",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Time-window rate-limit usage (used / limit) for the provider with the most headroom","splitOut": "Don't merge this copy","splitOutHint": "Give this provider's copy its own separate entry instead of merging it into the unified model. You can merge it back from the copy's own page.","splitUndo": "Merge back",diff --git a/client/src/i18n/locales/es.json b/client/src/i18n/locales/es.jsonindex 332a75b5..2847104a 100644--- a/client/src/i18n/locales/es.json+++ b/client/src/i18n/locales/es.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Con límite de tasa: sin presupuesto mensual fijo de tokens",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Uso del límite de velocidad por ventana de tiempo (usado / límite) del proveedor con más margen","splitOut": "No combinar esta copia","splitOutHint": "Da a la copia de este proveedor su propia entrada separada en lugar de combinarla en el modelo unificado. Puedes volver a combinarla desde la página de la copia.","splitUndo": "Volver a combinar",diff --git a/client/src/i18n/locales/fa.json b/client/src/i18n/locales/fa.jsonindex dad7b6a4..e59ec896 100644--- a/client/src/i18n/locales/fa.json+++ b/client/src/i18n/locales/fa.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "نرخ محدود - بدون بودجه رمز ماهانه ثابت",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "میزان مصرف محدودیت نرخ در بازهٔ زمانی (مصرفشده / حد) برای ارائهدهنده با بیشترین ظرفیت باقیمانده","splitOut": "این کپی را ادغام نکنید","splitOutHint": "به جای ادغام آن در مدل یکپارچه، به کپی این ارائه دهنده ورودی جداگانه خود بدهید. می توانید آن را از صفحه خود کپی ادغام کنید.","splitUndo": "ادغام مجدد",diff --git a/client/src/i18n/locales/fi.json b/client/src/i18n/locales/fi.jsonindex debdd4ce..54e2f49b 100644--- a/client/src/i18n/locales/fi.json+++ b/client/src/i18n/locales/fi.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Maksurajoitettu — ei kiinteää kuukausittaista token-budjettia",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Aikaikkunan nopeusrajan käyttö (käytetty / raja) palveluntarjoajalla, jolla on eniten liikkumavaraa","splitOut": "Älä yhdistä tätä kopiota","splitOutHint": "Anna tämän palveluntarjoajan kopiolle oma erillinen merkintä sen sijaan, että yhdistäisit sen yhtenäiseen malliin. Voit yhdistää sen takaisin kopion omalta sivulta.","splitUndo": "Yhdistä takaisin",diff --git a/client/src/i18n/locales/fr.json b/client/src/i18n/locales/fr.jsonindex e19ca902..2a09cd2c 100644--- a/client/src/i18n/locales/fr.json+++ b/client/src/i18n/locales/fr.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Limité en débit : pas de budget mensuel de tokens fixe",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Utilisation de la limite de débit sur la fenêtre de temps (utilisé / limite) pour le fournisseur ayant le plus de marge","splitOut": "Ne pas fusionner cette copie","splitOutHint": "Donne à la copie de ce fournisseur sa propre entrée séparée au lieu de la fusionner dans le modèle unifié. Vous pourrez la re-fusionner depuis la page de la copie.","splitUndo": "Re-fusionner",diff --git a/client/src/i18n/locales/gu.json b/client/src/i18n/locales/gu.jsonindex 8fb1ba7b..493ea4d4 100644--- a/client/src/i18n/locales/gu.json+++ b/client/src/i18n/locales/gu.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "દર-મર્યાદિત — કોઈ નિશ્ચિત માસિક ટોકન બજેટ નથી",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "સમય-વિન્ડો દર મર્યાદાનો વપરાશ (વપરાયેલ / મર્યાદા), સૌથી વધુ બાકી ક્ષમતા ધરાવતા પ્રદાતાનો","splitOut": "આ નકલને મર્જ કરશો નહીં","splitOutHint": "આ પ્રદાતાની નકલને એકીકૃત મોડેલમાં મર્જ કરવાને બદલે તેની પોતાની અલગ એન્ટ્રી આપો. તમે તેને નકલના પોતાના પૃષ્ઠ પરથી પાછું મર્જ કરી શકો છો.","splitUndo": "પાછા મર્જ કરો",diff --git a/client/src/i18n/locales/ha.json b/client/src/i18n/locales/ha.jsonindex f7985a64..1c7f42e0 100644--- a/client/src/i18n/locales/ha.json+++ b/client/src/i18n/locales/ha.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Rate-iyakance - babu ƙayyadadden kasafin kuɗin alamar wata-wata",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Amfani da iyakar gudu a cikin tagar lokaci (an yi amfani / iyaka) ga mai bayarwa mai sauran karfi mafi yawa","splitOut": "Kar a haɗa wannan kwafin","splitOutHint": "Ba da kwafin wannan mai bada shigarwar nasa daban maimakon haɗa shi zuwa ƙirar haɗin kai. Kuna iya haɗa shi baya daga shafin kwafin.","splitUndo": "Haɗa baya",diff --git a/client/src/i18n/locales/he.json b/client/src/i18n/locales/he.jsonindex 5f38e1d5..caaba9de 100644--- a/client/src/i18n/locales/he.json+++ b/client/src/i18n/locales/he.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "ריבית מוגבלת — אין תקציב טוקנים חודשי קבוע",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "ניצול מגבלת הקצב בחלון הזמן (בשימוש / מגבלה) אצל הספק עם הכי הרבה מרווח","splitOut": "אל תמזג את העותק הזה","splitOutHint": "תן לעותק של ספק זה רשומה נפרדת משלו במקום למזג אותו למודל המאוחד. אפשר למזג אותו בחזרה מהעמוד של העותק.","splitUndo": "מזג בחזרה",diff --git a/client/src/i18n/locales/hi.json b/client/src/i18n/locales/hi.jsonindex f7206c8b..f455822e 100644--- a/client/src/i18n/locales/hi.json+++ b/client/src/i18n/locales/hi.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "दर-सीमित - कोई निश्चित मासिक टोकन बजट नहीं",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "समय-विंडो दर सीमा का उपयोग (उपयोग / सीमा), सबसे अधिक शेष क्षमता वाले प्रदाता का","splitOut": "इस प्रति को मर्ज न करें","splitOutHint": "इस प्रदाता की प्रति को एकीकृत मॉडल में विलय करने के बजाय उसकी अपनी अलग प्रविष्टि दें। आप इसे कॉपी के अपने पेज से वापस मर्ज कर सकते हैं।","splitUndo": "वापस विलय",diff --git a/client/src/i18n/locales/hr.json b/client/src/i18n/locales/hr.jsonindex 3480b618..ffd87b95 100644--- a/client/src/i18n/locales/hr.json+++ b/client/src/i18n/locales/hr.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Ograničenje cijene — nema fiksnog mjesečnog budžeta tokena",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Iskorištenost ograničenja brzine u vremenskom prozoru (iskorišteno / ograničenje) kod pružatelja s najviše prostora","splitOut": "Nemojte spajati ovu kopiju","splitOutHint": "Dajte kopiji ovog davatelja vlastiti zasebni unos umjesto da je spojite u objedinjeni model. Možete ga spojiti natrag s vlastite stranice kopije.","splitUndo": "Spajanje natrag",diff --git a/client/src/i18n/locales/hu.json b/client/src/i18n/locales/hu.jsonindex 34055a80..99cd3095 100644--- a/client/src/i18n/locales/hu.json+++ b/client/src/i18n/locales/hu.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Díjkorlátos — nincs fix havi token költségvetés",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Időablakos sebességkorlát-használat (felhasznált / korlát) a legtöbb tartalékkal rendelkező szolgáltatónál","splitOut": "Ne egyesítse ezt a példányt","splitOutHint": "Adjon külön bejegyzést ennek a szolgáltatónak a másolatának ahelyett, hogy az egyesített modellbe egyesítené. A másolat saját oldaláról visszaolvaszthatja.","splitUndo": "Egyesítse vissza",diff --git a/client/src/i18n/locales/id.json b/client/src/i18n/locales/id.jsonindex 3d202ae9..2547d81f 100644--- a/client/src/i18n/locales/id.json+++ b/client/src/i18n/locales/id.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Tarif terbatas — tidak ada anggaran token bulanan tetap",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Penggunaan batas laju dalam jendela waktu (terpakai / batas) untuk penyedia dengan sisa kapasitas terbanyak","splitOut": "Jangan gabungkan salinan ini","splitOutHint": "Berikan salinan penyedia ini entri terpisah daripada menggabungkannya ke dalam model terpadu. Anda dapat menggabungkannya kembali dari halaman salinannya sendiri.","splitUndo": "Gabungkan kembali",diff --git a/client/src/i18n/locales/ig.json b/client/src/i18n/locales/ig.jsonindex 37a5ce13..960d7322 100644--- a/client/src/i18n/locales/ig.json+++ b/client/src/i18n/locales/ig.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Oke-oke - enweghị ego mmefu ego nke ọnwa ọ bụla",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Ojiji oke ọsọ n'ime oghere oge (ejiri / oke) maka onye na-eweta nwere ohere fọdụrụ kacha","splitOut": "Ejikọtala oyiri a","splitOutHint": "Nye nnomi nke onye na-eweta nke a ntinye dị iche iche kama ijikọ ya na ụdị ejikọtara ọnụ. Ị nwere ike ijikọ ya azụ site na ibe nke ya.","splitUndo": "Jikọọ azụ",diff --git a/client/src/i18n/locales/it.json b/client/src/i18n/locales/it.jsonindex 15ba2e40..4ce6ca05 100644--- a/client/src/i18n/locales/it.json+++ b/client/src/i18n/locales/it.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} GPD","rateTitle": "Limitato — nessun budget mensile fisso di token",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Utilizzo del limite di frequenza nella finestra temporale (usato / limite) per il provider con più margine","splitOut": "Non unire questa copia","splitOutHint": "Dai alla copia di questo fornitore una voce separata invece di unirla nel modello unificato. Puoi riunirla dalla pagina della copia.","splitUndo": "Riunisci",diff --git a/client/src/i18n/locales/ja.json b/client/src/i18n/locales/ja.jsonindex d5f78533..fa1d0c3b 100644--- a/client/src/i18n/locales/ja.json+++ b/client/src/i18n/locales/ja.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "レート制限 — 毎月の固定トークン予算なし",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "時間枠のレート制限使用量(使用 / 上限)。残り容量が最も多いプロバイダーの値","splitOut": "このコピーをマージしないでください","splitOutHint": "このプロバイダーのコピーを統合モデルにマージするのではなく、独自の別個のエントリーを与えます。 コピー自体のページからマージし直すことができます。","splitUndo": "マージバック",diff --git a/client/src/i18n/locales/ka.json b/client/src/i18n/locales/ka.jsonindex 844045bb..5cdf902e 100644--- a/client/src/i18n/locales/ka.json+++ b/client/src/i18n/locales/ka.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "ტარიფი შეზღუდულია - არ არის ფიქსირებული ყოველთვიური სიმბოლური ბიუჯეტი",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "სიხშირის ლიმიტის გამოყენება დროის ფანჯარაში (გამოყენებული / ლიმიტი) მიმწოდებელთან, რომელსაც ყველაზე მეტი მარაგი აქვს","splitOut": "არ გააერთიანოთ ეს ასლი","splitOutHint": "მიეცით ამ პროვაიდერის ასლს საკუთარი ცალკე ჩანაწერი, ნაცვლად იმისა, რომ გაერთიანებულიყო ერთიან მოდელში. შეგიძლიათ დააბრუნოთ ის ასლის საკუთარი გვერდიდან.","splitUndo": "შერწყმა უკან",diff --git a/client/src/i18n/locales/km.json b/client/src/i18n/locales/km.jsonindex b0f947bc..8b096596 100644--- a/client/src/i18n/locales/km.json+++ b/client/src/i18n/locales/km.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "កំណត់អត្រា — មិនមានថវិកាតូខិនប្រចាំខែថេរ",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "ការប្រើប្រាស់ដែនកំណត់អត្រាក្នុងវិនដូពេលវេលា (បានប្រើ / ដែនកំណត់) សម្រាប់អ្នកផ្ដល់សេវាដែលនៅសល់ច្រើនបំផុត","splitOut": "កុំបញ្ចូលច្បាប់ចម្លងនេះ។","splitOutHint": "ផ្តល់ឱ្យអ្នកផ្តល់សេវានេះចម្លងធាតុដាច់ដោយឡែករបស់វាជំនួសឱ្យការបញ្ចូលវាទៅក្នុងគំរូបង្រួបបង្រួម។ អ្នកអាចបញ្ចូលវាមកវិញពីទំព័រផ្ទាល់ខ្លួនរបស់ច្បាប់ចម្លង។","splitUndo": "បញ្ចូលគ្នាត្រឡប់មកវិញ",diff --git a/client/src/i18n/locales/kn.json b/client/src/i18n/locales/kn.jsonindex 75a1fd7b..e92d7df7 100644--- a/client/src/i18n/locales/kn.json+++ b/client/src/i18n/locales/kn.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "ದರ-ಸೀಮಿತ — ಸ್ಥಿರ ಮಾಸಿಕ ಟೋಕನ್ ಬಜೆಟ್ ಇಲ್ಲ",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "ಸಮಯ-ವಿಂಡೋ ದರ ಮಿತಿಯ ಬಳಕೆ (ಬಳಸಿದ್ದು / ಮಿತಿ), ಅತಿ ಹೆಚ್ಚು ಉಳಿಕೆ ಇರುವ ಪೂರೈಕೆದಾರರದು","splitOut": "ಈ ಪ್ರತಿಯನ್ನು ವಿಲೀನಗೊಳಿಸಬೇಡಿ","splitOutHint": "ಈ ಪೂರೈಕೆದಾರರ ನಕಲನ್ನು ಏಕೀಕೃತ ಮಾದರಿಯಲ್ಲಿ ವಿಲೀನಗೊಳಿಸುವ ಬದಲು ತನ್ನದೇ ಆದ ಪ್ರತ್ಯೇಕ ನಮೂದನ್ನು ನೀಡಿ. ನೀವು ಅದನ್ನು ನಕಲಿನ ಸ್ವಂತ ಪುಟದಿಂದ ಮತ್ತೆ ವಿಲೀನಗೊಳಿಸಬಹುದು.","splitUndo": "ಮತ್ತೆ ವಿಲೀನಗೊಳಿಸಿ",diff --git a/client/src/i18n/locales/ko.json b/client/src/i18n/locales/ko.jsonindex 65f384c0..31dc3cb3 100644--- a/client/src/i18n/locales/ko.json+++ b/client/src/i18n/locales/ko.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "비율 제한 — 고정된 월간 토큰 예산 없음",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "시간 창 속도 제한 사용량(사용 / 한도), 여유가 가장 많은 제공자 기준","splitOut": "이 사본을 병합하지 마세요","splitOutHint": "이 공급자의 사본을 통합 모델에 병합하는 대신 별도의 항목을 제공하십시오. 사본의 자체 페이지에서 다시 병합할 수 있습니다.","splitUndo": "다시 병합",diff --git a/client/src/i18n/locales/lt.json b/client/src/i18n/locales/lt.jsonindex bd846f11..62edb224 100644--- a/client/src/i18n/locales/lt.json+++ b/client/src/i18n/locales/lt.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Tarifų ribojimas — nėra fiksuoto mėnesinio žetonų biudžeto",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Spartos ribos naudojimas laiko lange (panaudota / riba) tiekėjo, turinčio daugiausia atsargos","splitOut": "Nejunkite šios kopijos","splitOutHint": "Suteikite šio teikėjo kopijai atskirą įrašą, užuot sujungę ją į vieningą modelį. Galite sujungti jį atgal iš pačios kopijos puslapio.","splitUndo": "Sujungti atgal",diff --git a/client/src/i18n/locales/ml.json b/client/src/i18n/locales/ml.jsonindex cb14d62e..f8622dd9 100644--- a/client/src/i18n/locales/ml.json+++ b/client/src/i18n/locales/ml.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "നിരക്ക്-പരിമിതം - നിശ്ചിത പ്രതിമാസ ടോക്കൺ ബജറ്റ് ഇല്ല",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "സമയ-വിൻഡോ റേറ്റ് പരിധി ഉപയോഗം (ഉപയോഗിച്ചത് / പരിധി), ഏറ്റവും കൂടുതൽ ശേഷി ബാക്കിയുള്ള ദാതാവിന്റേത്","splitOut": "ഈ പകർപ്പ് ലയിപ്പിക്കരുത്","splitOutHint": "ഈ ദാതാവിൻ്റെ പകർപ്പ് ഏകീകൃത മോഡലിലേക്ക് ലയിപ്പിക്കുന്നതിന് പകരം അതിൻ്റേതായ പ്രത്യേക എൻട്രി നൽകുക. പകർപ്പിൻ്റെ സ്വന്തം പേജിൽ നിന്ന് നിങ്ങൾക്ക് ഇത് വീണ്ടും ലയിപ്പിക്കാം.","splitUndo": "തിരികെ ലയിപ്പിക്കുക",diff --git a/client/src/i18n/locales/mr.json b/client/src/i18n/locales/mr.jsonindex 803dd840..11164582 100644--- a/client/src/i18n/locales/mr.json+++ b/client/src/i18n/locales/mr.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "दर-मर्यादित — कोणतेही निश्चित मासिक टोकन बजेट नाही",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "वेळ-विंडो दर मर्यादेचा वापर (वापरलेले / मर्यादा), सर्वाधिक शिल्लक क्षमता असलेल्या पुरवठादाराचा","splitOut": "ही प्रत एकत्र करू नका","splitOutHint": "या प्रदात्याची प्रत युनिफाइड मॉडेलमध्ये विलीन करण्याऐवजी त्याची स्वतःची स्वतंत्र नोंद द्या. तुम्ही कॉपीच्या स्वतःच्या पृष्ठावरून ते परत विलीन करू शकता.","splitUndo": "परत विलीन करा",diff --git a/client/src/i18n/locales/ms.json b/client/src/i18n/locales/ms.jsonindex aabed526..ac0e755d 100644--- a/client/src/i18n/locales/ms.json+++ b/client/src/i18n/locales/ms.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Kadar terhad — tiada bajet token bulanan tetap",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Penggunaan had kadar dalam tetingkap masa (digunakan / had) bagi penyedia dengan baki kapasiti terbanyak","splitOut": "Jangan gabungkan salinan ini","splitOutHint": "Berikan salinan pembekal ini entri berasingan sendiri dan bukannya menggabungkannya ke dalam model bersatu. Anda boleh menggabungkannya kembali dari halaman salinan itu sendiri.","splitUndo": "Gabung kembali",diff --git a/client/src/i18n/locales/my.json b/client/src/i18n/locales/my.jsonindex 80c15f8b..b3d47950 100644--- a/client/src/i18n/locales/my.json+++ b/client/src/i18n/locales/my.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "နှုန်းထားကန့်သတ် — လစဉ် တိုကင်ဘတ်ဂျက် သတ်မှတ်ထားခြင်း မရှိပါ",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "အချိန်ကာလအလိုက် နှုန်းကန့်သတ်ချက် အသုံးပြုမှု (သုံးပြီး / ကန့်သတ်)၊ ကျန်ရှိမှုအများဆုံး ဝန်ဆောင်မှုပေးသူအတွက်","splitOut": "ဤကော်ပီကို မပေါင်းပါနှင့်","splitOutHint": "ဤဝန်ဆောင်မှုပေးသူ၏ မိတ္တူကို တစ်စုတစ်စည်းတည်းပုံစံသို့ ပေါင်းစည်းမည့်အစား ၎င်း၏ကိုယ်ပိုင် သီးခြားထည့်သွင်းမှုကို ပေးပါ။ ၎င်းကို မိတ္တူ၏ကိုယ်ပိုင်စာမျက်နှာမှ ပြန်လည်ပေါင်းစည်းနိုင်သည်။","splitUndo": "ပြန်ပေါင်းစည်းပါ။",diff --git a/client/src/i18n/locales/ne.json b/client/src/i18n/locales/ne.jsonindex 41614995..7f8e0f11 100644--- a/client/src/i18n/locales/ne.json+++ b/client/src/i18n/locales/ne.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "दर-सीमित - कुनै निश्चित मासिक टोकन बजेट छैन",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "समय-विन्डो दर सीमाको प्रयोग (प्रयोग भएको / सीमा), सबैभन्दा बढी बाँकी क्षमता भएको प्रदायकको","splitOut": "यो प्रतिलिपि मर्ज नगर्नुहोस्","splitOutHint": "यस प्रदायकको प्रतिलिपिलाई एकीकृत मोडेलमा मर्ज गर्नुको सट्टा यसको आफ्नै छुट्टै प्रविष्टि दिनुहोस्। तपाइँ यसलाई प्रतिलिपिको आफ्नै पृष्ठबाट फिर्ता मर्ज गर्न सक्नुहुन्छ।","splitUndo": "फिर्ता मर्ज गर्नुहोस्",diff --git a/client/src/i18n/locales/nl.json b/client/src/i18n/locales/nl.jsonindex c426ab07..e7a3bee8 100644--- a/client/src/i18n/locales/nl.json+++ b/client/src/i18n/locales/nl.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Tariefbeperkt — geen vast maandelijks tokenbudget",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Rate-limitgebruik binnen het tijdvenster (gebruikt / limiet) van de provider met de meeste ruimte","splitOut": "Voeg deze kopie niet samen","splitOutHint": "Geef de kopie van deze provider een eigen afzonderlijke vermelding in plaats van deze samen te voegen in het uniforme model. U kunt het weer samenvoegen vanaf de eigen pagina van de kopie.","splitUndo": "Terug samenvoegen",diff --git a/client/src/i18n/locales/no.json b/client/src/i18n/locales/no.jsonindex 9bf01357..9a3115b7 100644--- a/client/src/i18n/locales/no.json+++ b/client/src/i18n/locales/no.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Rentebegrenset — ingen fast månedlig tokenbudsjett",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Bruk av hastighetsgrense i tidsvinduet (brukt / grense) for leverandøren med mest ledig kapasitet","splitOut": "Ikke slå sammen denne kopien","splitOutHint": "Gi denne leverandørens kopi sin egen separate oppføring i stedet for å slå den sammen til den enhetlige modellen. Du kan flette den tilbake fra kopiens egen side.","splitUndo": "Slå sammen tilbake",diff --git a/client/src/i18n/locales/or.json b/client/src/i18n/locales/or.jsonindex 769d6091..f0605684 100644--- a/client/src/i18n/locales/or.json+++ b/client/src/i18n/locales/or.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "ହାର-ସୀମିତ - କୌଣସି ସ୍ଥିର ମାସିକ ଟୋକେନ୍ ବଜେଟ୍ ନାହିଁ",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "ସମୟ-ୱିଣ୍ଡୋ ହାର ସୀମାର ବ୍ୟବହାର (ବ୍ୟବହୃତ / ସୀମା), ସର୍ବାଧିକ ଅବଶିଷ୍ଟ କ୍ଷମତା ଥିବା ପ୍ରଦାତାଙ୍କର","splitOut": "ଏହି କପି ମିଶ୍ରଣ କରନ୍ତୁ ନାହିଁ |","splitOutHint": "ୟୁନିଫାଏଡ୍ ମଡେଲରେ ମିଶ୍ରଣ କରିବା ପରିବର୍ତ୍ତେ ଏହି ପ୍ରଦାନକାରୀଙ୍କ କପିକୁ ନିଜର ପୃଥକ ପ୍ରବେଶ ଦିଅନ୍ତୁ | ଆପଣ ଏହାକୁ କପି ର ନିଜ ପୃଷ୍ଠାରୁ ପୁନର୍ବାର ମିଶ୍ରଣ କରିପାରିବେ |","splitUndo": "ପୁନର୍ବାର ମିଶ୍ରଣ କରନ୍ତୁ |",diff --git a/client/src/i18n/locales/pa.json b/client/src/i18n/locales/pa.jsonindex 7cd0085c..3136d825 100644--- a/client/src/i18n/locales/pa.json+++ b/client/src/i18n/locales/pa.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "ਦਰ-ਸੀਮਤ — ਕੋਈ ਨਿਸ਼ਚਿਤ ਮਾਸਿਕ ਟੋਕਨ ਬਜਟ ਨਹੀਂ",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "ਸਮਾਂ-ਵਿੰਡੋ ਦਰ ਸੀਮਾ ਦੀ ਵਰਤੋਂ (ਵਰਤੀ / ਸੀਮਾ), ਸਭ ਤੋਂ ਵੱਧ ਬਚੀ ਸਮਰੱਥਾ ਵਾਲੇ ਪ੍ਰਦਾਤਾ ਦੀ","splitOut": "ਇਸ ਕਾਪੀ ਨੂੰ ਮਿਲਾਓ ਨਾ","splitOutHint": "ਇਸ ਪ੍ਰਦਾਤਾ ਦੀ ਕਾਪੀ ਨੂੰ ਯੂਨੀਫਾਈਡ ਮਾਡਲ ਵਿੱਚ ਮਿਲਾਉਣ ਦੀ ਬਜਾਏ ਇਸਦੀ ਆਪਣੀ ਵੱਖਰੀ ਐਂਟਰੀ ਦਿਓ। ਤੁਸੀਂ ਇਸਨੂੰ ਕਾਪੀ ਦੇ ਆਪਣੇ ਪੰਨੇ ਤੋਂ ਵਾਪਸ ਮਿਲਾ ਸਕਦੇ ਹੋ।","splitUndo": "ਵਾਪਸ ਮਿਲਾਓ",diff --git a/client/src/i18n/locales/pl.json b/client/src/i18n/locales/pl.jsonindex 82bfd147..462f1384 100644--- a/client/src/i18n/locales/pl.json+++ b/client/src/i18n/locales/pl.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Ograniczona stawka — brak stałego miesięcznego budżetu na tokeny",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Wykorzystanie limitu szybkości w oknie czasowym (użyte / limit) dla dostawcy z największym zapasem","splitOut": "Nie łącz tej kopii","splitOutHint": "Daj kopii tego dostawcy własny, oddzielny wpis, zamiast łączyć ją w ujednolicony model. Możesz scalić go z powrotem z własnej strony kopii.","splitUndo": "Połącz z powrotem",diff --git a/client/src/i18n/locales/pt-BR.json b/client/src/i18n/locales/pt-BR.jsonindex 12ceb54f..a7b8d5a8 100644--- a/client/src/i18n/locales/pt-BR.json+++ b/client/src/i18n/locales/pt-BR.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Limitado por taxa: sem orçamento fixo de tokens mensal",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Uso do limite de taxa na janela de tempo (usado / limite) do provedor com mais folga","splitOut": "Não mesclar esta cópia","splitOutHint": "Dá à cópia deste provedor uma entrada separada em vez de mesclá-la no modelo unificado. Você pode mesclá-la de volta na página da própria cópia.","splitUndo": "Mesclar de volta",diff --git a/client/src/i18n/locales/pt-PT.json b/client/src/i18n/locales/pt-PT.jsonindex 5e394d07..2abc792c 100644--- a/client/src/i18n/locales/pt-PT.json+++ b/client/src/i18n/locales/pt-PT.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Taxa limitada — sem orçamento mensal fixo para tokens",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Utilização do limite de taxa na janela de tempo (usado / limite) do fornecedor com mais margem","splitOut": "Não mescle esta cópia","splitOutHint": "Dê à cópia deste fornecedor a sua própria entrada separada em vez de a fundir no modelo unificado. Pode mesclá-lo na própria página da cópia.","splitUndo": "Mesclar de volta",diff --git a/client/src/i18n/locales/ro.json b/client/src/i18n/locales/ro.jsonindex 997c49ca..b68af596 100644--- a/client/src/i18n/locales/ro.json+++ b/client/src/i18n/locales/ro.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Limitat de rată — fără buget lunar fix pentru tokenuri",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Utilizarea limitei de rată pe fereastra de timp (utilizat / limită) pentru furnizorul cu cea mai mare marjă","splitOut": "Nu îmbina această copie","splitOutHint": "Dați copiei acestui furnizor propria intrare separată în loc să o îmbinați în modelul unificat. Îl puteți îmbina din nou din propria pagină a copiei.","splitUndo": "Îmbinați înapoi",diff --git a/client/src/i18n/locales/ru.json b/client/src/i18n/locales/ru.jsonindex ec9bb3fd..0b0d81c8 100644--- a/client/src/i18n/locales/ru.json+++ b/client/src/i18n/locales/ru.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Ограничено по ставке — нет фиксированного ежемесячного бюджета токенов",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Использование лимита частоты во временном окне (использовано / лимит) у провайдера с наибольшим запасом","splitOut": "Не объединять эту копию","splitOutHint": "Сделайте копию этого провайдера отдельной записью вместо того, чтобы объединять ее в единую модель. Вы можете объединить его обратно с собственной страницы копии.","splitUndo": "Объединить обратно",diff --git a/client/src/i18n/locales/si.json b/client/src/i18n/locales/si.jsonindex 429dad48..f7c6a144 100644--- a/client/src/i18n/locales/si.json+++ b/client/src/i18n/locales/si.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "ගාස්තු-සීමිත - ස්ථාවර මාසික ටෝකන් අයවැයක් නැත",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "කාල කවුළුවේ අනුපාත සීමා භාවිතය (භාවිත / සීමාව), වැඩිම ඉඩ ඉතිරි ඇති සැපයුම්කරුගේ","splitOut": "මෙම පිටපත ඒකාබද්ධ නොකරන්න","splitOutHint": "මෙම සැපයුම්කරුගේ පිටපත ඒකාබද්ධ ආකෘතියට ඒකාබද්ධ කිරීම වෙනුවට එහි වෙනම ප්රවේශයක් ලබා දෙන්න. ඔබට එය පිටපතෙහිම පිටුවෙන් නැවත ඒකාබද්ධ කළ හැක.","splitUndo": "නැවත ඒකාබද්ධ කරන්න",diff --git a/client/src/i18n/locales/sk.json b/client/src/i18n/locales/sk.jsonindex b40fb6a1..b7a25bdb 100644--- a/client/src/i18n/locales/sk.json+++ b/client/src/i18n/locales/sk.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Obmedzené sadzby — žiadny pevný mesačný rozpočet tokenov",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Využitie limitu rýchlosti v časovom okne (využité / limit) u poskytovateľa s najväčšou rezervou","splitOut": "Nezlučujte túto kópiu","splitOutHint": "Dajte kópii tohto poskytovateľa vlastný samostatný záznam namiesto toho, aby ste ju zlúčili do jednotného modelu. Môžete ho zlúčiť späť z vlastnej stránky kópie.","splitUndo": "Zlúčiť späť",diff --git a/client/src/i18n/locales/sr.json b/client/src/i18n/locales/sr.jsonindex 5369ce4f..57e66fc9 100644--- a/client/src/i18n/locales/sr.json+++ b/client/src/i18n/locales/sr.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Ограничено на стопу — нема фиксног месечног буџета за токене",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Искоришћеност ограничења брзине у временском прозору (искоришћено / ограничење) код добављача са највише резерве","splitOut": "Немојте спајати ову копију","splitOutHint": "Дајте копији овог добављача посебан унос уместо да је спајате у јединствени модел. Можете га поново спојити са сопствене странице копије.","splitUndo": "Споји назад",diff --git a/client/src/i18n/locales/sv.json b/client/src/i18n/locales/sv.jsonindex a0cb8908..af9b3748 100644--- a/client/src/i18n/locales/sv.json+++ b/client/src/i18n/locales/sv.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Prisbegränsad – ingen fast månatlig tokenbudget",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Hastighetsgränsanvändning i tidsfönstret (använt / gräns) för leverantören med mest marginal","splitOut": "Slå inte samman denna kopia","splitOutHint": "Ge denna leverantörs kopia en egen separat post istället för att slå samman den i den enhetliga modellen. Du kan slå tillbaka den från kopians egen sida.","splitUndo": "Slå ihop tillbaka",diff --git a/client/src/i18n/locales/sw.json b/client/src/i18n/locales/sw.jsonindex 1563f6af..d640ccae 100644--- a/client/src/i18n/locales/sw.json+++ b/client/src/i18n/locales/sw.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Viwango-vidogo - hakuna bajeti maalum ya kila mwezi ya tokeni",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Matumizi ya kikomo cha kasi katika dirisha la muda (kilichotumika / kikomo) kwa mtoa huduma mwenye nafasi zaidi","splitOut": "Usiunganishe nakala hii","splitOutHint": "Ipe nakala ya mtoa huduma huyu ingizo lake tofauti badala ya kuiunganisha katika muundo uliounganishwa. Unaweza kuiunganisha kutoka kwa ukurasa wa nakala yenyewe.","splitUndo": "Unganisha nyuma",diff --git a/client/src/i18n/locales/ta.json b/client/src/i18n/locales/ta.jsonindex dcfa0f81..e6daed2f 100644--- a/client/src/i18n/locales/ta.json+++ b/client/src/i18n/locales/ta.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "விகிதம் வரையறுக்கப்பட்ட - நிலையான மாதாந்திர டோக்கன் பட்ஜெட் இல்லை",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "நேர சாளர வீத வரம்பு பயன்பாடு (பயன்படுத்தியது / வரம்பு), அதிக இடம் மீதமுள்ள வழங்குநரின்","splitOut": "இந்த நகலை ஒன்றிணைக்க வேண்டாம்","splitOutHint": "இந்த வழங்குநரின் நகலை ஒருங்கிணைக்கப்பட்ட மாதிரியுடன் இணைப்பதற்குப் பதிலாக அதன் சொந்த தனி உள்ளீட்டைக் கொடுங்கள். நகலின் சொந்தப் பக்கத்திலிருந்து நீங்கள் அதை மீண்டும் இணைக்கலாம்.","splitUndo": "மீண்டும் ஒன்றிணைக்கவும்",diff --git a/client/src/i18n/locales/te.json b/client/src/i18n/locales/te.jsonindex adca3533..06dec7b8 100644--- a/client/src/i18n/locales/te.json+++ b/client/src/i18n/locales/te.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "రేట్-పరిమితం — స్థిర నెలవారీ టోకెన్ బడ్జెట్ లేదు",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "సమయ విండో రేటు పరిమితి వినియోగం (వాడినది / పరిమితి), అత్యధిక మిగులు ఉన్న ప్రొవైడర్ది","splitOut": "ఈ కాపీని విలీనం చేయవద్దు","splitOutHint": "ఈ ప్రొవైడర్ కాపీని ఏకీకృత మోడల్లో విలీనం చేయడానికి బదులుగా దాని స్వంత ప్రత్యేక ఎంట్రీని ఇవ్వండి. మీరు దానిని కాపీ స్వంత పేజీ నుండి తిరిగి విలీనం చేయవచ్చు.","splitUndo": "తిరిగి విలీనం చేయండి",diff --git a/client/src/i18n/locales/th.json b/client/src/i18n/locales/th.jsonindex 61642126..038201de 100644--- a/client/src/i18n/locales/th.json+++ b/client/src/i18n/locales/th.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "จำกัดอัตรา — ไม่มีงบประมาณโทเค็นรายเดือนคงที่",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "การใช้งานขีดจำกัดอัตราในช่วงเวลา (ใช้ไป / ขีดจำกัด) ของผู้ให้บริการที่เหลือโควตามากที่สุด","splitOut": "อย่ารวมสำเนานี้","splitOutHint": "มอบสำเนาของผู้ให้บริการรายนี้ให้รายการแยกต่างหาก แทนที่จะรวมเข้ากับโมเดลแบบรวม คุณสามารถรวมกลับได้จากหน้าสำเนาของตัวเอง","splitUndo": "รวมกลับ",diff --git a/client/src/i18n/locales/tl.json b/client/src/i18n/locales/tl.jsonindex e8369600..795f1abc 100644--- a/client/src/i18n/locales/tl.json+++ b/client/src/i18n/locales/tl.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Rate-limited — walang fixed na buwanang token budget",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Paggamit ng rate limit sa loob ng time window (nagamit / limit) para sa provider na may pinakamalaking natitirang puwang","splitOut": "Huwag pagsamahin ang kopyang ito","splitOutHint": "Bigyan ang kopya ng provider na ito ng sarili nitong hiwalay na entry sa halip na isama ito sa pinag-isang modelo. Maaari mo itong muling isama mula sa sariling pahina ng kopya.","splitUndo": "Pagsamahin muli",diff --git a/client/src/i18n/locales/tr.json b/client/src/i18n/locales/tr.jsonindex 3ebb0e2b..e549bcc9 100644--- a/client/src/i18n/locales/tr.json+++ b/client/src/i18n/locales/tr.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Oran sınırlı — sabit aylık token bütçesi yok",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Zaman penceresi hız sınırı kullanımı (kullanılan / sınır), en fazla boşluğu olan sağlayıcı","splitOut": "Bu kopyayı birleştirme","splitOutHint": "Bu sağlayıcının kopyasına, birleşik modelle birleştirmek yerine kendi ayrı girişini verin. Kopyanın kendi sayfasından tekrar birleştirebilirsiniz.","splitUndo": "Geri birleştir",diff --git a/client/src/i18n/locales/uk.json b/client/src/i18n/locales/uk.jsonindex 5a27e18e..1581e560 100644--- a/client/src/i18n/locales/uk.json+++ b/client/src/i18n/locales/uk.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Обмежений тариф — без фіксованого щомісячного бюджету токенів",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Використання ліміту частоти в часовому вікні (використано / ліміт) у постачальника з найбільшим запасом","splitOut": "Не об’єднуйте цю копію","splitOutHint": "Надайте копії цього постачальника окремий запис замість того, щоб об’єднати її в уніфіковану модель. Ви можете об’єднати його назад із власної сторінки копії.","splitUndo": "Об'єднати назад",diff --git a/client/src/i18n/locales/ur.json b/client/src/i18n/locales/ur.jsonindex 1f8d89d4..80aa9841 100644--- a/client/src/i18n/locales/ur.json+++ b/client/src/i18n/locales/ur.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "شرح محدود - کوئی مقررہ ماہانہ ٹوکن بجٹ نہیں۔",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "وقتی ونڈو کی شرح حد کا استعمال (استعمال شدہ / حد)، سب سے زیادہ گنجائش والے فراہم کنندہ کا","splitOut": "اس کاپی کو ضم نہ کریں۔","splitOutHint": "اس فراہم کنندہ کی کاپی کو یونیفائیڈ ماڈل میں ضم کرنے کے بجائے اس کا اپنا الگ اندراج دیں۔ آپ اسے کاپی کے اپنے صفحہ سے واپس ضم کر سکتے ہیں۔","splitUndo": "واپس ضم کریں۔",diff --git a/client/src/i18n/locales/uz.json b/client/src/i18n/locales/uz.jsonindex 8b08c655..f9078a26 100644--- a/client/src/i18n/locales/uz.json+++ b/client/src/i18n/locales/uz.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Cheklangan tarif - oylik token byudjeti yo'q",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Vaqt oynasidagi tezlik cheklovi sarfi (ishlatilgan / chek), eng ko‘p zaxirasi bor provayder bo‘yicha","splitOut": "Bu nusxani birlashtirmang","splitOutHint": "Ushbu provayderning nusxasini birlashtirilgan modelga birlashtirish o'rniga o'zining alohida yozuvini bering. Siz uni nusxaning shaxsiy sahifasidan birlashtira olasiz.","splitUndo": "Orqaga birlashing",diff --git a/client/src/i18n/locales/vi.json b/client/src/i18n/locales/vi.jsonindex 646e3cb5..d5a78c46 100644--- a/client/src/i18n/locales/vi.json+++ b/client/src/i18n/locales/vi.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Tỷ lệ giới hạn - không có ngân sách mã thông báo cố định hàng tháng",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Mức dùng giới hạn tốc độ theo cửa sổ thời gian (đã dùng / giới hạn) của nhà cung cấp còn nhiều dư địa nhất","splitOut": "Không hợp nhất bản sao này","splitOutHint": "Cung cấp cho bản sao của nhà cung cấp này một mục nhập riêng thay vì hợp nhất nó vào mô hình thống nhất. Bạn có thể hợp nhất nó lại từ trang riêng của bản sao.","splitUndo": "Hợp nhất lại",diff --git a/client/src/i18n/locales/yo.json b/client/src/i18n/locales/yo.jsonindex 714016e5..38db5d88 100644--- a/client/src/i18n/locales/yo.json+++ b/client/src/i18n/locales/yo.json@@ -230,6 +230,8 @@"rateRpm": "{count} RPM","rateRpd": "{count} RPD","rateTitle": "Oṣuwọn-opin - ko si isuna ti oṣooṣu tokini ti o wa titi",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "Lílo ààlà ìwọ̀n nínú fèrèsé àkókò (tí a lò / ààlà) fún olùpèsè tí ó ní àyè tó pọ̀ jù","splitOut": "Maṣe da ẹda yii pọ","splitOutHint": "Fun ẹda olupese yii ni titẹ sii lọtọ tirẹ dipo ti o dapọ mọ awoṣe iṣọkan. O le dapọ mọ pada lati oju-iwe ti ẹda naa.","splitUndo": "Dapọ pada",diff --git a/client/src/i18n/locales/zh-CN.json b/client/src/i18n/locales/zh-CN.jsonindex daaccc25..93e36e31 100644--- a/client/src/i18n/locales/zh-CN.json+++ b/client/src/i18n/locales/zh-CN.json@@ -230,6 +230,8 @@"rateRpm": "{count} 请求/分钟","rateRpd": "{count} 请求/日","rateTitle": "按速率限制——无固定的每月词元额度",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "时间窗口内的速率限制用量(已用 / 上限),取剩余额度最多的提供方","splitOut": "不合并此副本","splitOutHint": "让该提供方的副本作为独立条目显示,而不并入统一模型。可在该副本自己的页面上重新合并。","splitUndo": "重新合并",diff --git a/client/src/i18n/locales/zh-TW.json b/client/src/i18n/locales/zh-TW.jsonindex 03907835..b25ddec5 100644--- a/client/src/i18n/locales/zh-TW.json+++ b/client/src/i18n/locales/zh-TW.json@@ -230,6 +230,8 @@"rateRpm": "{count} 請求/分鐘","rateRpd": "{count} 請求/日","rateTitle": "按速率限制——無固定的每月 Token 額度",+ "rateLimitUsage": "{kind} {used}/{limit}",+ "rateLimitUsageTitle": "時間視窗內的速率限制用量(已用 / 上限),取剩餘額度最多的供應商","splitOut": "不合併此副本","splitOutHint": "讓該提供者的副本作為獨立項目顯示,而不併入統一模型。可在該副本自己的頁面上重新合併。","splitUndo": "重新合併",diff --git a/client/src/lib/routing.test.ts b/client/src/lib/routing.test.tsindex 8af8e3f5..18d0c362 100644--- a/client/src/lib/routing.test.ts+++ b/client/src/lib/routing.test.ts@@ -6,6 +6,8 @@ import {memberProviderLabel,providerPinId,splitsWithoutMember,+ tightestRateLimit,+ type RateLimitUsageRow,} from './routing'// Per-endpoint identity must be INVISIBLE until two endpoints actually serve the@@ -164,3 +166,97 @@ describe('pre-#651 split overrides stay undoable', () => {expect(isMemberSplit([{ member: 'groq:llama-3.3-70b' }], catalog)).toBe(true)})})++// ── Group-level rate-limit badge (#876, #921 follow-up) ──────────────────────+// The badge means "how close is this logical model to being unusable". A model+// is unusable only when EVERY provider serving it is out of headroom, so the+// group number follows the BEST member. Taking the worst member painted a+// five-provider group red the moment one provider ran dry.++function usageRow(modelDbId: number, w: Partial<Pick<RateLimitUsageRow, 'rpm' | 'rpd' | 'tpm'>> = {}): RateLimitUsageRow {+ return {+ modelDbId,+ platform: 'p' + modelDbId,+ modelId: 'm' + modelDbId,+ rpm: w.rpm ?? null,+ rpd: w.rpd ?? null,+ tpm: w.tpm ?? null,+ }+}++describe('tightestRateLimit', () => {+ it('returns null with no rows at all', () => {+ expect(tightestRateLimit([])).toBeNull()+ })++ it('returns null when every window is idle (no badge for an unused model)', () => {+ expect(tightestRateLimit([usageRow(1, { rpm: { used: 0, limit: 30 } })])).toBeNull()+ })++ it('returns null when rows carry no windows at all (model has no limits)', () => {+ expect(tightestRateLimit([usageRow(1)])).toBeNull()+ })++ it('reports a single member as-is', () => {+ expect(tightestRateLimit([usageRow(1, { rpm: { used: 21, limit: 30 } })]))+ .toEqual({ kind: 'RPM', used: 21, limit: 30 })+ })++ it('within one member picks the TIGHTEST window (that member is blocked by it)', () => {+ const row = usageRow(1, {+ rpm: { used: 3, limit: 30 }, // 10%+ rpd: { used: 900, limit: 1000 }, // 90% ← binding+ tpm: { used: 100, limit: 1000 }, // 10%+ })+ expect(tightestRateLimit([row])).toEqual({ kind: 'RPD', used: 900, limit: 1000 })+ })++ it('across a group picks the member with the MOST headroom, not the exhausted one', () => {+ const exhausted = usageRow(1, { rpm: { used: 30, limit: 30 } })+ const easy = usageRow(2, { rpm: { used: 2, limit: 30 } })+ expect(tightestRateLimit([exhausted, easy])).toEqual({ kind: 'RPM', used: 2, limit: 30 })+ })++ it('one exhausted provider out of five does not decide the badge', () => {+ const rows = [+ usageRow(1, { rpd: { used: 1000, limit: 1000 } }),+ usageRow(2, { rpd: { used: 10, limit: 1000 } }),+ usageRow(3, { rpd: { used: 50, limit: 1000 } }),+ usageRow(4, { rpd: { used: 5, limit: 1000 } }),+ usageRow(5, { rpd: { used: 400, limit: 1000 } }),+ ]+ expect(tightestRateLimit(rows)).toEqual({ kind: 'RPD', used: 5, limit: 1000 })+ })++ it('goes red only when every member is exhausted', () => {+ const rows = [+ usageRow(1, { rpm: { used: 30, limit: 30 } }),+ usageRow(2, { rpm: { used: 60, limit: 60 } }),+ ]+ const tight = tightestRateLimit(rows)!+ expect(tight.used / tight.limit).toBe(1)+ })++ it('a fully idle member wins over a busy one and suppresses the badge', () => {+ const rows = [+ usageRow(1, { rpm: { used: 29, limit: 30 } }),+ usageRow(2, { rpm: { used: 0, limit: 30 } }),+ ]+ expect(tightestRateLimit(rows)).toBeNull()+ })++ it('ignores a zero limit rather than dividing by it', () => {+ const rows = [usageRow(1, { rpm: { used: 5, limit: 0 } })]+ expect(tightestRateLimit(rows)).toBeNull()+ })++ it('compares members by ratio, not by raw counts', () => {+ // 500/100000 (0.5%) has far more headroom than 8/10 (80%), despite the+ // bigger absolute number.+ const rows = [+ usageRow(1, { rpm: { used: 8, limit: 10 } }),+ usageRow(2, { tpm: { used: 500, limit: 100_000 } }),+ ]+ expect(tightestRateLimit(rows)).toEqual({ kind: 'TPM', used: 500, limit: 100_000 })+ })+})diff --git a/client/src/lib/routing.ts b/client/src/lib/routing.tsindex 864dec78..4c18207e 100644--- a/client/src/lib/routing.ts+++ b/client/src/lib/routing.ts@@ -296,6 +296,74 @@ export function groupQuotaBadge(return null}+// ── Remaining time-window quota (#876) ───────────────────────────────────────+// Server-reported per-model RPM/RPD/TPM usage, served by+// GET /api/fallback/rate-limit-usage. Each row already reflects the key the+// router would pick next for that model (the routable key with the most+// headroom), so the client only has to aggregate across a group's members.++export interface RateLimitWindow {+ used: number+ limit: number+}++export interface RateLimitUsageRow {+ modelDbId: number+ platform: string+ modelId: string+ rpm: RateLimitWindow | null+ rpd: RateLimitWindow | null+ tpm: RateLimitWindow | null+}++export interface RateLimitUsageData {+ generatedAtMs: number+ rows: RateLimitUsageRow[]+}++export type RateLimitKind = 'RPM' | 'RPD' | 'TPM'++// The badge answers one question: how close is this logical model to being+// unusable? A group is unusable only when EVERY provider serving it is out of+// headroom, so the group-level number is the BEST member, not the worst — a+// five-provider group with one exhausted provider and four idle ones routes+// perfectly well and must not show red.+//+// Within a single member the opposite holds: that member is blocked by its+// TIGHTEST window, so its own pressure is the max ratio across RPM/RPD/TPM.+// Returns null when there is no data, or when nothing has been used yet (an+// idle model gets no badge rather than a "0/30" that reads as a warning).+export function tightestRateLimit(+ rows: RateLimitUsageRow[],+): { kind: RateLimitKind; used: number; limit: number } | null {+ let best: { kind: RateLimitKind; used: number; limit: number } | null = null+ let bestRatio = Infinity+ for (const row of rows) {+ const windows: { kind: RateLimitKind; used: number; limit: number }[] = []+ if (row.rpm) windows.push({ kind: 'RPM', ...row.rpm })+ if (row.rpd) windows.push({ kind: 'RPD', ...row.rpd })+ if (row.tpm) windows.push({ kind: 'TPM', ...row.tpm })+ // This member's own binding constraint.+ let tight: { kind: RateLimitKind; used: number; limit: number } | null = null+ let tightRatio = 0+ for (const w of windows) {+ const ratio = w.limit > 0 ? w.used / w.limit : 0+ if (tight === null || ratio > tightRatio) {+ tightRatio = ratio+ tight = w+ }+ }+ if (!tight) continue+ if (tightRatio < bestRatio) {+ bestRatio = tightRatio+ best = tight+ }+ }+ // bestRatio === 0 means every provider is idle: no badge, same as no data.+ if (!best || bestRatio <= 0) return null+ return best+}+export const platformColors: Record<string, string> = {google: '#4285f4',groq: '#f55036',diff --git a/client/src/pages/FallbackPage.tsx b/client/src/pages/FallbackPage.tsxindex 6a018f15..f3336cfe 100644--- a/client/src/pages/FallbackPage.tsx+++ b/client/src/pages/FallbackPage.tsx@@ -1,4 +1,4 @@-import { useEffect, useRef, useState } from 'react'+import { useEffect, useMemo, useRef, useState } from 'react'import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'import {DndContext,@@ -24,6 +24,7 @@ import {groupMaxContext,type FallbackEntry,type ModelGroupRow,+ type RateLimitUsageData,type RoutingData,type RoutingStrategy,type RoutingWeights,@@ -98,6 +99,19 @@ export default function FallbackPage() {refetchInterval: 15_000,})+ // Time-window rate-limit usage (#876). One observer and one poll timer for the+ // whole table — the row component reads it from a map instead of subscribing+ // per row, which on a large catalog was hundreds of observers and timers.+ const { data: rateLimitUsage } = useQuery<RateLimitUsageData>({+ queryKey: ['fallback', 'rate-limit-usage'],+ queryFn: () => apiFetch('/api/fallback/rate-limit-usage'),+ refetchInterval: 15_000,+ })+ const rateUsageByModel = useMemo(+ () => new Map((rateLimitUsage?.rows ?? []).map(r => [r.modelDbId, r])),+ [rateLimitUsage],+ )+const saveMutation = useMutation({mutationFn: (data: { modelDbId: number; priority: number; enabled: boolean }[]) =>apiFetch('/api/fallback', { method: 'PUT', body: JSON.stringify(data) }),@@ -417,7 +431,7 @@ export default function FallbackPage() {<SortableContext items={renderedGroups.map(g => `grp:${g.key}`)} strategy={verticalListSortingStrategy}><tbody>{renderedGroups.map(g => (- <SortableGroupRow key={g.key} group={g} rank={rankByKey.get(g.key) ?? 0} onToggleGroup={handleGroupToggle} allRows={rows} />+ <SortableGroupRow key={g.key} group={g} rank={rankByKey.get(g.key) ?? 0} onToggleGroup={handleGroupToggle} allRows={rows} rateUsage={rateUsageByModel} />))}</tbody></SortableContext>@@ -435,7 +449,7 @@ export default function FallbackPage() {onClick={() => navigate(`/models/chat/${encodeURIComponent(g.members[0].canonicalId ?? g.members[0].modelId)}`)}className={`group/row border-b last:border-0 cursor-pointer transition-colors hover:[&>td]:bg-muted/50 [&>td:first-child]:rounded-l-lg [&>td:last-child]:rounded-r-lg ${g.members.some(m => m.enabled) ? '' : 'opacity-50'}`}>- <GroupHeaderCells group={g} rank={rankByKey.get(g.key) ?? 0} onToggleGroup={handleGroupToggle} allRows={rows} />+ <GroupHeaderCells group={g} rank={rankByKey.get(g.key) ?? 0} onToggleGroup={handleGroupToggle} allRows={rows} rateUsage={rateUsageByModel} /></tr>))}</tbody>diff --git a/server/src/__tests__/routes/fallback-rate-limit-usage.test.ts b/server/src/__tests__/routes/fallback-rate-limit-usage.test.tsnew file mode 100644index 00000000..af8057b3--- /dev/null+++ b/server/src/__tests__/routes/fallback-rate-limit-usage.test.ts@@ -0,0 +1,155 @@+// GET /api/fallback/rate-limit-usage (#876) must answer "how close is this model+// to being unroutable", which means following the key the ROUTER would pick next+// — not the busiest key on the account. Reporting the busiest one paints a red+// badge over a model that has an idle key sitting right there, and counting a+// key the router would never touch (scoped away, disabled, unhealthy) is wrong+// in both directions.+import { describe, it, expect, beforeAll, beforeEach } from 'vitest';+import type { Express } from 'express';+import { createApp } from '../../app.js';+import { getDb, initDb } from '../../db/index.js';+import { encrypt } from '../../lib/crypto.js';+import { mintDashboardToken } from '../helpers/auth.js';++const PLATFORM = 'groq';+const MODEL_ID = 'rate-usage-probe';+const RPM_LIMIT = 30;++let dashToken = '';++async function get(app: Express, path: string) {+ const server = app.listen(0, '127.0.0.1');+ if (!server.listening) await new Promise<void>(resolve => server.once('listening', () => resolve()));+ const addr = server.address() as any;+ const res = await fetch(`http://127.0.0.1:${addr.port}${path}`, {+ headers: { Authorization: `Bearer ${dashToken}` },+ });+ const body = await res.json().catch(() => null);+ server.close();+ return { status: res.status, body };+}++function addKey(label: string, opts: { enabled?: number; status?: string; scope?: string[] | null } = {}): number {+ const db = getDb();+ const secret = encrypt(`secret-${label}`);+ const info = db.prepare(`+ INSERT INTO api_keys (platform, label, encrypted_key, iv, auth_tag, status, enabled, model_scope_json)+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)+ `).run(+ PLATFORM, label, secret.encrypted, secret.iv, secret.authTag,+ opts.status ?? 'healthy',+ opts.enabled ?? 1,+ opts.scope ? JSON.stringify(opts.scope) : null,+ );+ return Number(info.lastInsertRowid);+}++/** N recorded requests for (model, key) inside the current minute. */+function burnRequests(keyId: number, count: number) {+ const db = getDb();+ const now = Date.now();+ const stmt = db.prepare(`+ INSERT INTO rate_limit_usage (platform, model_id, key_id, kind, tokens, created_at_ms)+ VALUES (?, ?, ?, 'request', 0, ?)+ `);+ for (let i = 0; i < count; i++) stmt.run(PLATFORM, MODEL_ID, keyId, now - i);+}++async function probeRow(app: Express) {+ const { status, body } = await get(app, '/api/fallback/rate-limit-usage');+ expect(status).toBe(200);+ return body.rows.find((r: any) => r.modelId === MODEL_ID);+}++describe('GET /api/fallback/rate-limit-usage', () => {+ let app: Express;+ let modelDbId: number;++ beforeAll(() => {+ process.env.ENCRYPTION_KEY = '0'.repeat(64);+ initDb(':memory:');+ app = createApp();+ dashToken = mintDashboardToken();+ const db = getDb();+ const info = db.prepare(`+ INSERT INTO models (platform, model_id, display_name, intelligence_rank, speed_rank,+ monthly_token_budget, rpm_limit, enabled)+ VALUES (?, ?, 'Rate Usage Probe', 1, 1, 'unlimited', ?, 1)+ `).run(PLATFORM, MODEL_ID, RPM_LIMIT);+ modelDbId = Number(info.lastInsertRowid);+ });++ beforeEach(() => {+ const db = getDb();+ db.prepare('DELETE FROM rate_limit_usage').run();+ db.prepare('DELETE FROM api_keys WHERE platform = ?').run(PLATFORM);+ });++ it('reports the key with the most headroom, not the busiest one', async () => {+ const exhausted = addKey('exhausted');+ addKey('idle');+ burnRequests(exhausted, RPM_LIMIT);++ const row = await probeRow(app);+ // The idle key can serve the next request, so the badge must stay low.+ expect(row.rpm).toEqual({ used: 0, limit: RPM_LIMIT });+ });++ it('goes to the ceiling only when every routable key is exhausted', async () => {+ const a = addKey('a');+ const b = addKey('b');+ burnRequests(a, RPM_LIMIT);+ burnRequests(b, RPM_LIMIT);++ const row = await probeRow(app);+ expect(row.rpm).toEqual({ used: RPM_LIMIT, limit: RPM_LIMIT });+ });++ it('ignores a key whose model scope excludes this model (#657)', async () => {+ // The free key is scoped to a different model, so the router can never reach+ // it; the only key that can serve this model is spent. Counting the scoped+ // key would report a comfortable 0/30 for a model that cannot be served.+ addKey('scoped-elsewhere', { scope: ['some-other-model'] });+ const usable = addKey('usable');+ burnRequests(usable, RPM_LIMIT);++ const row = await probeRow(app);+ expect(row.rpm).toEqual({ used: RPM_LIMIT, limit: RPM_LIMIT });+ });++ it('counts a scoped key that DOES list this model', async () => {+ const scopedIn = addKey('scoped-in', { scope: [MODEL_ID] });+ const other = addKey('other');+ burnRequests(other, RPM_LIMIT);+ burnRequests(scopedIn, 3);++ const row = await probeRow(app);+ expect(row.rpm).toEqual({ used: 3, limit: RPM_LIMIT });+ });++ it('ignores disabled and unhealthy keys', async () => {+ addKey('disabled', { enabled: 0 });+ addKey('errored', { status: 'error' });+ const usable = addKey('usable');+ burnRequests(usable, 9);++ const row = await probeRow(app);+ expect(row.rpm).toEqual({ used: 9, limit: RPM_LIMIT });+ });++ it('reports no windows when the platform has no routable key at all', async () => {+ const row = await probeRow(app);+ expect(row.rpm).toBeNull();+ expect(row.rpd).toBeNull();+ expect(row.tpm).toBeNull();+ });++ it('omits windows the model has no limit for', async () => {+ addKey('solo');+ const row = await probeRow(app);+ expect(row.modelDbId).toBe(modelDbId);+ expect(row.platform).toBe(PLATFORM);+ expect(row.rpd).toBeNull();+ expect(row.tpm).toBeNull();+ });+});diff --git a/server/src/routes/fallback.ts b/server/src/routes/fallback.tsindex 6dfeb524..b7c2842c 100644--- a/server/src/routes/fallback.ts+++ b/server/src/routes/fallback.ts@@ -15,6 +15,7 @@ import { getPenaltyInspector } from '../services/penalty-inspector.js';import { getActiveProfileId } from '../services/profile-models.js';import { qualifiedModelMemberId } from '../lib/endpoint-scope.js';import { overriddenFieldNames } from '../services/model-state.js';+import { parseModelScope, scopeAllows } from '../lib/model-scope.js';export const fallbackRouter = Router();@@ -437,3 +438,153 @@ fallbackRouter.get('/token-usage', (_req: Request, res: Response) => {models: modelBudgets,});});++// Per-model time-window rate-limit usage (RPM/RPD/TPM: used vs limit), for the+// dashboard's remaining-quota display (#876). The monthly-budget metric says+// nothing about windowed limits, so this surfaces what the router actually+// enforces.+//+// Which key's numbers to report matters. The badge answers "how close is this+// model to being unroutable", so it has to follow the key the router would pick+// NEXT, not the worst key on the account: a platform with one exhausted key and+// one idle key routes fine, and reporting the exhausted one paints a red badge+// over a model that is wide open. So we mirror the router's key eligibility+// (`selectKeyForModel`) — enabled + healthy/unknown, model scope allows this+// model (#657), and for a custom model the key must belong to the model's own+// endpoint (#212, #619) — and then report the ELIGIBLE key with the most+// headroom (lowest used/limit ratio across its windows), which is the key the+// router lands on once the busier ones fail their gates.+//+// Cost: the naive shape is three SQL counts per model × key, which is thousands+// of statements on a real catalog. All of it comes from one table, so the whole+// page is a single grouped scan of `rate_limit_usage` over the last day.+const RATE_LIMIT_MINUTE_MS = 60 * 1000;+const RATE_LIMIT_DAY_MS = 24 * 60 * RATE_LIMIT_MINUTE_MS;++interface KeyUsage { rpm: number; rpd: number; tpm: number }+const NO_USAGE: KeyUsage = { rpm: 0, rpd: 0, tpm: 0 };++/** used/limit for one window, or null when the model has no such limit. */+function windowRatio(used: number, limit: number | null): number | null {+ if (limit == null || limit <= 0) return null;+ return used / limit;+}++/** The busiest window of one key: what would reject this key's next request. */+function keyPressure(usage: KeyUsage, limits: { rpm: number | null; rpd: number | null; tpm: number | null }): number {+ let worst = 0;+ for (const r of [+ windowRatio(usage.rpm, limits.rpm),+ windowRatio(usage.rpd, limits.rpd),+ windowRatio(usage.tpm, limits.tpm),+ ]) {+ if (r !== null && r > worst) worst = r;+ }+ return worst;+}++fallbackRouter.get('/rate-limit-usage', (_req: Request, res: Response) => {+ const db = getDb();+ const now = Date.now();++ const models = db.prepare(`+ SELECT id AS model_db_id, platform, model_id, key_id, rpm_limit, rpd_limit, tpm_limit+ FROM models+ WHERE enabled = 1+ `).all() as Array<{+ model_db_id: number;+ platform: string;+ model_id: string;+ key_id: number | null;+ rpm_limit: number | null;+ rpd_limit: number | null;+ tpm_limit: number | null;+ }>;++ // Every key row once: the routable pool needs enabled+healthy rows, while the+ // custom-endpoint pool is keyed on base_url and has to resolve a model's own+ // key_id even when that row is disabled.+ const allKeys = db.prepare(`+ SELECT id, platform, base_url, model_scope_json, enabled, status FROM api_keys+ `).all() as Array<{+ id: number;+ platform: string;+ base_url: string | null;+ model_scope_json: string | null;+ enabled: number;+ status: string;+ }>;++ const baseUrlByKeyId = new Map(allKeys.map(k => [k.id, k.base_url]));+ const routableByPlatform = new Map<string, Array<{ id: number; baseUrl: string | null; scope: Set<string> | null }>>();+ for (const k of allKeys) {+ if (k.enabled !== 1 || (k.status !== 'healthy' && k.status !== 'unknown')) continue;+ const list = routableByPlatform.get(k.platform) ?? [];+ list.push({ id: k.id, baseUrl: k.base_url, scope: parseModelScope(k.model_scope_json) });+ routableByPlatform.set(k.platform, list);+ }++ // One grouped scan replaces three counts per model × key. Same windows the+ // ratelimit service enforces: a sliding minute for RPM/TPM, a sliding day for+ // RPD. Rows older than a day are pruned on write, but the WHERE keeps this+ // correct even if a prune has not run yet.+ const usageRows = db.prepare(`+ SELECT platform, model_id, key_id,+ SUM(CASE WHEN kind = 'request' AND created_at_ms > ? THEN 1 ELSE 0 END) AS rpm_used,+ SUM(CASE WHEN kind = 'request' THEN 1 ELSE 0 END) AS rpd_used,+ SUM(CASE WHEN kind = 'tokens' AND created_at_ms > ? THEN tokens ELSE 0 END) AS tpm_used+ FROM rate_limit_usage+ WHERE created_at_ms > ?+ GROUP BY platform, model_id, key_id+ `).all(now - RATE_LIMIT_MINUTE_MS, now - RATE_LIMIT_MINUTE_MS, now - RATE_LIMIT_DAY_MS) as Array<{+ platform: string; model_id: string; key_id: number;+ rpm_used: number; rpd_used: number; tpm_used: number;+ }>;+ const usageByKey = new Map<string, KeyUsage>();+ for (const u of usageRows) {+ usageByKey.set(`${u.platform}\u0000${u.model_id}\u0000${u.key_id}`, {+ rpm: u.rpm_used, rpd: u.rpd_used, tpm: u.tpm_used,+ });+ }++ const rows = models.map(m => {+ const limits = { rpm: m.rpm_limit, rpd: m.rpd_limit, tpm: m.tpm_limit };+ const pool = routableByPlatform.get(m.platform) ?? [];+ // A custom model belongs to one endpoint; only that endpoint's credentials+ // can serve it. Legacy rows (key_id NULL) keep the any-key match.+ const endpointBaseUrl = m.platform === 'custom' && m.key_id != null+ ? baseUrlByKeyId.get(m.key_id) ?? null+ : null;++ let best: KeyUsage | null = null;+ let bestPressure = Infinity;+ for (const k of pool) {+ if (!scopeAllows(k.scope, m.model_id)) continue;+ if (m.platform === 'custom' && m.key_id != null) {+ if (endpointBaseUrl == null ? k.id !== m.key_id : k.baseUrl !== endpointBaseUrl) continue;+ }+ const usage = usageByKey.get(`${m.platform}\u0000${m.model_id}\u0000${k.id}`) ?? NO_USAGE;+ const pressure = keyPressure(usage, limits);+ if (pressure < bestPressure) {+ bestPressure = pressure;+ best = usage;+ }+ }++ // No routable key at all: the model cannot be served, and a usage number+ // would be fiction. Report no windows so the dashboard shows no badge.+ if (!best) {+ return { modelDbId: m.model_db_id, platform: m.platform, modelId: m.model_id, rpm: null, rpd: null, tpm: null };+ }+ return {+ modelDbId: m.model_db_id,+ platform: m.platform,+ modelId: m.model_id,+ rpm: m.rpm_limit != null ? { used: best.rpm, limit: m.rpm_limit } : null,+ rpd: m.rpd_limit != null ? { used: best.rpd, limit: m.rpd_limit } : null,+ tpm: m.tpm_limit != null ? { used: best.tpm, limit: m.tpm_limit } : null,+ };+ });++ res.json({ generatedAtMs: now, rows });+});