Skip to content

Commit

Permalink
🐛 fix: fix litellm streaming usage and refactor the usage chunk (lobe…
Browse files Browse the repository at this point in the history
…hub#6734)

* fix litellm usage

* update implement

* refactor to fix agent test

* update

* fix tests

* fix tests

* fix tests

* fix tests

* Update ui

* Update ui

* fix tests

* refactor token calc

* refactor token calc

* add cached display

* update i18n
  • Loading branch information
arvinxx authored Mar 6, 2025
1 parent 00a33bf commit 9f09952
Show file tree
Hide file tree
Showing 60 changed files with 1,508 additions and 1,745 deletions.
6 changes: 5 additions & 1 deletion locales/ar/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,20 @@
"inputCharts": "${{amount}}/M حرف",
"inputMinutes": "${{amount}}/دقيقة",
"inputTokens": "مدخلات {{amount}}/نقطة · ${{amount}}/M",
"outputTokens": "مخرجات {{amount}}/نقطة · ${{amount}}/M"
"outputTokens": "مخرجات {{amount}}/نقطة · ${{amount}}/M",
"writeCacheInputTokens": "تخزين إدخال الكتابة {{amount}}/نقطة · ${{amount}}/ميغابايت"
}
},
"tokenDetails": {
"average": "متوسط السعر",
"input": "مدخلات",
"inputAudio": "مدخلات صوتية",
"inputCached": "مدخلات مخزنة",
"inputCitation": "اقتباس الإدخال",
"inputText": "مدخلات نصية",
"inputTitle": "تفاصيل المدخلات",
"inputUncached": "مدخلات غير مخزنة",
"inputWriteCached": "تخزين إدخال الكتابة",
"output": "مخرجات",
"outputAudio": "مخرجات صوتية",
"outputText": "مخرجات نصية",
Expand Down
15 changes: 6 additions & 9 deletions locales/ar/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -1121,15 +1121,6 @@
"llama-3.1-8b-instant": {
"description": "Llama 3.1 8B هو نموذج عالي الأداء، يوفر قدرة سريعة على توليد النصوص، مما يجعله مثاليًا لمجموعة من التطبيقات التي تتطلب كفاءة كبيرة وتكلفة فعالة."
},
"llama-3.1-sonar-huge-128k-online": {
"description": "نموذج Llama 3.1 Sonar Huge Online، يتمتع بـ 405B من المعلمات، يدعم طول سياق حوالي 127,000 علامة، مصمم لتطبيقات دردشة معقدة عبر الإنترنت."
},
"llama-3.1-sonar-large-128k-online": {
"description": "نموذج Llama 3.1 Sonar Large Online، يتمتع بـ 70B من المعلمات، يدعم طول سياق حوالي 127,000 علامة، مناسب لمهام دردشة عالية السعة ومتنوعة."
},
"llama-3.1-sonar-small-128k-online": {
"description": "نموذج Llama 3.1 Sonar Small Online، يتمتع بـ 8B من المعلمات، يدعم طول سياق حوالي 127,000 علامة، مصمم للدردشة عبر الإنترنت، قادر على معالجة تفاعلات نصية متنوعة بكفاءة."
},
"llama-3.2-11b-vision-instruct": {
"description": "قدرة استدلال الصور التي تبرز في الصور عالية الدقة، مناسبة لتطبيقات الفهم البصري."
},
Expand Down Expand Up @@ -1643,6 +1634,9 @@
"qwq-32b-preview": {
"description": "نموذج QwQ هو نموذج بحث تجريبي تم تطويره بواسطة فريق Qwen، يركز على تعزيز قدرات الاستدلال للذكاء الاصطناعي."
},
"r1-1776": {
"description": "R1-1776 هو إصدار من نموذج DeepSeek R1، تم تدريبه لاحقًا لتقديم معلومات حقائق غير خاضعة للرقابة وغير متحيزة."
},
"solar-mini": {
"description": "Solar Mini هو نموذج LLM مدمج، يتفوق على GPT-3.5، ويتميز بقدرات متعددة اللغات قوية، ويدعم الإنجليزية والكورية، ويقدم حلولًا فعالة وصغيرة الحجم."
},
Expand All @@ -1655,6 +1649,9 @@
"sonar": {
"description": "منتج بحث خفيف الوزن يعتمد على سياق البحث، أسرع وأرخص من Sonar Pro."
},
"sonar-deep-research": {
"description": "تقوم Deep Research بإجراء أبحاث شاملة على مستوى الخبراء وتجميعها في تقارير يمكن الوصول إليها وقابلة للتنفيذ."
},
"sonar-pro": {
"description": "منتج بحث متقدم يدعم سياق البحث، مع دعم للاستعلامات المتقدمة والمتابعة."
},
Expand Down
6 changes: 5 additions & 1 deletion locales/bg-BG/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,20 @@
"inputCharts": "${{amount}}/M символи",
"inputMinutes": "${{amount}}/минута",
"inputTokens": "Входящи {{amount}}/кредити · ${{amount}}/M",
"outputTokens": "Изходящи {{amount}}/кредити · ${{amount}}/M"
"outputTokens": "Изходящи {{amount}}/кредити · ${{amount}}/M",
"writeCacheInputTokens": "Кеширане на входящи данни {{amount}}/точки · ${{amount}}/M"
}
},
"tokenDetails": {
"average": "Средна цена",
"input": "Вход",
"inputAudio": "Аудио вход",
"inputCached": "Кеширан вход",
"inputCitation": "Цитиране на входящи данни",
"inputText": "Текстов вход",
"inputTitle": "Детайли за входа",
"inputUncached": "Некеширан вход",
"inputWriteCached": "Входящи кеширани данни",
"output": "Изход",
"outputAudio": "Аудио изход",
"outputText": "Текстов изход",
Expand Down
15 changes: 6 additions & 9 deletions locales/bg-BG/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -1121,15 +1121,6 @@
"llama-3.1-8b-instant": {
"description": "Llama 3.1 8B е модел с висока производителност, предлагащ бързи способности за генериране на текст, особено подходящ за приложения, изискващи мащабна ефективност и икономичност."
},
"llama-3.1-sonar-huge-128k-online": {
"description": "Llama 3.1 Sonar Huge Online модел, с 405B параметри, поддържащ контекстова дължина от около 127,000 маркера, проектиран за сложни онлайн чат приложения."
},
"llama-3.1-sonar-large-128k-online": {
"description": "Llama 3.1 Sonar Large Online модел, с 70B параметри, поддържащ контекстова дължина от около 127,000 маркера, подходящ за задачи с висока капацитет и разнообразие в чата."
},
"llama-3.1-sonar-small-128k-online": {
"description": "Llama 3.1 Sonar Small Online модел, с 8B параметри, поддържащ контекстова дължина от около 127,000 маркера, проектиран за онлайн чат, способен да обработва ефективно различни текстови взаимодействия."
},
"llama-3.2-11b-vision-instruct": {
"description": "Изключителни способности за визуално разсъждение върху изображения с висока разделителна способност, подходящи за приложения за визуално разбиране."
},
Expand Down Expand Up @@ -1643,6 +1634,9 @@
"qwq-32b-preview": {
"description": "QwQ моделът е експериментален изследователски модел, разработен от екипа на Qwen, който се фокусира върху подобряване на AI разсъдъчните способности."
},
"r1-1776": {
"description": "R1-1776 е версия на модела DeepSeek R1, след обучението, която предоставя непроверена и безпристрастна фактическа информация."
},
"solar-mini": {
"description": "Solar Mini е компактен LLM, който превъзхожда GPT-3.5, с мощни многоезични способности, поддържа английски и корейски, предоставяйки ефективно и компактно решение."
},
Expand All @@ -1655,6 +1649,9 @@
"sonar": {
"description": "Лек продукт за търсене, базиран на контекст на търсене, по-бърз и по-евтин от Sonar Pro."
},
"sonar-deep-research": {
"description": "Deep Research извършва задълбочени експертни изследвания и ги обобщава в достъпни и приложими доклади."
},
"sonar-pro": {
"description": "Разширен продукт за търсене, който поддържа контекст на търсене, напреднали запитвания и проследяване."
},
Expand Down
6 changes: 5 additions & 1 deletion locales/de-DE/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,20 @@
"inputCharts": "${{amount}}/M Zeichen",
"inputMinutes": "${{amount}}/Minute",
"inputTokens": "Eingabe {{amount}}/Punkte · ${{amount}}/M",
"outputTokens": "Ausgabe {{amount}}/Punkte · ${{amount}}/M"
"outputTokens": "Ausgabe {{amount}}/Punkte · ${{amount}}/M",
"writeCacheInputTokens": "Cache-Eingabe schreiben {{amount}}/Punkte · ${{amount}}/M"
}
},
"tokenDetails": {
"average": "Durchschnittspreis",
"input": "Eingabe",
"inputAudio": "Audioeingabe",
"inputCached": "Eingabe zwischengespeichert",
"inputCitation": "Eingabe zitieren",
"inputText": "Text-Eingabe",
"inputTitle": "Eingabedetails",
"inputUncached": "Eingabe nicht zwischengespeichert",
"inputWriteCached": "Eingabe Cache schreiben",
"output": "Ausgabe",
"outputAudio": "Audioausgabe",
"outputText": "Text-Ausgabe",
Expand Down
15 changes: 6 additions & 9 deletions locales/de-DE/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -1121,15 +1121,6 @@
"llama-3.1-8b-instant": {
"description": "Llama 3.1 8B ist ein leistungsstarkes Modell, das schnelle Textgenerierungsfähigkeiten bietet und sich hervorragend für Anwendungen eignet, die große Effizienz und Kosteneffektivität erfordern."
},
"llama-3.1-sonar-huge-128k-online": {
"description": "Das Llama 3.1 Sonar Huge Online-Modell hat 405B Parameter und unterstützt eine Kontextlänge von etwa 127.000 Markierungen, es wurde für komplexe Online-Chat-Anwendungen entwickelt."
},
"llama-3.1-sonar-large-128k-online": {
"description": "Das Llama 3.1 Sonar Large Online-Modell hat 70B Parameter und unterstützt eine Kontextlänge von etwa 127.000 Markierungen, es eignet sich für hochvolumige und vielfältige Chat-Aufgaben."
},
"llama-3.1-sonar-small-128k-online": {
"description": "Das Llama 3.1 Sonar Small Online-Modell hat 8B Parameter und unterstützt eine Kontextlänge von etwa 127.000 Markierungen, es wurde speziell für Online-Chat entwickelt und kann verschiedene Textinteraktionen effizient verarbeiten."
},
"llama-3.2-11b-vision-instruct": {
"description": "Überlegene Bildverarbeitungsfähigkeiten auf hochauflösenden Bildern, geeignet für visuelle Verständnisanwendungen."
},
Expand Down Expand Up @@ -1643,6 +1634,9 @@
"qwq-32b-preview": {
"description": "Das QwQ-Modell ist ein experimentelles Forschungsmodell, das vom Qwen-Team entwickelt wurde und sich auf die Verbesserung der KI-Inferenzfähigkeiten konzentriert."
},
"r1-1776": {
"description": "R1-1776 ist eine Version des DeepSeek R1 Modells, die nachtrainiert wurde, um unverfälschte, unvoreingenommene Fakteninformationen bereitzustellen."
},
"solar-mini": {
"description": "Solar Mini ist ein kompaktes LLM, das besser abschneidet als GPT-3.5 und über starke Mehrsprachigkeitsfähigkeiten verfügt. Es unterstützt Englisch und Koreanisch und bietet eine effiziente und kompakte Lösung."
},
Expand All @@ -1655,6 +1649,9 @@
"sonar": {
"description": "Ein leichtgewichtiges Suchprodukt, das auf kontextbezogener Suche basiert und schneller und günstiger ist als Sonar Pro."
},
"sonar-deep-research": {
"description": "Deep Research führt umfassende Expertenforschung durch und fasst diese in zugänglichen, umsetzbaren Berichten zusammen."
},
"sonar-pro": {
"description": "Ein fortschrittliches Suchprodukt, das kontextbezogene Suche unterstützt und erweiterte Abfragen sowie Nachverfolgung ermöglicht."
},
Expand Down
6 changes: 5 additions & 1 deletion locales/en-US/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,20 @@
"inputCharts": "${{amount}}/M characters",
"inputMinutes": "${{amount}}/minute",
"inputTokens": "Input {{amount}}/credits · ${{amount}}/M",
"outputTokens": "Output {{amount}}/credits · ${{amount}}/M"
"outputTokens": "Output {{amount}}/credits · ${{amount}}/M",
"writeCacheInputTokens": "Cache input write {{amount}}/points · ${{amount}}/M"
}
},
"tokenDetails": {
"average": "Average unit price",
"input": "Input",
"inputAudio": "Audio Input",
"inputCached": "Cached Input",
"inputCitation": "Input citation",
"inputText": "Text Input",
"inputTitle": "Input Details",
"inputUncached": "Uncached Input",
"inputWriteCached": "Input cache write",
"output": "Output",
"outputAudio": "Audio Output",
"outputText": "Text Output",
Expand Down
15 changes: 6 additions & 9 deletions locales/en-US/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -1121,15 +1121,6 @@
"llama-3.1-8b-instant": {
"description": "Llama 3.1 8B is a high-performance model that offers rapid text generation capabilities, making it ideal for applications requiring large-scale efficiency and cost-effectiveness."
},
"llama-3.1-sonar-huge-128k-online": {
"description": "Llama 3.1 Sonar Huge Online model, featuring 405B parameters, supports a context length of approximately 127,000 tokens, designed for complex online chat applications."
},
"llama-3.1-sonar-large-128k-online": {
"description": "Llama 3.1 Sonar Large Online model, featuring 70B parameters, supports a context length of approximately 127,000 tokens, suitable for high-capacity and diverse chat tasks."
},
"llama-3.1-sonar-small-128k-online": {
"description": "Llama 3.1 Sonar Small Online model, featuring 8B parameters, supports a context length of approximately 127,000 tokens, designed for online chat, efficiently handling various text interactions."
},
"llama-3.2-11b-vision-instruct": {
"description": "Excellent image reasoning capabilities on high-resolution images, suitable for visual understanding applications."
},
Expand Down Expand Up @@ -1643,6 +1634,9 @@
"qwq-32b-preview": {
"description": "The QwQ model is an experimental research model developed by the Qwen team, focusing on enhancing AI reasoning capabilities."
},
"r1-1776": {
"description": "R1-1776 is a version of the DeepSeek R1 model, fine-tuned to provide unfiltered, unbiased factual information."
},
"solar-mini": {
"description": "Solar Mini is a compact LLM that outperforms GPT-3.5, featuring strong multilingual capabilities and supporting English and Korean, providing an efficient and compact solution."
},
Expand All @@ -1655,6 +1649,9 @@
"sonar": {
"description": "A lightweight search product based on contextual search, faster and cheaper than Sonar Pro."
},
"sonar-deep-research": {
"description": "Deep Research conducts comprehensive expert-level studies and synthesizes them into accessible, actionable reports."
},
"sonar-pro": {
"description": "An advanced search product that supports contextual search, advanced queries, and follow-ups."
},
Expand Down
6 changes: 5 additions & 1 deletion locales/es-ES/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,20 @@
"inputCharts": "${{amount}}/M caracteres",
"inputMinutes": "${{amount}}/minuto",
"inputTokens": "Entradas {{amount}}/créditos · ${{amount}}/M",
"outputTokens": "Salidas {{amount}}/créditos · ${{amount}}/M"
"outputTokens": "Salidas {{amount}}/créditos · ${{amount}}/M",
"writeCacheInputTokens": "Escritura en caché de entrada {{amount}}/puntos · ${{amount}}/M"
}
},
"tokenDetails": {
"average": "Precio promedio",
"input": "Entrada",
"inputAudio": "Entrada de audio",
"inputCached": "Entrada en caché",
"inputCitation": "Citación de entrada",
"inputText": "Entrada de texto",
"inputTitle": "Detalles de entrada",
"inputUncached": "Entrada no en caché",
"inputWriteCached": "Escritura en caché de entrada",
"output": "Salida",
"outputAudio": "Salida de audio",
"outputText": "Salida de texto",
Expand Down
15 changes: 6 additions & 9 deletions locales/es-ES/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -1121,15 +1121,6 @@
"llama-3.1-8b-instant": {
"description": "Llama 3.1 8B es un modelo de alto rendimiento que ofrece una rápida capacidad de generación de texto, ideal para aplicaciones que requieren eficiencia a gran escala y rentabilidad."
},
"llama-3.1-sonar-huge-128k-online": {
"description": "El modelo Llama 3.1 Sonar Huge Online, con 405B de parámetros, soporta una longitud de contexto de aproximadamente 127,000 tokens, diseñado para aplicaciones de chat en línea complejas."
},
"llama-3.1-sonar-large-128k-online": {
"description": "El modelo Llama 3.1 Sonar Large Online, con 70B de parámetros, soporta una longitud de contexto de aproximadamente 127,000 tokens, adecuado para tareas de chat de alta capacidad y diversidad."
},
"llama-3.1-sonar-small-128k-online": {
"description": "El modelo Llama 3.1 Sonar Small Online, con 8B de parámetros, soporta una longitud de contexto de aproximadamente 127,000 tokens, diseñado para chat en línea, capaz de manejar eficientemente diversas interacciones textuales."
},
"llama-3.2-11b-vision-instruct": {
"description": "Capacidad excepcional de razonamiento visual en imágenes de alta resolución, adecuada para aplicaciones de comprensión visual."
},
Expand Down Expand Up @@ -1643,6 +1634,9 @@
"qwq-32b-preview": {
"description": "El modelo QwQ es un modelo de investigación experimental desarrollado por el equipo de Qwen, enfocado en mejorar la capacidad de razonamiento de la IA."
},
"r1-1776": {
"description": "R1-1776 es una versión del modelo DeepSeek R1, que ha sido entrenada posteriormente para proporcionar información factual sin censura y sin sesgos."
},
"solar-mini": {
"description": "Solar Mini es un LLM compacto que supera a GPT-3.5, con potentes capacidades multilingües, soportando inglés y coreano, ofreciendo soluciones eficientes y compactas."
},
Expand All @@ -1655,6 +1649,9 @@
"sonar": {
"description": "Producto de búsqueda ligero basado en contexto de búsqueda, más rápido y económico que Sonar Pro."
},
"sonar-deep-research": {
"description": "Deep Research realiza una investigación exhaustiva a nivel de expertos y la compila en informes accesibles y prácticos."
},
"sonar-pro": {
"description": "Producto de búsqueda avanzada que soporta contexto de búsqueda, consultas avanzadas y seguimiento."
},
Expand Down
6 changes: 5 additions & 1 deletion locales/fa-IR/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,20 @@
"inputCharts": "${{amount}}/M کاراکتر",
"inputMinutes": "${{amount}}/دقیقه",
"inputTokens": "ورودی {{amount}}/اعتبار · ${{amount}}/M",
"outputTokens": "خروجی {{amount}}/اعتبار · ${{amount}}/M"
"outputTokens": "خروجی {{amount}}/اعتبار · ${{amount}}/M",
"writeCacheInputTokens": "ذخیره ورودی نوشتن {{amount}}/امتیاز · ${{amount}}/M"
}
},
"tokenDetails": {
"average": "میانگین قیمت",
"input": "ورودی",
"inputAudio": "ورودی صوتی",
"inputCached": "ورودی کش شده",
"inputCitation": "ارجاع ورودی",
"inputText": "ورودی متنی",
"inputTitle": "جزئیات ورودی",
"inputUncached": "ورودی غیر کش شده",
"inputWriteCached": "ذخیره ورودی نوشتن",
"output": "خروجی",
"outputAudio": "خروجی صوتی",
"outputText": "خروجی متنی",
Expand Down
Loading

0 comments on commit 9f09952

Please sign in to comment.