Instructions to use Myric/ERNIE-4.5-21B-A3B-APEX-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Myric/ERNIE-4.5-21B-A3B-APEX-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Myric/ERNIE-4.5-21B-A3B-APEX-GGUF # Run inference directly in the terminal: llama cli -hf Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Myric/ERNIE-4.5-21B-A3B-APEX-GGUF # Run inference directly in the terminal: llama cli -hf Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Myric/ERNIE-4.5-21B-A3B-APEX-GGUF # Run inference directly in the terminal: ./llama-cli -hf Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Myric/ERNIE-4.5-21B-A3B-APEX-GGUF # Run inference directly in the terminal: ./build/bin/llama-cli -hf Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
Use Docker
docker model run hf.co/Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
- LM Studio
- Jan
- vLLM
How to use Myric/ERNIE-4.5-21B-A3B-APEX-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Myric/ERNIE-4.5-21B-A3B-APEX-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Myric/ERNIE-4.5-21B-A3B-APEX-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
- Ollama
How to use Myric/ERNIE-4.5-21B-A3B-APEX-GGUF with Ollama:
ollama run hf.co/Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
- Unsloth Desktop
- Docker Model Runner
How to use Myric/ERNIE-4.5-21B-A3B-APEX-GGUF with Docker Model Runner:
docker model run hf.co/Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
- Lemonade
How to use Myric/ERNIE-4.5-21B-A3B-APEX-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
Run and chat with the model
lemonade run user.ERNIE-4.5-21B-A3B-APEX-GGUF-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Use Docker
docker model run hf.co/Myric/ERNIE-4.5-21B-A3B-APEX-GGUFERNIE-4.5-21B-A3B β APEX GGUF
MoE-aware, mixed-precision APEX quantizations of
baidu/ERNIE-4.5-21B-A3B-PT
β Baidu's ernie4_5-moe: 28 layers (dense layer 0 + 27 MoE), 64 routed + 2
shared experts, top-6 routing, ~21B total / ~3B active, Apache-2.0.
Results & which file to pick
Perplexity on wikitext-2-raw (test, 200Γ512-token windows), llama-perplexity.
Both quants are imatrix-guided (Bartowski calibration_datav3).
| File | Size | BPW | PPL | Ξ vs bf16 | Fits (VRAM) |
|---|---|---|---|---|---|
| bf16 (reference) | 41 GB | 16.0 | 7.362 | β | β |
| APEX-i-quality | 15 GB | 5.63 | 7.352 | β0.14% (at parity) | 16 GB β best quality |
| APEX-i-compact | 11 GB | 4.11 | 7.640 | +3.77% | 12 GB β smallest usable |
- i-quality β recommended; effectively lossless β its PPL lands a hair below the bf16 reference (within noise). Q6_K/Q5_K experts on a depth gradient, Q8_0 shared, Q6_K attention. Runs on a 16 GB card.
- i-compact β Q4_K_M-class mid experts; a real but usable step (+3.8%) that fits a 12 GB card.
ERNIE's routed-expert intermediate dim is 1536 (256-divisible), so i-quants apply cleanly to every expert tensor β no IQ4_NL fallback needed.
Usage (llama.cpp)
llama-cli -m ERNIE-4.5-21B-A3B-APEX-i-quality.gguf -ngl 999 -p "Hello"
llama-server -m ERNIE-4.5-21B-A3B-APEX-i-compact.gguf -ngl 999 --host 0.0.0.0 --port 8080
Requires a llama.cpp build supporting the ernie4_5-moe architecture.
Method
APEX = per-tensor-role, per-layer precision over stock
llama-quantize --tensor-type-file. ERNIE-4.5-21B is a standard MoE β
conventional ffn_*_exps / ffn_*_shexp tensor names, a single dense layer 0
(--dense-layers 1) β so it used the stock APEX config generator, no patching
(unlike the Kimi/Granite/Moonlight hybrids in this collection). Routed experts on
a layer-depth gradient; shared experts protected at Q8_0/Q6_K; router left high.
Baseline: bartowski's bf16 GGUF.
imatrix from Bartowski calibration_datav3. See REPRODUCE.md and configs/.
Attribution & licenses
See LICENSE (Apache-2.0) and NOTICE.
- Base: Baidu (@baidu) β ERNIE-4.5-21B-A3B-PT (Apache-2.0)
- bf16 GGUF: bartowski (@bartowski) β source
- Engine: llama.cpp (@ggml-org) (MIT)
- APEX: Ettore Di Giacinto / LocalAI (@mudler) β localai-org/apex-quant (MIT)
- Calibration: Bartowski (@bartowski) β calibration_datav3
Unofficial community quantization; not affiliated with or endorsed by Baidu.
- Downloads last month
- 2,026
We're not able to determine the quantization variants.
Model tree for Myric/ERNIE-4.5-21B-A3B-APEX-GGUF
Base model
baidu/ERNIE-4.5-21B-A3B-PT
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "Myric/ERNIE-4.5-21B-A3B-APEX-GGUF"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Myric/ERNIE-4.5-21B-A3B-APEX-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'