Instructions to use mlx-community/Hunyuan-A52B-Instruct-3bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlx-community/Hunyuan-A52B-Instruct-3bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlx-community/Hunyuan-A52B-Instruct-3bit", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("mlx-community/Hunyuan-A52B-Instruct-3bit", trust_remote_code=True, device_map="auto") - MLX
How to use mlx-community/Hunyuan-A52B-Instruct-3bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/Hunyuan-A52B-Instruct-3bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use mlx-community/Hunyuan-A52B-Instruct-3bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlx-community/Hunyuan-A52B-Instruct-3bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/Hunyuan-A52B-Instruct-3bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mlx-community/Hunyuan-A52B-Instruct-3bit
- SGLang
How to use mlx-community/Hunyuan-A52B-Instruct-3bit 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 "mlx-community/Hunyuan-A52B-Instruct-3bit" \ --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": "mlx-community/Hunyuan-A52B-Instruct-3bit", "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 "mlx-community/Hunyuan-A52B-Instruct-3bit" \ --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": "mlx-community/Hunyuan-A52B-Instruct-3bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - MLX LM
How to use mlx-community/Hunyuan-A52B-Instruct-3bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/Hunyuan-A52B-Instruct-3bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/Hunyuan-A52B-Instruct-3bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/Hunyuan-A52B-Instruct-3bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use mlx-community/Hunyuan-A52B-Instruct-3bit with Docker Model Runner:
docker model run hf.co/mlx-community/Hunyuan-A52B-Instruct-3bit
- Atomic Chat
Commit History
-
Upload folder using huggingface_hub (#1)
Verified signature- 747695d500dc0fe9c3bc00a49ffdcb4592cc5aedf4837a94019b617a502e2eff (c6cd8f25d05888e6f68bcb68f9e309b4db3c7c24) - 18fc596eff72c8b0d9fd5cacd26b09c19a39e5a554b46bd1b2038a56a361bef3 (d7cd674abde6e915a4a8df4059b9d1e49a08372d) - 41041b8fc7446542a3ed2374ff9179d7515f59ad941931c7034a2e3a3ede48e5 (a1e972df9b97b38bf742e1a88a069c8f9a427d1e) - ad71a6a962d7d9d56ac7f5facfb05f7c57ede500d80a1e9d03e5a5da6d7bc18b (36d5aa29ceea02733f59e8734593d8ca21d32301) - 1ba4bc90e89cd51de9cb802fb6686b232515b930980cb1ef9e0c78f7278c9f8f (0e6af27a2f61a902725993f87c0272376cbd3c63) - 0d69396f1ec194302454f7ec9ae32840431125464129e5937e61707ae8efafcd (43b703a1fbc21f611bd5b2fd8e75d6b2271871b7) - 59801c645514b13a6c02672c721e5d64a6c4b5656e02bebaba6b073cad1ee1c7 (fc53f8c9e79d21bfa1e65597b06dc2ba23fea524) - 7b4fbe298ca7aff0a7d51b26dd5b510d1d9aa4b900f0498ac3cdf3d3f589758c (a18673bbd4481e851acc6563a9886b3b324e087a) - 934ad81ebc6bd7ec569da1940db153941ecf449ec03aaca29cc822e2950d2024 (65ffb39088ab082312df9ea1493da8e282785db2) - cb1bb2c2…b47ef0b -
initial commit
Verified signaturea72fc0b