Instructions to use erenyeager-1/Huihui4-8B-A4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use erenyeager-1/Huihui4-8B-A4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="erenyeager-1/Huihui4-8B-A4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("erenyeager-1/Huihui4-8B-A4B") model = AutoModelForImageTextToText.from_pretrained("erenyeager-1/Huihui4-8B-A4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use erenyeager-1/Huihui4-8B-A4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "erenyeager-1/Huihui4-8B-A4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "erenyeager-1/Huihui4-8B-A4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/erenyeager-1/Huihui4-8B-A4B
- SGLang
How to use erenyeager-1/Huihui4-8B-A4B 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 "erenyeager-1/Huihui4-8B-A4B" \ --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": "erenyeager-1/Huihui4-8B-A4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "erenyeager-1/Huihui4-8B-A4B" \ --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": "erenyeager-1/Huihui4-8B-A4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Studio
How to use erenyeager-1/Huihui4-8B-A4B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for erenyeager-1/Huihui4-8B-A4B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for erenyeager-1/Huihui4-8B-A4B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for erenyeager-1/Huihui4-8B-A4B to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="erenyeager-1/Huihui4-8B-A4B", max_seq_length=2048, ) - Docker Model Runner
How to use erenyeager-1/Huihui4-8B-A4B with Docker Model Runner:
docker model run hf.co/erenyeager-1/Huihui4-8B-A4B
🤖 Huihui4-8B-A4B Model Card
📌 Overview
Huihui4-8B-A4B is a lightweight MoE (Mixture of Experts) conversational model optimized from Google's gemma-4-26B-A4B-it architecture. Through expert pruning and supervised fine-tuning on high-quality dialogue data, this model significantly reduces computational overhead while preserving core reasoning and interaction capabilities. It is specifically designed for deployment on consumer-grade hardware and code-related conversational tasks.
This model is not an ablation variant.
ollama
Please use the latest version of ollama
You can use huihui_ai/huihui-4:8b directly,
ollama run huihui_ai/huihui-4:8b
🧱 Architecture & Configuration
| Parameter | Description |
|---|---|
| Base Model | google/gemma-4-26B-A4B-it |
| Total MoE Experts | 32 (pruned from the original 128) |
| Active Experts per Token | 8 (maintaining the A4B activation scale) |
| Model Positioning | Lightweight MoE conversational base / Consumer-hardware friendly |
📊 Training Data & Methodology
- Data Source: 500+ high-quality dialogue samples carefully extracted from code preference data.
- Training Method: Supervised Fine-Tuning (SFT).
- Optimization Goal: Maintain semantic coherence, instruction-following capability, and code context understanding post-pruning.
📈 Evaluation & Performance
- Evaluation Tool: Quantitative perplexity assessment using the
calculate_perplexityscript. - Test Results: Preliminary dialogue tests indicate smooth interactions and stable logic. The model performs reliably in daily conversations and code-assistance tasks, with no significant performance degradation observed after pruning.
💻 Inference & Deployment Recommendations
- Recommended Frameworks:
vLLM/llama.cpp/HuggingFace Transformers - VRAM Requirements:
FP16: < 18GBINT4/INT8 Quantized: < 6~9GB (compatible with mainstream single consumer GPUs)
- Use Cases: Code conversation assistants, lightweight task planning, local deployment prototyping, and baseline validation for MoE pruning/merging techniques.
🗺️ Roadmap
- Multi-Domain Fine-Tuning: Further SFT on four distinct datasets to enhance the generalization capabilities of this 32-expert model.
- Expert Merging Validation: Experiment with merging the four independently fine-tuned models back into a 128-expert architecture, validating the feasibility of a
"prune → fine-tune → merge"pipeline. - Core Objective: Ultimately verify the engineering viability of training and iterating on large-scale MoE models using only consumer-grade hardware.
- If you're interested, feel free to fine-tune this model on your own datasets. We plan to merge all resulting models into a unified version at the end.
📝 Notes
- This model represents the initial pruned and fine-tuned iteration of the
Huihuiseries. Future updates will involve multi-dataset integration and expert merging. - calculate_perplexity evaluation script).
- Evaluation results
python evaluate_perplexity_final.py --model_path ./google/gemma-4-26B-A4B-it
Model Path : ./google/gemma-4-26B-A4B-it
Eval Samples : 100
Max Length : 8192
| model | Fine-tuning steps | num_experts | Perplexity | Average Loss |
|---|---|---|---|---|
| gemma-4-26B-A4B-it | 0 | 128 | 1.5964 (+ 0 ) | 0.4678 (+ 0 ) |
| gemma-4-26B-A4B-it-Pruned-32 | 0 | 32 | 2.4826 (+ 0.8862) | 0.9093 (+ 0.4415) |
| gemma-4-26B-A4B-it-Pruned-32-sft-750 | 750 | 32 | 1.3827 (- 0.2137) | 0.3240 (- 0.1438) |
| gemma-4-26B-A4B-it-Pruned-32-sft-1350 | 1350 | 32 | 1.2374 (- 0.359 ) | 0.2130 (- 0.2548) |
| gemma-4-26B-A4B-it-Pruned-32-sft-1800 | 1800 | 32 | 1.1724 (- 0.424 ) | 0.1590 (- 0.3088) |
| gemma-4-26B-A4B-it-Pruned-32-sft-2950 | 2950 | 32 | 1.0924 (- 0.504 ) | 0.0883 (- 0.3795) |
| gemma-4-26B-A4B-it-Pruned-32-sft-3550 | 2950 | 32 | 1.0645 (- 0.5319) | 0.0625 (- 0.4053) |
| gemma-4-26B-A4B-it-Pruned-32-sft-4150 | 4150 | 32 | 1.0532 (- 0.5432) | 0.0518 (- 0.416 ) |
| gemma-4-26B-A4B-it-Pruned-32-sft-4700 | 4700 | 32 | 1.0411 (- 0.5553) | 0.0403 (- 0.4275) |
| gemma-4-26B-A4B-it-Pruned-32-sft-7800 | 7800 | 32 | 1.0088 (- 0.5876) | 0.0088 (- 0.459 ) |
| gemma-4-26B-A4B-it-Pruned-32-sft-10900 | 10900 | 32 | 1.0035 (- 0.5929) | 0.0035 (- 0.4643) |
Citation
@misc{huihui4-8b-a4b,
title = {{Huihui4-8B-A4B}: A lightweight MoE (Mixture of Experts) conversational model},
author = {Huihui-ai},
year = {2026},
url = {https://hf.co/huihui-ai/Huihui4-8B-A4B}
}
Contact
If you have any questions, please raise an issue or contact us at support@huihui.ai.
- Downloads last month
- 11