Instructions to use rhymes-ai/Aria with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rhymes-ai/Aria with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="rhymes-ai/Aria")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rhymes-ai/Aria", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use rhymes-ai/Aria with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rhymes-ai/Aria" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rhymes-ai/Aria", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rhymes-ai/Aria
- SGLang
How to use rhymes-ai/Aria 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 "rhymes-ai/Aria" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rhymes-ai/Aria", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "rhymes-ai/Aria" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rhymes-ai/Aria", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rhymes-ai/Aria with Docker Model Runner:
docker model run hf.co/rhymes-ai/Aria
Unable to start
It seems after this commit the model can no longer start properly (e.g. with vllm). It seems having the auto_map still declared in the config.json causes it to try to load those (via trust_remote_code) from the repo, but these files no longer exist. I see they exist in the base transformers library now, but evidently it still does not work even after I remove the auto_map from the config manually and try to start without trust_remote_code:
(VllmWorkerProcess pid=3950820) ERROR 01-20 17:58:04 multiproc_worker_utils.py:236] File "/home/jdurbin/.local/lib/python3.10/site-packages/transformers/configuration_utils.py", line 211, in __getattribute__
(VllmWorkerProcess pid=3950820) ERROR 01-20 17:58:04 multiproc_worker_utils.py:236] return super().__getattribute__(key)
(VllmWorkerProcess pid=3950820) ERROR 01-20 17:58:04 multiproc_worker_utils.py:236] AttributeError: 'AriaTextConfig' object has no attribute 'moe_intermediate_size'
I can just add the revision flag to the model when starting it to use a commit prior to this one, but just thought you should know.
@jondurbin Thanks for pointing that out!
I noticed that vLLM has mad some related changes recently (https://github.com/vllm-project/vllm/pull/12203)