Instructions to use Amazon-FMR/Ergo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Amazon-FMR/Ergo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Amazon-FMR/Ergo") 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("Amazon-FMR/Ergo") model = AutoModelForCausalLM.from_pretrained("Amazon-FMR/Ergo", 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]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Amazon-FMR/Ergo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Amazon-FMR/Ergo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Amazon-FMR/Ergo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Amazon-FMR/Ergo
- SGLang
How to use Amazon-FMR/Ergo 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 "Amazon-FMR/Ergo" \ --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": "Amazon-FMR/Ergo", "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 "Amazon-FMR/Ergo" \ --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": "Amazon-FMR/Ergo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Amazon-FMR/Ergo with Docker Model Runner:
docker model run hf.co/Amazon-FMR/Ergo
Transformers can't load the MXFP4/MXFP8 checkpoints yet. Point Transformers users to Ergo-bf16?
The repo is tagged library_name: transformers. The Hub's "Use this model → Transformers" snippet is AutoModelForCausalLM.from_pretrained("Amazon-FMR/Ergo"), and the Transformers Ergo docs use the same example. On current Transformers main, that snippet doesn't load this repo, and it doesn't load Ergo-mxfp8 either. Only Ergo-bf16 works.
You can check this from the safetensors headers alone:
| repo | layers.1.feed_forward.up_proj |
up_proj_scale |
|---|---|---|
| Ergo-bf16 | BF16 [256, 8192, 4096] (the layout ErgoExperts expects) |
n/a |
| Ergo-mxfp8 | F8_E4M3 [256, 4096, 8192] |
U8 [256, 4096, 256] |
| Ergo (MXFP4) | U8 [256, 4096, 4096] |
U8 [256, 4096, 256] |
- MXFP4: Transformers'
mxfp4quantizer only handles GPT-OSS (*_blocks/*_scales). The packed experts are loaded raw and fail with a size mismatch. - MXFP8: On GPU, the FP8 quantizer's expert swap crashes with
AttributeError: ErgoConfig has none of: ('hidden_activation', 'hidden_act'). On CPU, it raises a size mismatch, and the quantizer's.scalerename also drops the residual-gate and expert-norm tensors.
Details and an offline reproducer: https://github.com/huggingface/transformers/issues/51633.
Until Transformers supports these layouts, it may help to add a short note to the README "Your own hardware" section: "For Hugging Face Transformers, use Amazon-FMR/Ergo-bf16; the MXFP4/MXFP8 checkpoints are for SGLang/vLLM." Could you also confirm the MXFP4 packing (which nibble comes first) and the scale semantics (E8M0, 32-element blocks along the input dimension)? A Transformers fix needs both.
thanks for the feedback! yes for now quantized fine tuning isn't supported. I've updated the model card to make that clear