How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-classification", model="RavinduSen/JaneGPT-v2-Janus")
# pip install -U transformers accelerate
# Load model directly
from transformers import JaneGPTJanusNLU
model = JaneGPTJanusNLU.from_pretrained("RavinduSen/JaneGPT-v2-Janus", device_map="auto")
Quick Links

JaneGPT v2 Janus - Intent Classification Model


Total Downloads Monthly Downloads


Experience Janus

Jane Janus animated hero banner

Hierarchical command understanding with state-aware runtime behavior for practical assistant workflows.

Update (Oct 2026): improved release. Higher accuracy and several bug fixes. The tokenizer now normalises casing, so capitalised speech-to-text output is handled like lowercase text; the model was retrained on cleaner, broader data; and the runtime handles wake phrases, cancelled questions and "close it"-style follow-ups. Use the new weights/tokenizer.json together with the new weights.

7.95M
Parameters
82
Runtime Turns
0
Errors
15.4 ms
Mean Latency
100%
OOD Precision
30.6 MB
Checkpoint

๐Ÿ›๏ธ The Temple of Janus (Web Experience)

We have deployed a dedicated interactive environment to showcase the essence of JaneGPT-v2 Janus.

Note: This is a visual and technical walkthrough; it does not feature a live chat interface.


Quickstart (2 minutes)

Install + first prediction
pip install -r requirements.txt
from janegpt_v2_janus import JaneGPTJanusNLU

nlu = JaneGPTJanusNLU(
    model_path="weights/janegpt_v2_janus.pt",
    tokenizer_path="weights/tokenizer.json",
)

state = {}
result = nlu.predict("set volume", state=state)
print(result)

if result.get("type") == "command":
    state = nlu.update_state(result, state)
Runtime wrapper (recommended for assistant flows)
from runtime.jane_nlu_runtime import JaneNLURuntime

rt = JaneNLURuntime(base_dir=".")
state = {}

out, state = rt.handle_turn("set volume", state)
print(out)  # expected: clarify prompt for missing VALUE

out, state = rt.handle_turn("55", state)
print(out)  # expected: resolved local command
Run bundled demos
python examples/demo_inference.py
python examples/demo_runtime.py
python examples/demo_runtime_suite.py

What You Get

  • Single-pass multitask prediction: domain + action + BIO slots.
  • Runtime-safe clarification loops for missing required slots.
  • Stateful follow-ups (for example, "that is not enough" after a volume change).
  • Local command routing with controlled chat fallback.
  • Compact deployment footprint: ~30.61 MB checkpoint.

Model Architecture

Interactive Architecture Visualization

๐Ÿ”ค 1. Tokenization & Embedding Layer
Input text is converted to token IDs and projected into a 256-dimensional embedding space.
Tokenizer BPE, vocab=8,192
Max Length 96 tokens
Output Shape (batch, 96, 256)
Embedding 8192 โ†’ 256 dim
โ†“
2. Transformer Backbone (8 Blocks)
Bidirectional attention layers with residual connections. Each block processes hidden states through grouped query attention and feed-forward networks.
Attention Type Grouped Query (GQA)
Query Heads 8 heads
KV Heads 4 heads (2:1)
Head Dimension 32 (256รท8)
Position Embedding RoPE
FFN Expansion 256 โ†’ 672 โ†’ 256
FFN Activation SwiGLU
Normalization RMSNorm
Causal Masking OFF (bidirectional)
Dropout Rate 0.1
Grouped Query Attention reduces KV cache 50% while maintaining quality
โ†“
3. Multi-Task Prediction Heads (Parallel)
Three independent classification heads process the backbone output simultaneously for domain, action, and slot predictions.
Domain Head
Input: Last token (pooled)
Arch: Linear(256) โ†’ GELU โ†’ Dropout โ†’ Linear(10)
Output: 10 classes
Action Head
Input: Last token (pooled)
Arch: Linear(256) โ†’ GELU โ†’ Dropout โ†’ Linear(33)
Output: 33 classes
Slot Head
Input: All tokens
Arch: Linear(256) โ†’ Linear(15 BIO)
Output: 15 labels/token
โ†“
4. Output & Post-Processing
Raw logits are converted to predictions. For slots, BIO tags are decoded into semantic spans.
Domain Output 10 classes
Action Output 33 classes
Slots Decoder BIO โ†’ Spans
Confidence Softmax scores

