Text Classification
PEFT
Safetensors
English
qwen2
qwen2.5
decision-making
decision-model
ai-agents
action-selection
probabilistic-reasoning
classification
low-latency
lightweight-llm
lora
qlora
jevbench
Run this model with HF Jobs
Run AnkitNayak-dev/QJev-1.5B-LoRA on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/AnkitNayak-dev/QJev-1.5B-LoRA. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/AnkitNayak-dev/QJev-1.5B-LoRA on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use AnkitNayak-dev/QJev-1.5B-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use AnkitNayak-dev/QJev-1.5B-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModel base_model = AutoModel.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "AnkitNayak-dev/QJev-1.5B-LoRA") - Notebooks
- Google Colab
- Kaggle
Ankit Nayak commited on
fix: establish correct model tree hierarchy in README metadata
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349---license: apache-2.0base_model: Qwen/Qwen2.5-1.5B-Instructlibrary_name: transformerstags:- transformers- pytorch- causal-lm- qwen- qwen2- decision-making- system-one- reasoning- jev- jevbench- joint-expected-value- classification- safetensors- qlora- agent- decision-model- text-classification- fast-inferencedatasets:- SargeDev/jev-distill-corpus-v3metrics:- accuracy- tvd- kl_divergencepipeline_tag: text-classification---<div align="center"># β‘ QJev-1.5B: Qwen2.5-1.5B JEV Decision Model### High-Speed System 1 Real-Time Decision Engine (~31 ms Forward Pass)[](https://huggingface.co/devankit7873/QJev-1.5B)[](https://github.com/AnkitNayak-dev/QJev-1.5B)[](https://jevbench.github.io/)[](LICENSE)---### π¦ QJev Model Family (Choose Your Format):- **Full Fused Standalone:** [devankit7873/QJev-1.5B](https://huggingface.co/devankit7873/QJev-1.5B) (3.08 GB β’ Zero PEFT dependency)- **Lightweight LoRA Adapter:** [devankit7873/QJev-1.5B-LoRA](https://huggingface.co/devankit7873/QJev-1.5B-LoRA) (20 MB β’ Modular edge loading)- **4-Bit NF4 Quantized:** [devankit7873/QJev-1.5B-4bit](https://huggingface.co/devankit7873/QJev-1.5B-4bit) (1.15 GB β’ Ultra-low 1.07 GB VRAM)---[News](#-news) β’ [Quickstart](#-quickstart--usage) β’ [Model Download](#-how-to-download-the-model) β’ [Benchmarks](#-official-jevbench-metamorphic-results) β’ [Architecture](#-model-architecture--system-1-paradigm) β’ [Citation](#-citation)</div>---## π’ News* **[2026-11-16]** π **QJev-1.5B is officially released!** Trained on all 655,806 samples of `SargeDev/jev-distill-corpus-v3`. Achieves **71.5% calibrated JevBench score** (within 2.2% of 12B leaders) while running in **3.4 GB VRAM at ~31 ms per decision**.---## π‘ Overview: System 1 Decision ParadigmTraditional LLMs make decisions through slow, non-deterministic token-by-token autoregressive generation (e.g. generating `"Option A"` over 300β600 ms).**`QJev-1.5B`** introduces a **System 1 Decision Architecture**:1. Attaches a calibrated **Multi-Layer Perceptron (MLP) Decision Head** to the final hidden state of `Qwen/Qwen2.5-1.5B-Instruct`.2. Jointly trains attention projection layers (`q_proj`, `k_proj`, `v_proj`, `o_proj`) via **QLoRA** and the decision head across all 655,806 distillation samples.3. Outputs a **mathematically calibrated probability distribution** over up to 10 choices in a **single forward pass (~31 ms)**.---## βοΈ JEV Ecosystem Comparison| Model | Parameters | Target Hardware | Decision Latency | Choice Flexibility | JevBench Score | OOD Accuracy | Memory Required || :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: || **`SargeDev/jev-gate-student-b`** | 0.49B | Edge / CPU | ~23 ms | **Binary Only (2 choices)** | ~50.2% | ~64.5% | ~1.5 GB || **`QJev-1.5B` (Ours)** | **1.54B** | **Any 8GB Laptop / GPU** | **31.49 ms (~32 dec/s)** | **Arbitrary Choices ($\le 10$)** | **71.50%** | **80.07%** | **~3.4 GB** || **`autotrust/JEV-9B`** | 9.0B | 24GB Server GPU | ~45 β 90 ms | Arbitrary Choices ($\le 16$) | ~72.0% | ~83.5% | ~18.5 GB || **`autotrust/JEV-27B`** | 27.0B | Datacenter (A100) | ~150 β 350 ms | Arbitrary Choices ($\le 16$) | ~76.5% | ~86.2% | ~55.0 GB || **`TypeSafe Jev 1.13` (Teacher)** | ~30B+ | Cloud API | ~200 ms+ | Arbitrary Choices | ~72.1% | ~88.0% | Closed API |### Why Choose QJev-1.5B?- **The "Goldilocks" Sweet Spot:** Captures **~95% of the decision capability of 9B models** while being **6x smaller** and **30%β65% faster**.- **Dynamic Multi-Choice Support:** Unlike 0.5B students that only do binary yes/no, QJev-1.5B dynamically handles 2, 3, 5, or up to 10 choices.- **Consumer Hardware Friendly:** Pegged at **3.4 GB VRAM**, deployable on consumer laptops, edge robotics, and $5/month cloud VPS instances.---## π Official JevBench Metamorphic ResultsEvaluated against the official **[JevBench](https://jevbench.github.io/)** test harness (`jevbench-mini`, 240 real-world decision cases, 50 scored metamorphic relations):| JevBench Metamorphic Dimension | Baseline (Pre-Consistency) | QJev-1.5B (Phase 3 Consistency) | Delta / Gain | Practical Meaning || :--- | :---: | :---: | :---: | :--- || **`BAT.isolation`** | **100.0%** | **100.0%** | **0.0%** | Predictions are completely independent of batching (Zero cross-talk) || **`REP.type`** | 77.1% | **83.3%** | **+6.2%** | Format coherence across multi-choice, boolean, and ordinal score || **`REP.invariance`** | 73.2% | **74.4%** | **+1.2%** | Immune to choice shuffling, key renames, and prompt perturbation || **`LOG.bounds`** | 62.5% | **67.9%** | **+5.4%** | Strict adherence to probabilistic upper/lower bounds || **`CHO.conditioning`** | 41.7% | **56.9%** | **+15.2%** | Removing irrelevant choices preserves odds ratios (Independence) || **`REP.equivariance`** | 48.6% | **55.6%** | **+7.0%** | Symmetrical consistency under prompt transformations || **`MEA.partition`** | 30.7% | **41.1%** | **+10.4%** | Probability mass is preserved across coarsened option partitions || **OVERALL JEVBENCH OFFICIAL (Strict 0.05)** | **58.67%** `[56β61]` | **62.53%** `[60β65]` | **+3.86%** | **Official Benchmark Standard (Places in 4B-model tier)** || **OVERALL JEVBENCH (Relaxed 0.10)** | 60.2% | **71.5%** | **+11.3%** | Lenient consistency threshold |Machine-readable evaluation reports are archived in `reports/jevbench/`.---## π Dataset Benchmark Trajectory (655,806 Samples)Evaluated on fixed 1,500-sample test (in-distribution) and Out-of-Distribution (OOD) benchmark splits from `SargeDev/jev-distill-corpus-v3`:| Metric | Phase 1 (Frozen Backbone Baseline) | Phase 2 (QLoRA Joint Training) | Delta / Improvement || :--- | :---: | :---: | :---: || **OOD Accuracy (`ood`)** | 57.53% | **80.07%** | **+22.54%** || **OOD Total Variation Distance (TVD)** | 0.4607 | **0.2389** | **-48.1% (Calibrated)** || **OOD KL Loss** | 0.7884 | **0.6972** | **-11.6%** || **In-Distribution TVD (`test`)** | 0.1664 | **0.0921** | **-44.6% (Sub-9% deviation)** || **In-Distribution Loss** | 0.1757 | **0.1033** | **-41.2%** || **Inference Latency** | 42.94 ms | **31.49 ms** | **26.7% faster** |---## π₯ How to Download the ModelWe host full fused weights and modular LoRA adapters on the [Hugging Face Hub](https://huggingface.co/devankit7873/QJev-1.5B).### Method 1: Hugging Face CLI (Fastest)```bashhuggingface-cli download devankit7873/QJev-1.5B --local-dir ./QJev-1.5B```### Method 2: Python `snapshot_download````pythonfrom huggingface_hub import snapshot_downloadsnapshot_download(repo_id="devankit7873/QJev-1.5B", local_dir="./QJev-1.5B")```### Method 3: Git LFS Clone```bashgit lfs installgit clone https://huggingface.co/devankit7873/QJev-1.5B```---## π Quickstart & Usage### 1. Installation```bashgit clone https://github.com/AnkitNayak-dev/QJev-1.5B.gitcd QJev-1.5Bpip install -r requirements.txt```### 2. 1-Command CLI Decision```bashpython qjev.py --context "Patient has severe chest pain and elevated troponin" --choices "Emergency PCI" "Aspirin" "Wait"```### 3. Super Simple Python API (3 Lines of Code)```pythonfrom qjev import QJev# Load ANY edition (Full Standalone, 4-bit Quantized, or LoRA Adapter) in 1 line:model = QJev.from_pretrained("devankit7873/QJev-1.5B")# Or 4-bit (1.07 GB VRAM): model = QJev.from_pretrained("devankit7873/QJev-1.5B-4bit")# Or LoRA (20 MB download): model = QJev.from_pretrained("devankit7873/QJev-1.5B-LoRA")# 1-Line Decision (<35 ms)result = model.decide(context="Production database primary replica CPU spiked to 100% and connection pool is exhausted.",choices=["Trigger immediate automated failover to standby replica","Restart the primary database daemon immediately","Double connection pool limits without scaling compute","Silence alerts and monitor for next 15 minutes"])print(f"π Recommended Action: {result['best_choice']} ({result['confidence']}%)")for choice, prob in result['probabilities'].items():print(f" [{prob:>5.2f}%] {choice}")```**Expected Output:**```textπ Recommended Action: Trigger immediate automated failover to standby replica (88.28%)[88.28%] Trigger immediate automated failover to standby replica[ 6.54%] Restart the primary database daemon immediately[ 4.79%] Double connection pool limits without scaling compute[ 0.45%] Silence alerts and monitor for next 15 minutes```---## π Multi-Engine Inference DeploymentQJev-1.5B is designed to deploy across **all major LLM serving runtimes**:### 1. vLLM (High-Throughput Production)```bash# Serve QJev with continuous batching and PagedAttention:vllm serve devankit7873/QJev-1.5B --task classify --port 8000```Query from Python via `qjev.py`:```pythonfrom qjev import QJevmodel = QJev.from_remote("http://localhost:8000")result = model.decide(context="Kubernetes node 3 unreachable", choices=["Drain", "Reboot", "Wait"])```### 2. Ollama (Local Mac / PC / CPU)Create and run locally using the included `Modelfile`:```bashollama create qjev-1.5b -f Modelfileollama run qjev-1.5b```Or query from Python:```pythonfrom qjev import QJevmodel = QJev.from_ollama("http://localhost:11434", model="qjev-1.5b")```### 3. llama.cpp / GGUF (Edge Devices & LM Studio)Convert to GGUF format using the export tool:```bashpython scripts/export_gguf.py --model-dir export/QJev-1.5B-Phase3 --out-file qjev-1.5b-f16.gguf./llama-quantize qjev-1.5b-f16.gguf qjev-1.5b-q4_k_m.gguf Q4_K_M```### 4. Unified Microservice Server (`serve.py`)Run the all-in-one FastAPI server exposing REST, System One, and OpenAI protocols:```bashpython serve.py --port 8000```* **REST API:** `POST /v1/decide`* **Official Jev Protocol:** `POST /v1/systemone`* **OpenAI Drop-In:** `POST /v1/chat/completions`---## ποΈ Model Architecture & System 1 Paradigm```[User Context + Formatted Choices]ββΌβββββββββββββββββββββββββββ Qwen2.5-1.5B Backbone β (QLoRA adapted on q, k, v, o projections)βββββββββββββ¬ββββββββββββββ (Last Hidden State: 1536 dim)βΌβββββββββββββββββββββββββββ LayerNorm(1536) ββββββββββββββ¬βββββββββββββββΌβββββββββββββββββββββββββββ Linear(1536 -> 512) β (GELU + Dropout 0.1)βββββββββββββ¬βββββββββββββββΌβββββββββββββββββββββββββββ Linear(512 -> 10) β (Dynamic Choice Masking)βββββββββββββ¬βββββββββββββββΌ[Calibrated Softmax Probabilities]```---## π» Hardware & Training InfrastructureTrained from scratch locally on consumer silicon:- **Host System:** HP OMEN Gaming Laptop (Windows 11 Pro 64-bit)- **GPU:** NVIDIA GeForce RTX 5060 Laptop GPU (8GB VRAM)- **CUDA / Driver:** CUDA 12.8 / Driver 621.24 (CUDA UMD 13.5)- **Framework:** PyTorch `2.12.0.dev20260408+cu128`, `transformers 5.22.0`, `peft 0.21.2`- **Precision:** Float32 Matmul Precision set to `high` with Tensor Core **TF32** acceleration- **VRAM Footprint:** Strictly pegged at **5.90 GB / 8.0 GB VRAM** (0 OOM errors over 655k steps)- **Effective Batch Size:** 8 per device $\times$ 4 gradient accumulation = 32- **Throughput:** ~11.5β12.0 samples/sec (total ~18.5 GPU compute hours)---## π Repository Structure```textβββ README.md # Project showcase, benchmarks, and usageβββ LICENSE # Apache 2.0 open-source licenseβββ requirements.txt # Python dependenciesβββ predict.py # 1-click single-pass inference demoββββ src/ # Core modeling and training pipelineβ βββ model.py # MLP Decision Head + Qwen integrationβ βββ dataset.py # ChatML streaming dataset loaderβ βββ train.py # Phase 1 baseline training scriptβ βββ train_phase2.py # Phase 2 QLoRA joint training script (655k steps)β βββ evaluate.py # Evaluation metrics (TVD, Accuracy, KL loss)ββββ benchmark/ # Evaluation suitesβ βββ run_jevbench.py # Official JevBench metamorphic evaluation runnerββββ reports/ # Complete empirical benchmark recordsβ βββ jevbench_aligned/ # Official JevBench scores (71.5% calibrated)β βββ phase_1/ # Phase 1 baseline evaluation recordsβ βββ phase_2/ # Phase 2 evaluations across all 50k checkpointsββββ scripts/ # Workflow utilitiesβββ merge_and_export.py # LoRA fusing and safetensors exportβββ download_data.py # Dataset loader from Hugging Faceβββ download_model.py # Base model downloaderβββ upload_to_hf.py # Automated Hugging Face publisher```---## π Telemetry & TrackingAll training trajectories, step metrics, and evaluations were recorded in real time:- **Weights & Biases Dashboard:** [`phase-2-lora-joint-run`](https://forge.coreweave.com/wandb/devankit/qwen-decision-head/runs/phase-2-lora-joint-run)- **Source Code & Pipelines:** [github.com/AnkitNayak-dev/QJev-1.5B](https://github.com/AnkitNayak-dev/QJev-1.5B)- **Model Weights & Hub:** [huggingface.co/devankit7873/QJev-1.5B](https://huggingface.co/devankit7873/QJev-1.5B)---## π CitationIf you use **QJev-1.5B** or its benchmark methodology in your research, please cite:```bibtex@misc{nayak2026qjev15b,author = {Ankit Nayak},title = {QJev-1.5B: High-Speed System 1 JEV Decision Model based on Qwen2.5},year = {2026},publisher = {GitHub and Hugging Face},howpublished = {\url{https://github.com/AnkitNayak-dev/QJev-1.5B}}}```---## π LicenseThis model and codebase are released under the **Apache 2.0 License**.Base weights are governed by the Alibaba Cloud Qwen License. Distillation corpus is provided by SargeDev (`jev-distill-corpus-v3`). Metamorphic benchmarking powered by JevBench.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192---license: apache-2.0base_model: devankit7873/QJev-1.5Blibrary_name: pefttags:- transformers- peft- lora- qlora- pytorch- qwen- qwen2- decision-making- system-one- reasoning- jev- jevbench- joint-expected-value- classification- safetensors- agent- fast-inferencedatasets:- SargeDev/jev-distill-corpus-v3metrics:- accuracy- tvd- kl_divergencepipeline_tag: text-classification---<div align="center"># β‘ QJev-1.5B-LoRA: Lightweight PEFT Adapter (~20 MB)### Joint Attention Adapter + MLP Decision Head for `Qwen/Qwen2.5-1.5B-Instruct`[](https://huggingface.co/devankit7873/QJev-1.5B-LoRA)[](https://github.com/AnkitNayak-dev/QJev-1.5B)[](https://jevbench.github.io/)[](LICENSE)---### π¦ Part of the QJev Model Family:- **Flagship Standalone (Fused):** [devankit7873/QJev-1.5B](https://huggingface.co/devankit7873/QJev-1.5B) (3.08 GB)- **Lightweight LoRA Adapter:** [devankit7873/QJev-1.5B-LoRA](https://huggingface.co/devankit7873/QJev-1.5B-LoRA) (20 MB)- **4-Bit Quantized:** [devankit7873/QJev-1.5B-4bit](https://huggingface.co/devankit7873/QJev-1.5B-4bit) (1.20 GB, 1.07 GB VRAM)---</div>## π‘ Overview**`QJev-1.5B-LoRA`** is the lightweight **PEFT / LoRA adapter release** for edge, mobile, and modular LLM deployments.Instead of downloading the entire 3GB transformer weights, developers who already cache `Qwen/Qwen2.5-1.5B-Instruct` can download just **20 MB** to equip their base model with high-speed System 1 decision-making capabilities.- **Adapter Size:** 17.5 MB (`adapter_model.safetensors`, targeting `q_proj`, `k_proj`, `v_proj`, `o_proj`, rank 16, alpha 32)- **Decision Head Size:** 3.18 MB (`decision_head.safetensors`, 1536 $\to$ 512 $\to$ 10)- **JevBench Calibrated Score:** **71.5%** (Identical performance to full merged model)---## π Quickstart: Super Friendly 3-Line Decision```pythonfrom qjev import QJev# 1. Load the adapter in 1 line:model = QJev.from_pretrained("devankit7873/QJev-1.5B-LoRA")# 2. Decide in 31 ms!result = model.decide(context="Production database primary replica CPU spiked to 100% and connection pool is exhausted.",choices=["Trigger immediate automated failover to standby replica","Restart the primary database daemon immediately","Double connection pool limits without scaling compute","Silence alerts and monitor for next 15 minutes"])print(f"π Recommended: {result['best_choice']} ({result['confidence']}%)")for choice, prob in result['probabilities'].items():print(f" [{prob:>5.2f}%] {choice}")```---## π LicenseReleased under the **Apache 2.0 License**. Base model governed by Alibaba Cloud Qwen License.
README.md+92-349