/ Модель

Характеристики

Лицензия
MIT
Библиотека
transformers
Опубликована
10 окт 2026

Zesyde-150M-Multilingual-Router

Классификация текстаТекст → label

Мультиязычная модель классификации текста для выбора из вариантов и быстрой маршрутизации запросов к инструментам, агентам или моделям.

0скачиваний за 30 дней5лайковвеса обновлены11 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Zesyde-150M-Multilingual-Router — модель классификации текста для быстрых решений с набором вариантов и маршрутизации запросов между инструментами, агентами или моделями. README описывает её как разработанную автором репозитория Zesyde; архитектура включает трансформер ModernBERT класса 150M параметров и мультиязычную таблицу эмбеддингов, всего около 313 млн параметров. Модель работает без авторегрессивной генерации и поставляется в формате ONNX.

На вход подаются контекст, вопрос и от 2 до 20 вариантов ответа; модель возвращает выбранный вариант, распределение вероятностей и оценку уверенности. Предусмотрен отдельный выход для передачи неоднозначных или рискованных запросов человеку либо более мощной модели. README заявляет контекст до 8 192 токенов, при этом дообучение проводилось на последовательностях до 1 024 токенов. Модель предназначена для маршрутизации вызовов инструментов и моделей, выбора ответа и бинарной проверки утверждений; для обслуживания описана работа на CPU.

В карточке указаны языки en, es, hi, ar, fr, de, zh, tr, vi и ru, а README заявляет поддержку более 1 800 языков. Приведённые результаты тестирования охватывают отдельные задачи выбора ответа на испанском, арабском и хинди; широкое заявленное покрытие и показатели калибровки не следует считать подтверждёнными для всех языков и сценариев. Лицензия — MIT.

Сценарии применения

  • Выбор инструмента для вызова ИИ-агентом
  • Маршрутизация запроса к подходящей языковой модели
  • Передача неоднозначного запроса на проверку человеку
  • Выбор лучшего ответа из нескольких кандидатов
  • Бинарная проверка утверждения или факта

Ограничения

В карточке приведены результаты только для отдельных задач выбора ответа на испанском, арабском и хинди; качество и калибровка на остальных языках и сценариях не подтверждены этими результатами. README указывает, что дообучение проводилось на последовательностях до 1 024 токенов, хотя архитектурный контекст заявлен до 8 192 токенов.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Zesyde: Calibrated, Non-Autoregressive Decision & Routing Foundation Model

PyPI version Python 3.11+ License: MIT Latency Model Size Parameters Context

Zesyde is a production-ready, non-autoregressive foundation model engineered for ultra-fast, mathematically calibrated zero-shot decisions and agent routing across 1,800+ languages.

Instead of generating text token-by-token with massive generative LLMs, Zesyde scores arbitrary candidate sets simultaneously in 12–35 milliseconds on pure CPU using candidate-token pooling, prompt-context fusion, and out-of-sample temperature scaling.


🚀 Key Highlights

  • Blazing Fast (Non-Autoregressive): Generates decisions in 12–35ms on pure CPU via INT8 ONNX Runtime (p50 ~12ms on short sequences / AVX-512, ~33ms average across benchmarks). No autoregressive token generation overhead.
  • Mathematically Calibrated: Built-in post-hoc temperature scaling fitted via strictly proper scoring rules. Minimizes Expected Calibration Error (ECE < 2.5%). Predicted confidence matches empirical accuracy.
  • Massive Cross-Lingual Coverage: Native support across 1,800+ languages utilizing jhu-clsp/mmBERT-base with zero-dependency heuristic script routing. 313M total parameters (150M-class ModernBERT transformer core + 256k-token multilingual embedding table).
  • 8,192-Token Architectural Context: RoPE-based rotary positional embeddings and dynamic ONNX axes support sequences up to 8,192 tokens (fine-tuned up to 1,024 tokens).
  • Autonomous Escalation Head (Act/Escalate): Built-in binary routing logit that autonomously flags low-confidence or high-risk inputs for human review or fallback to heavier frontier models.
  • Drop-in CPU Serving: Optimized FP32 and INT8 ONNX graphs with dynamic quantization and a standalone FastAPI + aesthetic web dashboard.

📊 Benchmark & Evaluation Results