Training Objective

Weighted Multi-Task Loss
loss = 1.0 ร— L_domain + 1.0 ร— L_action + 1.5 ร— L_slots

Where: L_domain = CrossEntropy(domain_logits, domain_labels) L_action = CrossEntropy(action_logits, action_labels) L_slots = CrossEntropy(slot_logits, slot_labels) with ignore_index=-100 (padding)

Slot weight (1.5ร—) reflects higher complexity of sequence tagging vs. classification

Architecture Specifications

Component Configuration Details
Backbone Type Transformer (GPT-style) Bidirectional, non-causal attention
Vocabulary Size 8,192 BPE tokenization (NFKC + lowercase normalizer)
Embedding Dim 256 Token + Rotary Position embeddings
Attention Heads 8 Query, 4 KV Grouped Query Attention (GQA) for efficiency
Head Dimension 32 per head_dim = embed_dim / num_heads
Transformer Blocks 8 Layers Each with Attn + FFN + Residuals
Feed-Forward Hidden 672 SwiGLU gate activation
Position Encoding RoPE Rotary Position Embeddings (theta=10000)
Normalization RMSNorm Pre-layer normalization
Max Sequence Length 96 tokens Approximately 60-80 words
Dropout Rate 0.1 Applied during training
Total Parameters 7,949,626 All trainable
Parameter Breakdown Backbone: 7.80M, Task Heads: 146K Efficient multitask design

Task Configuration

Task Type Classes Architecture
Domain Classification Sequence-level 10 domains Pooled โ†’ Linear(256) โ†’ GELU โ†’ Linear(10)
Action Classification Sequence-level 33 actions Pooled โ†’ Linear(256) โ†’ GELU โ†’ Linear(33)
Slot Tagging Token-level 15 BIO labels Per-token โ†’ Linear(256) โ†’ Linear(15)

Benchmark Results

Runtime reliability
82-turn suite
82
Turns
67
Local
11
Clarify
0
Errors
fair_benchmarks.json
Predict latency
CUDA ยท batch=1 ยท lower is better
15.4ms
Pยทmean
23.7ms
Pยทp95
22.2ms
Fwdยทmean
28.7ms
Fwdยทp95
janus_model_report.json
OOD rejection quality
Schema-agnostic ยท hover values
97.3%
B77 F1
100%
B77 Prec
94.8%
B77 Rec
94.2%
CL F1
100%
CL Prec
89.0%
CL Rec
fair_benchmarks.json

Comprehensive Benchmark Summary

Full Benchmark Evidence
All values from real holdout evaluations โ€” no synthetic or inflated numbers
Metric Detail Jane v2 Janus
Speed (mean latency) CUDA, batch=1 31.60 ms 15.37 ms
Throughput CUDA, single GPU 32 pred/sec 65 pred/sec, 0 errors across 82 turns
OOD F1 BANKING77 94.31% 97.30%
OOD F1 CLINC OOS 89.16% 94.18%
OOD Precision BANKING77 99.35% 100.00%
OOD Precision CLINC OOS 99.14% 100.00%
OOD Recall BANKING77 89.75% 94.75%
OOD Recall CLINC OOS 81.00% 89.00%
Validation Accuracy Domain (best epoch) โ€” 98.87%
Validation Accuracy Action (best epoch) โ€” 98.47%
Validation Accuracy Domain+Action pair (best epoch) โ€” 98.41%
Slot Extraction F1 All 15 slot types โ€” 0.993 (99.33%)
Training Loss Epoch 1 โ†’ 6 โ€” 0.570 โ†’ 0.054 โ†’ 0.019 โ†’ 0.009 โ†’ 0.007 โ†’ 0.006
Validation Loss Epoch 1 โ†’ 6 โ€” 0.1992 โ†’ 0.1086 โ†’ 0.1283 โ†’ 0.1877 โ†’ 0.1434 โ†’ 0.1301 (selected epoch)
Runtime Reliability 82-turn conversation test โ€” 0 errors, 0 crashes
Domain Confusion 10 domains โ€” 94.7%+ per-domain, minimal cross-confusion
Action Confusion 33 actions โ€” Strong diagonal: 25 of 33 actions at 99%+, lowest minimize at 90.6%

