Run this model with HF Jobs

Run Dev9124/EKA-1-INT4 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 and TRL to fine-tune https://huggingface.co/Dev9124/EKA-1-INT4. 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/Dev9124/EKA-1-INT4 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.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/Dev9124/EKA-1-INT4. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
File size: 5,232 Bytes
b32b5a9
 
 
2c3bc0a
b32b5a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
580dd60
 
 
b32b5a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
license: apache-2.0
base_model: soketlabs/EKA-1
base_model_relation: quantized
library_name: transformers
pipeline_tag: text-generation
tags:
- eka
- raslnet
- mamba2
- moe
- mla
- int4
- int4
- weight-only
---

# EKA-1 · INT4 (weight-only, W4A16 g64)

This repository is a **4-bit weight-only quantized** build of
[`soketlabs/EKA-1`](https://huggingface.co/soketlabs/EKA-1) (RASLNet: Mamba-2 + latent MoE + MLA,
26.3B total / 3.6B active parameters, 64K context, 256K vocab).

Unlike GPTQ/AWQ/bitsandbytes builds, this checkpoint keeps the original EKA module graph and
stores every eligible `nn.Linear` as a packed integer tensor plus scales, decoded by the
`EkaQuantLinear` module shipped in `modeling_eka.py`. It loads with the model's own
`trust_remote_code`, no external quantization library.

## Quantization spec

| | |
|---|---|
| Scheme | symmetric weight-only, 4-bit |
| INT8 | per-output-channel scale (`amax/127`) |
| INT4 | group-wise, group size **64**, symmetric (`amax/7`), two nibbles per byte |
| Quantized | all `nn.Linear` in attention, Mamba projections, shared experts and the 23 × 128 routed experts |
| Kept BF16/FP32 | token embeddings, LM head (`output_layer`), router gate and `e_score_correction_bias` (FP32, required for routing), norms, Mamba `conv1d`/`A_log`/`D`/`dt_bias`, MLA norms |
| Size on disk | **16 GB** (BF16 base: 52.6 GB) |
| Dequantization | lazy, on first forward per module; VRAM then approaches the BF16 footprint |

> **Hub metadata:** the parameter counter shows ~14.5B because packed `uint4` tensors store two weights per byte; the model has **26.3B** parameters (24.2B of them in 4-bit).


## Files

```
config.json
configuration_eka.py
generation_config.json
modeling_eka.py                 # + EkaQuantLinear / replace_linear_with_quant
model-00001-of-00003.safetensors
model-00002-of-00003.safetensors
model-00003-of-00003.safetensors
model.safetensors.index.json
tokenizer.json  tokenizer.model  tokenizer_config.json  special_tokens_map.json
chat_template.jinja
README.md  EKA-1_banner_light.svg  eka_architecture.svg
```

`config.json` carries `eka_quantization: {"bits": 4, "group_size": 64, ...}`; `modeling_eka.py`
builds `EkaQuantLinear` layers only when that key is present, so the same code file also serves the
BF16 base model.

## Usage (tested)

Requires **transformers 5.10.0** — EKA's hybrid cache (`build_eka_cache`) is not compatible with
the 4.x cache API nor with 5.17's revised `Cache`/`ConvCache` protocol. Python 3.12, torch 2.13.

```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "Dev9124/EKA-1-INT4"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    repo, trust_remote_code=True, dtype=torch.bfloat16, device_map="auto"
).eval()

messages = [{"role": "user", "content": "What is 17*23? Answer with the number only."}]
inputs = tok.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to(model.device)

with torch.no_grad():
    out = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tok.decode(out[0, inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
```

Smoke-tested output (greedy, 16 tokens):
`Okay, let's see. I need to calculate 17 multiplied by 23.`

## Quantization fidelity vs BF16

Single forward pass, same 12-token chat prompt, last-position logits compared with the BF16
checkpoint on the same stack:

| Metric | INT8 | INT4 |
|---|---|---|
| cosine similarity (logits) | **0.99991** | **0.99623** |
| max abs logit delta | 1.375 | 14.969 |
| top-50 token overlap | 47 / 50 | 37 / 50 |
| argmax token | same as BF16 | same as BF16 |

This is a numerical sanity check, not a benchmark.

## Benchmarks

The base model card reports (BF16): GSM8K **92.0**, MMLU-Redux **80.5**, IFEval **72.6 / 80.2**
(prompt / instruction).

gBench (`gsm8k`, `mmlu_redux`, `ifeval`) was run on this box against a **different 8-bit build**
(vLLM online quantization: INT8 W8A16 routed experts + FP8 W8A8 linears), not against this exact
checkpoint:

| Suite | BF16 (model card) | 8-bit vLLM build (measured) |
|---|---|---|
| GSM8K | 92.0 | 68.23 strict / 81.35 flexible |
| MMLU-Redux | 80.5 | 61.39 |
| IFEval | 72.6 / 80.2 | 64.33 prompt-strict |

The BF16 baseline was not re-run on this harness, so the gap mixes quantization and harness
differences; it is **not** a like-for-like quantization-loss table. No evaluation of this INT4
checkpoint has been run yet.

## GGUF

No GGUF is provided. `EkaV1ForCausalLM` (RASLNet: Mamba-2 + latent MoE + MLA) has no
implementation in llama.cpp / ggml, so `convert_hf_to_gguf.py` rejects it
(`Model EkaV1ForCausalLM is not supported`) and Unsloth's exporter — which wraps the same
converter — cannot convert it either. A GGUF port needs a new `LLM_ARCH` (graph + kernels +
tensor mapping), not just a conversion script.

## Provenance

- Base: `soketlabs/EKA-1` @ `main`, 52.6 GB BF16 safetensors, Apache-2.0.
- Quantizer: in-repo `EkaQuantLinear` + `replace_linear_with_quant` (`modeling_eka.py`),
  weight-only symmetric, no calibration data.
- Hardware used: 1 × NVIDIA RTX PRO 6000 Blackwell (96 GB), CUDA 13.2.