File size: 2,439 Bytes
1b3441b
 
89edf04
1b3441b
89edf04
 
 
 
 
 
 
 
 
b8bd377
 
 
1b3441b
89edf04
1b3441b
 
89edf04
1b3441b
 
 
 
 
 
 
 
 
729c660
1b3441b
 
 
729c660
1b3441b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
base_model: allenai/BAR-5x7B
tags:
- allenai
- bar
- flex-olmo
- olmo
- moe
- mixture-of-experts
- gguf
- llama.cpp
- quantized
- q4_k_m
- 16gb
- 24gb
language:
- en
pipeline_tag: text-generation
library_name: gguf
base_model_relation: quantized
---
# BAR-5x7B — GGUF (first-of-its-kind FlexOlmo conversion)

This is the **first GGUF conversion** of [`allenai/BAR-5x7B`](https://huggingface.co/allenai/BAR-5x7B), the largest member of AllenAI's BAR-family Mixture-of-Experts models released on **2026-04-19** based on the new **FlexOlmo** architecture.

5 experts × 7B → ~33B total parameters with top-k routing.

## ⚠ Requires patched llama.cpp

The FlexOlmo architecture is **not yet supported in upstream `llama.cpp`**. To run this GGUF use the FlexOlmo support fork:

- **Fork:** https://github.com/Seraphiel102/llama.cpp/tree/flex-olmo-pr-clean

**Build from the fork:**

```bash
git clone https://github.com/Seraphiel102/llama.cpp.git
cd llama.cpp
git checkout flex-olmo-pr-clean
cmake -B build -DGGML_CUDA=OFF
cmake --build build -j --target llama-cli llama-quantize llama-completion
```

## What FlexOlmo is

Per [`transformers.models.flex_olmo`](https://github.com/huggingface/transformers/tree/main/src/transformers/models/flex_olmo), FlexOlmoDecoderLayer is **Olmo2's hybrid post-norm decoder layer with the dense FFN swapped for OlmoE-style top-k MoE routing**. Specifically:

- Attention with q_norm and k_norm (Olmo2-style)
- `post_attention_layernorm` and `post_feedforward_layernorm` (post-norm pattern, no input_layernorm)
- Top-k MoE FFN with softmax routing (OlmoE-style)
- No sliding-window attention

## Files

| Quant | Size | Notes |
|---|---|---|
| `BAR-5x7B.Q4_K_M.gguf` | 14 GB | recommended, fits 16GB VRAM at small context |
| (more quants pending) | | |

## Usage

```bash
./build/bin/llama-completion \
  -m BAR-5x7B.Q4_K_M.gguf \
  -p "The 5 experts in BAR-5x7B are " \
  -n 100
```

## Validation

The Q4_K_M conversion was validated against the patched llama.cpp build using a basic arithmetic prompt and produces correct, coherent output.

## Credit

- **Model:** AllenAI — [`allenai/BAR-5x7B`](https://huggingface.co/allenai/BAR-5x7B)
- **FlexOlmo support in llama.cpp:** PR by [@Seraphiel102](https://github.com/Seraphiel102) / Nyx
- **Conversion:** llama.cpp + the `convert_hf_to_gguf.py` patch from the support PR

If this saved you time, please ⭐ the llama.cpp PR.