Live Output Shapes (click to expand)

Command output
{
  "type": "command",
  "domain": "apps",
  "action": "launch",
  "slots": {
    "APP_NAME": {
      "text": "chrome",
      "start": 5,
      "end": 11,
      "confidence": 0.999
    }
  },
  "confidence": 0.97,
  "route": "local"
}
Clarification output
{
  "type": "clarify",
  "question": "What value should I set it to?",
  "debug": {
    "domain": "volume",
    "action": "set",
    "reason": "missing_VALUE"
  }
}
Label schema
  • Domains (10): volume, brightness, media, apps, browser, productivity, screen, window, system, conversation
  • Actions (33): up, down, set, mute, unmute, play, pause, next, previous, launch, close, switch, search, set_reminder, screenshot, read, explain, undo, quit, chat, minimize, maximize, restore, focus, copy, paste, cut, lock, sleep, wifi_on, wifi_off, bluetooth_on, bluetooth_off
  • Slot labels (BIO, 15): VALUE, APP_NAME, QUERY, DURATION, TIME, WINDOW_NAME, TEXT

Visual Benchmark Evidence

Train and validation loss

Smoothed train loss

Validation slot F1

Confusion Matrix โ€” Interactive Breakdown

Per-Class True vs Predicted
Single stacked bar per head โ€” segment width = sample ratio. Hover any segment for details.
Domain Sample Distribution โ€” 3,265 total samples โ€” hover each segment
volume
453 samples (13.9%)
Accuracy: 99.8%
Misclassified: 1
brightness
349 samples (10.7%)
Accuracy: 100%
Misclassified: 0
media
372 samples (11.4%)
Accuracy: 99.5%
Misclassified: 2
apps
266 samples (8.1%)
Accuracy: 100%
Misclassified: 0
browser
102 samples (3.1%)
Accuracy: 100%
Misclassified: 0
productivity
384 samples (11.8%)
Accuracy: 100%
Misclassified: 0
screen
68 samples (2.1%)
Accuracy: 100%
Misclassified: 0
window
234 samples (7.2%)
Accuracy: 97.9%
Misclassified: 5
system
542 samples (16.6%)
Accuracy: 99.4%
Misclassified: 3
conversation
495 samples (15.2%)
Accuracy: 94.7%
Misclassified: 26
volume
brightness
media
apps
browser
productivity
screen
window
system
conversation
Source: validation set confusion matrix โ€” segment widths proportional to sample count
Action Sample Distribution โ€” 3,265 total samples โ€” hover each segment
up
234 samples (7.2%)
Accuracy: 100%
Misclassified: 0
down
227 samples (7.0%)
Accuracy: 100%
Misclassified: 0
set
195 samples (6.0%)
Accuracy: 100%
Misclassified: 0
mute
85 samples (2.6%)
Accuracy: 100%
Misclassified: 0
unmute
61 samples (1.9%)
Accuracy: 98.4%
Misclassified: 1
play
137 samples (4.2%)
Accuracy: 98.5%
Misclassified: 2
pause
91 samples (2.8%)
Accuracy: 100%
Misclassified: 0
next
71 samples (2.2%)
Accuracy: 100%
Misclassified: 0
previous
73 samples (2.2%)
Accuracy: 100%
Misclassified: 0
launch
87 samples (2.7%)
Accuracy: 100%
Misclassified: 0
close
92 samples (2.8%)
Accuracy: 100%
Misclassified: 0
switch
87 samples (2.7%)
Accuracy: 98.9%
Misclassified: 1
search
102 samples (3.1%)
Accuracy: 100%
Misclassified: 0
set_reminder
192 samples (5.9%)
Accuracy: 100%
Misclassified: 0
screenshot
68 samples (2.1%)
Accuracy: 100%
Misclassified: 0
read
64 samples (2.0%)
Accuracy: 100%
Misclassified: 0
explain
66 samples (2.0%)
Accuracy: 95.5%
Misclassified: 3
undo
107 samples (3.3%)
Accuracy: 96.3%
Misclassified: 4
quit
52 samples (1.6%)
Accuracy: 100%
Misclassified: 0
chat
313 samples (9.6%)
Accuracy: 90.7%
Misclassified: 29
minimize
53 samples (1.6%)
Accuracy: 90.6%
Misclassified: 5
maximize
52 samples (1.6%)
Accuracy: 100%
Misclassified: 0
restore
56 samples (1.7%)
Accuracy: 100%
Misclassified: 0
focus
73 samples (2.2%)
Accuracy: 100%
Misclassified: 0
copy
55 samples (1.7%)
Accuracy: 100%
Misclassified: 0
paste
57 samples (1.7%)
Accuracy: 100%
Misclassified: 0
cut
80 samples (2.5%)
Accuracy: 100%
Misclassified: 0
lock
75 samples (2.3%)
Accuracy: 100%
Misclassified: 0
sleep
100 samples (3.1%)
Accuracy: 100%
Misclassified: 0
wifi_on
78 samples (2.4%)
Accuracy: 100%
Misclassified: 0
wifi_off
66 samples (2.0%)
Accuracy: 92.4%
Misclassified: 5
bluetooth_on
59 samples (1.8%)
Accuracy: 100%
Misclassified: 0
bluetooth_off
57 samples (1.7%)
Accuracy: 100%
Misclassified: 0
up
down
set
mute
unmute
play
pause
next
previous
launch
close
switch
search
set_reminder
screenshot
read
explain
undo
quit
chat
minimize
maximize
restore
focus
copy
paste
cut
lock
sleep
wifi_on
wifi_off
bluetooth_on
bluetooth_off
Source: validation set confusion matrix โ€” segment widths proportional to sample count
View original confusion matrix images