Evaluated on held-out test splits after full 150K multi-task multilingual training with Regularized Log-Loss Calibration Distillation (RLCD):

Benchmark / TaskLanguage & PrimitiveAccuracyExpected Calibration Error (ECE)Brier Score
belebele_esSpanish (4-way QA)89.0%0.0447 (4.5%)0.1608
belebele_arArabic (4-way QA)83.5%0.0342 (3.4%)0.2362
belebele_hiHindi (4-way QA)73.5%0.0786 (7.9%)0.3452
xnli_deGerman (Boolean NLI)87.0%0.0577 (5.8%)0.2153
xnli_frFrench (3-way NLI)79.0%0.0881 (8.8%)0.3259
OVERALL AGGREGATECross-Lingual Held-Out82.4%0.0188 (1.9%)0.2567

Verified Post-Hoc Calibration Temperatures

Fitted via strictly proper scoring rules on independent held-out calibration partitions:

  • $T[\text{choice} \mid K=4] = \mathbf{0.8528}$
  • $T[\text{choice} \mid K=3] = \mathbf{1.8290}$
  • $T[\text{noul} \mid K=2] = \mathbf{1.0408}$
  • $T[\text{default}] = \mathbf{1.0000}$

All temperature scaling factors are closely grouped around 1.0, proving natural calibration without logit explosion or collapse.


⚡ Quickstart

Installation

Install via PyPI:

pip install zesyde

Or install from source for development:

git clone https://github.com/zoebchhatriwala/Zesyde.git
cd Zesyde
pip install -e .

1. Python SDK (3-Line Inference)

from zesyde.router import ZesydeRouter

# Load directly from Hugging Face Hub (or local directory "models")
router = ZesydeRouter.from_pretrained("zoebchhatriwala/Zesyde-150M-Multilingual-Router", prefer_fp32=False)

# Make a calibrated, fast routing decision
result = router.decide(
    context="The new flagship battery lasts for over 3 days on a single charge.",
    question="What is the sentiment of this review?",
    options=["Negative", "Neutral", "Positive"]
)

print(f"Selected: {result.selected_option}")       # "Positive"
print(f"Confidence: {result.confidence:.3f}")        # 0.982
print(f"Should Escalate: {result.should_escalate}")  # False
print(f"Latency: {result.latency_ms:.1f}ms")         # ~12.4ms (short sequence)

2. Autonomous Escalation & Risk Routing

Zesyde includes a dedicated Act/Escalate decision head that triggers when input ambiguity is high:

decision = router.decide(
    context="Ambiguous text or high-risk medical prompt...",
    question="Determine action plan:",
    options=["Auto-Approve", "Reject"]
)

if decision.should_escalate:
    # Route to human review queue or heavier reasoning LLM (e.g. Gemini / Claude)
    escalate_to_human_reviewer(decision)
else:
    # Safely execute automated decision
    execute_action(decision.selected_option)

3. REST API & Web Dashboard

Launch the FastAPI production server:

python scripts/api.py --model-dir models --port 8000
  • Interactive Web Dashboard: Navigate to http://localhost:8000/ for a dark-mode, real-time testing playground.
  • REST Endpoint:
curl -X POST http://localhost:8000/decide \
  -H 'Content-Type: application/json' \
  -d '{
    "context": "El nuevo smartphone es increíble, la batería dura tres días seguidos.",
    "question": "What is the sentiment?",
    "options": ["Negative", "Neutral", "Positive"]
  }'

💻 Developer & Integration Guide

This guide walks you through building applications, AI agents, and production services using Zesyde.

1. Acquiring Model Weights

Zesyde models can be loaded directly from Hugging Face Hub or pre-downloaded locally:

  • Automatic Download (Recommended): Pass the Hugging Face repo ID directly to from_pretrained():

    router = ZesydeRouter.from_pretrained("zoebchhatriwala/Zesyde-150M-Multilingual-Router")
    

    This automatically downloads, verifies, and caches the ONNX models and calibration factors in your local Hugging Face cache.

  • Manual Download (Air-gapped / Offline):

    pip install huggingface_hub
    huggingface-cli download zoebchhatriwala/Zesyde-150M-Multilingual-Router --local-dir models/
    

    Then initialize pointing to your local directory:

    router = ZesydeRouter.from_pretrained("models")
    

