Image-Text-to-Text
Transformers
Safetensors
English
Chinese
agnes
text-generation
agnes-ai
reasoning
multimodal
long-context
hybrid-attention
conversational
custom_code
Instructions to use Agnes-AI/Agnes-3.0-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Agnes-AI/Agnes-3.0-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Agnes-AI/Agnes-3.0-Flash", trust_remote_code=True) 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 AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Agnes-AI/Agnes-3.0-Flash", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Agnes-AI/Agnes-3.0-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Agnes-AI/Agnes-3.0-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Agnes-AI/Agnes-3.0-Flash", "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/Agnes-AI/Agnes-3.0-Flash
- SGLang
How to use Agnes-AI/Agnes-3.0-Flash 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 "Agnes-AI/Agnes-3.0-Flash" \ --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": "Agnes-AI/Agnes-3.0-Flash", "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 "Agnes-AI/Agnes-3.0-Flash" \ --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": "Agnes-AI/Agnes-3.0-Flash", "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" } } ] } ] }' - Docker Model Runner
How to use Agnes-AI/Agnes-3.0-Flash with Docker Model Runner:
docker model run hf.co/Agnes-AI/Agnes-3.0-Flash
| # Serve Agnes 3.0 Flash with a stock sglang image. | |
| # | |
| # Tested image: lmsysorg/sglang:nightly-dev-20260908-20ca564b | |
| # | |
| # docker run --gpus all --shm-size 64g -p 30001:30002 \ | |
| # -v /path/to/agnes-3.0-flash:/model \ | |
| # lmsysorg/sglang:nightly-dev-20260908-20ca564b \ | |
| # bash /model/serve.sh [extra sglang arguments, e.g. --tp 2] | |
| # | |
| # The script overlays three files from sglang_patch/ onto the image's sglang | |
| # package (a prebuilt variant when one matches the installed version, else | |
| # apply_patch.py patches the installed files in place) and starts the server | |
| # on port 30002 inside the container. | |
| set -euo pipefail | |
| D="$(cd "$(dirname "$0")" && pwd)" | |
| PKG="$(python3 -c 'import sglang, os; print(os.path.dirname(sglang.__file__))')" | |
| VER="$(python3 -c 'import sglang; print(getattr(sglang, "__version__", ""))' 2>/dev/null || true)" | |
| case "$VER" in | |
| *20ca564b*) VARIANT="nightly-dev-20260908-20ca564b" ;; | |
| 0.5.19*) VARIANT="v0.5.19" ;; | |
| *) VARIANT="" ;; | |
| esac | |
| if [ -n "$VARIANT" ] && [ -d "$D/sglang_patch/$VARIANT/sglang" ]; then | |
| echo "[serve.sh] sglang $VER -> prebuilt patch $VARIANT" | |
| cp -r "$D/sglang_patch/$VARIANT/sglang/." "$PKG/" | |
| else | |
| echo "[serve.sh] sglang $VER -> patching installed package in place" | |
| python3 "$D/sglang_patch/apply_patch.py" "$PKG" | |
| fi | |
| export AGNES_MODEL_PATH="$D" | |
| exec python3 -m sglang.launch_server --model-path "$D" --trust-remote-code --host 0.0.0.0 --port 8080 "$@" | |