Instructions to use andyoneal/P6-E20B-A7B-D3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use andyoneal/P6-E20B-A7B-D3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="andyoneal/P6-E20B-A7B-D3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("andyoneal/P6-E20B-A7B-D3") model = AutoModelForCausalLM.from_pretrained("andyoneal/P6-E20B-A7B-D3", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use andyoneal/P6-E20B-A7B-D3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "andyoneal/P6-E20B-A7B-D3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "andyoneal/P6-E20B-A7B-D3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/andyoneal/P6-E20B-A7B-D3
- SGLang
How to use andyoneal/P6-E20B-A7B-D3 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "andyoneal/P6-E20B-A7B-D3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "andyoneal/P6-E20B-A7B-D3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "andyoneal/P6-E20B-A7B-D3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "andyoneal/P6-E20B-A7B-D3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use andyoneal/P6-E20B-A7B-D3 with Docker Model Runner:
docker model run hf.co/andyoneal/P6-E20B-A7B-D3
P6-E20B-A7B-D3
An experimental, untrained expansion of NVIDIA's Nemotron-3.5 Bolt E4B into a Gemma 4 mixture-of-experts model, made as a base for fine-tuning research. Text only.
How it was built
- Start from Bolt (
nvidia/NVIDIA-Nemotron-3.5-Bolt-E4B-BF16@49843eed), keeping its dense FFN in every layer. - Add role-play fine-tunes of
gemma-4-E4B-itas experts, mergekit-moe style. Each expert is Bolt's FFN plus one donor's FFN change (donor minusgemma-4-E4B-it, as low-rank factors). Expert 0 is Bolt's own FFN.AuriAetherwiing/G4-E4B-Musica-v1-lora@b87c464fchimbiwide/Gemma4NPC-E4B@cbd40b61juiceb0xc0de/bella-bartender-gemma-e4b@46c7071aToastyPigeon/Gemma4-E4B-TIES-3mask-r64@34fda2cb
- Gemma 4's native MoE block on every layer, beside the dense FFN: five experts, each a complete 10,240-wide FFN, top-1.
- Router set from hidden states without training, as mergekit-moe's
hiddengate does: each expert's row points at Bolt's hidden states on that donor's kind of text; expert 0 takes general and maths text.
20.5B effective parameters (23.98B with the per-layer embeddings, 48 GB in bf16), about 7.3B active. A stock
Gemma4ForCausalLM config that loads in transformers and mlx-lm. The chat template is Gemma 4's own; Bolt's variant
orders tool-call messages differently, which may suit agentic use better.
Status
No damage a blind LLM judge could see against Bolt's role-play; before any training it predicts held-out human role-play 0.26 nats a token better than Bolt, each scored at its best temperature. Known issue: the router sends only 29% of general text to Bolt's expert, and Musica's expert wins only 14% of Musica's own text. A fitted router is planned.
Fine-tuning notes
These notes are for anyone who trains LoRA adapters on Gemma 4 26B-A4B with Axolotl and releases merged checkpoints. P6
has 26B-A4B's MoE block (a dense FFN beside routed experts in every layer) on an E4B body. Nobody has trained P6 in
Axolotl yet. These notes come from reading Axolotl 59b27488, transformers 5.20.2 and PEFT, and from how P6 is built.
axolotl-lora.yaml applies them to Axolotl's 26B-A4B bnb-LoRA recipe.
- Retarget the LoRA regex. P6 is a text-only
Gemma4ForCausalLM, so its layers aremodel.layers.N, notmodel.language_model.layers.N, and Axolotl's 26B-A4B regex matches nothing. Uselora_target_modules: 'model.layers.[\d]+.(_checkpoint_wrapped_module.)?(mlp|self_attn).(up|down|gate|q|k|v|o)_proj'. Only layers 0β23 havek_projandv_proj; layers 24β41 reuse earlier layers' K/V (E4B's KV sharing). - Leave the router out. Under top-1 the routing weight is always 1, so
router.proj,router.scaleandrouter.per_expert_scaleget no useful gradient: training them does nothing. The regex above skips the router, andlora_target_linearwould wraprouter.projfor no benefit. A later revision of P6 is likely to replace the router. - Expert LoRA is optional.
lora_target_parameters: [experts.gate_up_proj, experts.down_proj]withquantize_moe_experts: trueshould work as on 26B-A4B (untested). P6 has 5 experts of width 10,240, top-1, against 26B-A4B's 128 of width 704, top-8. Each token updates only the expert it is routed to, so an expert your data rarely reaches barely changes. Without expert LoRA the donor experts stay as built, while attention and the dense FFN (Bolt's own, seen by every token) adapt. - Turn off the fused LoRA kernels. Axolotl's Gemma 4 README says they don't support KV-sharing layers: set
lora_mlp_kernel,lora_qkv_kernelandlora_o_kernelto false. Keepchat_template: gemma4andeot_tokens: ["<turn|>"]. - Leave the embeddings frozen. That covers E4B's per-layer embedding table (
embed_tokens_per_layer, 2.8B) and the embedding table, which is tied to the output head. Addinglm_headtomodules_to_saveunties it and adds 0.67B. - Memory and speed. P6's total is close to 26B-A4B's (24.0B against 25.2B), so QLoRA with
quantize_moe_expertsshould need similar VRAM. The per-layer embedding table stays in bf16 (about 5.6 GB). About 7.3B parameters are active per token against 26B-A4B's 3.8B, so expect roughly twice the compute per step. - Merge with
axolotl merge-loraor PEFT, not mergekit.merge-lorafolds expert adapters into the bf16 weights. mergekit's Gemma 4 support doesn't model per-layer embeddings or KV sharing. Keepconfig.jsonand the chat template as shipped. llama.cpp conversion of P6 is untested. - Read early loss with care. Bolt is over-confident on human-written role-play: 5.24 nats a token at temperature 1 against 3.82 at its best temperature. A fast early drop on such data is mostly that correcting, not new learning.
Licenses
The terms of every source apply: Bolt, OpenMDW-1.1; gemma-4-E4B-it and Gemma4NPC, Apache 2.0; Musica's base,
Apache 2.0 (its adapter card states none); Bella and TIES-3mask, the Gemma license on their cards.
- Downloads last month
- 21