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
Download config.json from Agnes-AI/Agnes-3.0-Flash: direct link, hf CLI and curl.
- Browser
- Download file 4.51 kB
-
https://huggingface.co/Agnes-AI/Agnes-3.0-Flash/resolve/24f712ce59379b54c4a141d2708c35daf5ff613b/config.json
- Command line
-
hf download hf://Agnes-AI/Agnes-3.0-Flash@24f712ce59379b54c4a141d2708c35daf5ff613b/config.json
-
curl -L -o config.json https://huggingface.co/Agnes-AI/Agnes-3.0-Flash/resolve/24f712ce59379b54c4a141d2708c35daf5ff613b/config.json
4.51 kB
| { | |
| "model_type": "agnes", | |
| "architectures": [ | |
| "AgnesForConditionalGeneration" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_agnes.AgnesConfig", | |
| "AutoModel": "modeling_agnes.AgnesModel", | |
| "AutoModelForCausalLM": "modeling_agnes.AgnesForConditionalGeneration", | |
| "AutoModelForImageTextToText": "modeling_agnes.AgnesForConditionalGeneration" | |
| }, | |
| "text_config": { | |
| "model_type": "agnes_text", | |
| "hidden_size": 5120, | |
| "num_hidden_layers": 72, | |
| "intermediate_size": 17408, | |
| "parallel_ffn_intermediate_size": 2048, | |
| "vocab_size": 248320, | |
| "layer_types": [ | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_delta_attention", | |
| "agnes_global_attention" | |
| ], | |
| "global_attention_interval": 4, | |
| "num_attention_heads": 24, | |
| "num_key_value_heads": 4, | |
| "head_dim": 256, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "attn_output_gate": true, | |
| "partial_rotary_factor": 0.25, | |
| "linear_num_key_heads": 16, | |
| "linear_num_value_heads": 48, | |
| "linear_key_head_dim": 128, | |
| "linear_value_head_dim": 128, | |
| "linear_conv_kernel_dim": 4, | |
| "output_gate_type": "swish", | |
| "mamba_ssm_dtype": "float32", | |
| "hidden_act": "silu", | |
| "rms_norm_eps": 1e-06, | |
| "initializer_range": 0.02, | |
| "rope_parameters": { | |
| "mrope_interleaved": true, | |
| "mrope_section": [ | |
| 11, | |
| 11, | |
| 10 | |
| ], | |
| "partial_rotary_factor": 0.25, | |
| "rope_theta": 10000000, | |
| "rope_type": "default" | |
| }, | |
| "max_position_embeddings": 262144, | |
| "mtp_num_hidden_layers": 1, | |
| "mtp_use_dedicated_embeddings": false, | |
| "bos_token_id": 248044, | |
| "eos_token_id": 248044, | |
| "pad_token_id": null, | |
| "tie_word_embeddings": false, | |
| "use_cache": true, | |
| "dtype": "bfloat16" | |
| }, | |
| "vision_config": { | |
| "model_type": "agnes_vision", | |
| "depth": 27, | |
| "hidden_size": 1152, | |
| "intermediate_size": 4304, | |
| "num_heads": 16, | |
| "out_hidden_size": 5120, | |
| "patch_size": 16, | |
| "spatial_merge_size": 2, | |
| "temporal_patch_size": 2, | |
| "in_channels": 3, | |
| "num_position_embeddings": 2304, | |
| "deepstack_visual_indexes": [], | |
| "hidden_act": "gelu_pytorch_tanh", | |
| "initializer_range": 0.02 | |
| }, | |
| "image_token_id": 248056, | |
| "video_token_id": 248057, | |
| "vision_start_token_id": 248053, | |
| "vision_end_token_id": 248054, | |
| "tie_word_embeddings": false | |
| } |