2. Core API Reference

Initializing the Router

from zesyde.router import ZesydeRouter

router = ZesydeRouter.from_pretrained(
    model_dir_or_path="models",  # Path containing ONNX graphs and calibration JSON
    prefer_fp32=False,           # False uses INT8 (~12ms CPU latency, 318MB RAM)
    max_length=8192,             # Architectural context window (supports up to 8k tokens)
    precision_routing=True       # Dynamically routes ordinal 'score' queries to FP32 if available
)

Making Decisions: router.decide()

ParameterTypeDefaultDescription
contextstrrequiredThe prompt, user message, or document context (up to 8,192 tokens).
optionsList[str]requiredCandidate choices (2 to 20 arbitrary options dynamically scored).
questionstr"Select the best option:"The decision question or routing objective.
question_typestr"choice"Decision primitive: 'choice' (multi-class), 'noul' (boolean), or 'score' (ordinal).
escalation_thresholdfloat0.10Binary risk threshold above which should_escalate triggers.

Decision Output: DecisionResult

PropertyTypeDescription
selected_optionstrThe winning candidate option.
confidencefloatMathematically calibrated probability ($0.0 \dots 1.0$) with Expected Calibration Error $< 2.5%$.
probabilitiesDict[str, float]Full probability distribution across all provided candidate options.
should_escalateboolTrue if ambiguity/risk exceeds escalation_threshold.
escalate_probabilityfloatRaw scalar probability of epistemic risk predicted by the Act/Escalate head.
latency_msfloatInference latency in milliseconds (typically 12–35ms on CPU).

3. Developer Recipes & Design Patterns

Recipe A: AI Agent Fast Tool Selection (LangChain / LlamaIndex / Custom)

Instead of asking an autoregressive LLM to select tools (costing money and adding ~1,000ms latency), route locally in 15ms:

from zesyde.router import ZesydeRouter

router = ZesydeRouter.from_pretrained("models", prefer_fp32=False)

tools = ["search_web", "query_database", "send_email", "calculate_mortgage"]

decision = router.decide(
    context="User message: 'Can you look up the current stock price of Apple?'",
    question="Select the optimal tool to fulfill this request:",
    options=tools
)

print(f"Tool selected: {decision.selected_option} (confidence: {decision.confidence:.2%})")
# Executes: search_web

Recipe B: Cost & Latency Gatekeeper (The LLM Cascade)

Route routine queries to instant automated handling, while reserving expensive frontier models (GPT-4o, Claude 3.5 Sonnet) only for edge cases:

decision = router.decide(
    context=incoming_customer_ticket,
    question="Categorize inquiry type:",
    options=["Password Reset", "Billing Question", "Feature Request", "Complex Legal Issue"]
)

# If Zesyde detects ambiguity or low confidence, escalate to a heavy reasoning model
if decision.should_escalate or decision.confidence < 0.75:
    response = call_frontier_llm(incoming_customer_ticket)
else:
    response = handle_automated_workflow(decision.selected_option)

Recipe C: Multilingual Script & Language Routing

For global applications across 1,800+ languages, use LanguageRouter for microsecond script detection and dynamic cross-lingual dispatch:

from zesyde.lang_router import LanguageRouter

lang_router = LanguageRouter(model_dir="models")

# Automatically detects Spanish, Arabic, Hindi, German, etc.
result = lang_router.decide(
    context="El servicio al cliente fue excepcional y resolvieron mi problema rápidamente.",
    question="¿Cuál es el sentimiento del cliente?",
    options=["Negativo", "Neutral", "Positivo"]
)

print(f"Detected Language: {result.detected_language}")  # 'es'
print(f"Selected: {result.selected_option}")              # 'Positivo'

Recipe D: Binary Verification / Fact-Checking (noul)

Use the noul primitive for calibrated boolean verification (strictly 2 options):

result = router.decide(
    context="Statement: The capital of Australia is Canberra.",
    question="Is this factual statement accurate?",
    options=["No", "Yes"],
    question_type="noul"
)

print(f"True? {result.selected_option == 'Yes'} (Confidence: {result.confidence:.3f})")

Recipe E: Ordinal Ratings & Scoring (score)

