โšก coffy-2.4-flash

Sparse Mixture-of-Experts Foundation Model for Code Intelligence & Agentic Workflows

Model Open Weights Parameters Experts

Overview โ€ข Key Capabilities โ€ข Specifications โ€ข Architecture โ€ข Quickstart โ€ข PEFT Adapters โ€ข License โ€ข Citation


Overview

coffy-2.4-flash is an open-weights Sparse Mixture-of-Experts (MoE) model. It anchors every representation through 1 Universal Shared Expert (always on) and routes tokens across 8 Fine-Grained Routed Experts (Top-4 dynamic softmax routing).

The model ships at a compact 2.84 Billion parameters โ€” a deliberately small-footprint MoE: dense-style memory requirements with sparse-MoE specialization. This release restores the original checkpoint with fixed, working modeling code (real causal attention with RoPE, GQA, RMSNorm, and proper top-k expert routing).

Tokenizer note: this checkpoint's embedding table contains 2,048 rows, while the shipped tokenizer emits a larger vocabulary. The modeling code clamps out-of-range token ids so inference always runs; ids โ‰ฅ 2048 share the last embedding row. This checkpoint reflects an early training state โ€” output text is not coherent conversational language yet.


Key Capabilities

  • ๐Ÿงฉ Compact MoE Design: 8 routed specialists + 1 universal shared anchor expert, Top-4 dynamic routing per token.
  • โš™๏ธ Custom Architecture: CoffyMoEForConditionalGeneration with dedicated expert registry โ€” foundation, code synthesis, world knowledge, agentic planning, structured logic, analytical reasoning, polyglot algorithms, mathematical rigor.
  • ๐Ÿ”ง Fixed Inference Stack: real causal self-attention (GQA 32Q/8KV, RoPE) โ€” replaces the earlier non-functional forward pass.
  • ๐Ÿงฒ PEFT Adapters: plug-and-play task adapters for Software Engineering (coding-swe), Math (math-reasoner), and Function Calling (agentic-tools).
  • ๐Ÿ  Self-Contained: runs fully offline via transformers with trust_remote_code=True.

Model Specifications

Parameter Specification Description
Model Name coffy-2.4-flash Official release name
Architecture CoffyMoEForConditionalGeneration Sparse MoE with Shared Anchor
Total Parameters 2,842,192,512 (2.84B) Verified from tensor headers
Decoder Layers 2 Matches the shipped weights
Hidden Dimension 4,096 Base representation width
Attention GQA โ€” 32 Query / 8 KV heads head_dim = 128, causal, RoPE (ฮธ = 1e7)
Total Experts 8 Routed + 1 Shared 9 experts per MoE layer
Active Experts / Token Top-4 Routed + 1 Shared 5 experts activated per token
Intermediate Size 12,288 Per-expert FFN width (SwiGLU)
Embedding Table 2,048 rows โš ๏ธ see tokenizer note above
Weight Precision bf16 4 safetensors shards, 5.69 GB
License Apache-2.0 (open weights) See License & Availability

Architecture Deep-Dive

Each decoder layer follows the modern residual recipe:

x = x + SelfAttention(RMSNormโ‚(x))      # GQA + RoPE, causal
x = x + MoE(RMSNormโ‚‚(x))                # shared expert + top-4 routed experts

The MoE block always computes the Universal Shared Expert (baseline fluency & coherence) and dispatches each token to the Top-4 routed experts by softmax gate probability. Routing logits are produced by a linear gate over the hidden state.

The coffy.visual.* tensors shipped in the checkpoint are a fragment of a vision tower; they are loaded by the modeling code but the tower is not functional in this revision.


Quickstart Guide

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Piyush00023/coffy-2.4-flash"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True, torch_dtype="auto")

msgs = [{"role": "user", "content": "Who are you?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
out = model.generate(ids, max_new_tokens=80)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))

Modular PEFT Task Adapters

Adapters live under lora/ and load with peft on top of the base checkpoint:

Adapter Path Task
coding-swe lora/coding-swe Software engineering workflows
math-reasoner lora/math-reasoner Mathematical reasoning
agentic-tools lora/agentic-tools Tool / function calling

License & Availability

Open weights release.

The model weights in this repository are released openly for download and use under the Apache-2.0 license. The repository contents are provided as-is for inference use.


Citation

@misc{coffy2.4flash,
  title  = {coffy-2.4-flash: Sparse Mixture-of-Experts Foundation Model},
  author = {Piyush00023},
  year   = {2026},
  url    = {https://huggingface.co/Piyush00023/coffy-2.4-flash}
}

Contact

For questions, feedback, or collaboration inquiries regarding this model, reach out:

๐Ÿ“ง piyushdas000@gmail.com

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

Model tree for Piyush00023/coffy-2.4-flash

Quantizations
1 model