Domain confusion matrix

Action confusion matrix

Additional diagnostics

Learning rate schedule

Epoch time profile

Raw training loss


Upload-Ready Layout

.
|- README.md
|- .gitattributes
|- LICENSE
|- requirements.txt
|- assets/
|  |- jane-janus-glitch.webp
|- janegpt_v2_janus/
|  |- __init__.py
|  |- architecture.py
|  |- dataset.py
|  |- inference.py
|  |- labels.py
|  |- multitask.py
|- runtime/
|  |- jane_nlu_runtime.py
|- examples/
|  |- demo_inference.py
|  |- demo_runtime.py
|  |- demo_runtime_suite.py
|- weights/
|  |- janegpt_v2_janus.pt
|  |- tokenizer.json
|- reports/
|  |- fair_benchmarks.json
|  |- fair_benchmarks.md
|  |- janus_model_report.json
|  |- janus_model_report.md
|  |- public_benchmarks.json
|  |- *.png benchmark visuals

Limitations

  • English-focused command language.
  • Command NLU model, not an open-domain generative chatbot.
  • MASSIVE and SNIPS mapped-intent accuracy is excluded from headline claims because mapping coverage is partial.

Use Cases

  • Virtual assistant command routing
  • Smart home intent classification
  • Voice command understanding
  • Chatbot intent detection
  • Edge device deployment (small enough for embedded systems)

Part of the JANE Project

JANE โ€” a fully offline, privacy-first AI voice assistant.

๐Ÿ”— JANE AI Assistant on GitHub ๐Ÿ”— JaneGPT-v2 on GitHub


Created By

Ravindu Senanayake

Built from scratch โ€” architecture, tokenizer, and training pipeline designed and implemented by the author.

GitHub


License

Apache-2.0 (see LICENSE).

Downloads last month
59
Safetensors
Model size
7.95M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Evaluation results