Preserve monotonic distance across Likert scales or priority ratings:

result = router.decide(
    context="User comment: The product broke within 2 hours of use.",
    question="Rate customer satisfaction on a scale from 1 to 5:",
    options=["1", "2", "3", "4", "5"],
    question_type="score"
)

print(f"Satisfaction Rating: {result.selected_option} / 5")

4. Performance Tuning & CPU Optimization

  • Multi-threading: By default, ZesydeRouter sets intra_op_num_threads = 4, which yields the lowest batch-1 latency on modern CPUs. On small or containerized instances with 1–2 cores, you can adjust this directly in the ONNX session options.
  • FP32 vs INT8:
    • INT8 (prefer_fp32=False): Model file is 318 MB. Delivers ~12–35ms latency and lowest RAM footprint.
    • FP32 (prefer_fp32=True): Model file is 1.2 GB. Delivers exact mathematical parity with zero quantization noise, with minimal latency difference (~13ms on AVX-512).

🏗️ Model Architecture

Sequence Layout:
[CLS] context [SEP] question [SEP] [MASK] Option 1 [MASK] Option 2 ... [MASK] Option K [SEP]
                                      │                  │                   │
                                      ▼                  ▼                   ▼
                          Candidate Mean-Pooling  Candidate Mean-Pooling  Candidate Mean-Pooling
                                      │                  │                   │
                                      └──────────────────┼───────────────────┘
                                                         ▼
                                                Context Fusion Layer
                                          [h_opt, h_cls, h_opt ⊙ h_cls]
                                                         ▼
                                            Calibrated Decision Head
                                                         ▼
                                         Temperature Scaling Matrix T[Type|K]
                                                         ▼
                                          Calibrated Probability Vector
  1. Backbone: Pretrained jhu-clsp/mmBERT-base (multilingual) or answerdotai/ModernBERT-large (English).
  2. Context Fusion: Candidate option representations $\mathbf{h}{\text{opt}}$ are concatenated with the sequence representation $\mathbf{h}{\text{cls}}$ and their interaction $\mathbf{h}{\text{opt}} \odot \mathbf{h}{\text{cls}}$, yielding a $3H$-dimensional feature vector per option.
  3. Decision Head: Regularized multi-layer perceptron with GELU and LayerNorm predicting unconstrained scalar compatibility logits.
  4. Escalation Head: Binary classifier over $\mathbf{h}_{\text{cls}}$ predicting escalation probability.
  5. Temperature Scaling: Post-hoc isotonic temperature table $T[\text{type} \mid K]$ learned on held-out calibration partitions.

🛠️ Reproduction & Training Pipeline

To reproduce the 128K production build end-to-end (supervised warm-start, RLCD distillation, temperature calibration, and INT8 ONNX export):

python scripts/build_prod_model.py \
  --multilingual \
  --train-limit 128000 \
  --epochs 1 \
  --batch-size 16 \
  --max-length 1024

Mid-Training Pause & Resumption

Training can be paused safely at any point:

  • Press p in the terminal to pause, save an in-memory or disk checkpoint, and quit.
  • Press Ctrl+C for graceful signal capture to save models/checkpoints/train_checkpoint.pt.
  • Resume training seamlessly with:
    python scripts/build_prod_model.py --resume
    

📦 Export Artifacts

Running the pipeline outputs complete serving artifacts to models/:

  • zesyde_prod_int8.onnx: Dynamically quantized 8-bit ONNX model for CPU inference (~318 MB / ~95 MB non-embedding weights).
  • zesyde_prod_fp32.onnx: Full-precision 32-bit ONNX model (~1.16 GB).
  • zesyde_calibration.json: Persisted temperature scaling lookup table.
  • zesyde_trained.pt: Full PyTorch model checkpoint (~1.17 GB, 313.1M parameters).

📜 Citation & License

@software{zesyde2026,
  author = {Chhatriwala, Zoeb},
  title = {Zesyde: Calibrated, Non-Autoregressive Decision & Routing Foundation Models},
  year = {2026},
  version = {1.0.1},
  url = {https://huggingface.co/zoebchhatriwala/Zesyde-150M-Multilingual-Router}
}

Licensed under the MIT License.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
f10c672

0 моделей