Instructions to use InternScience/Agents-A1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use InternScience/Agents-A1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="InternScience/Agents-A1") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("InternScience/Agents-A1") model = AutoModelForMultimodalLM.from_pretrained("InternScience/Agents-A1", device_map="auto") 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?"} ] }, ] inputs = processor.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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use InternScience/Agents-A1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "InternScience/Agents-A1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InternScience/Agents-A1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/InternScience/Agents-A1
- SGLang
How to use InternScience/Agents-A1 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 "InternScience/Agents-A1" \ --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": "InternScience/Agents-A1", "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 "InternScience/Agents-A1" \ --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": "InternScience/Agents-A1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use InternScience/Agents-A1 with Docker Model Runner:
docker model run hf.co/InternScience/Agents-A1
NVFP4 quantization
Hello,
You did a amazing job. This model is very strong.
Could you guys release a NVFP4 quantized model with some evaluations between this one and FP16 model?
Thank so much.
In an effort to make this all accessible for consumer cards. I can't speak for much but I work heavily with VLLM, and have only a single 5090 at my disposal, so here are two non-GGUF serve commands.
This one has limitation of 21gb to weights. Adjust cache or sequences to lower, as the below commands fill up to around 30gb maximum fully loaded, fitting perfectly.
INT4 (non blackwell)
First run, use: vllm serve compute1/Agents-A1-GPTQ-INT4-Sym
CUDA_VISIBLE_DEVICES=0
vllm serve /path/to/.cache/huggingface/hub/models--compute1--Agents-A1-GPTQ-INT4-Sym/snapshots/somestring/
--served-model-name compute1/Agents-A1-GPTQ-INT4-Sym
--host 0.0.0.0
--port 8000
--tensor-parallel-size 1
--max-model-len 196608
--gpu-memory-utilization 0.87
--kv-cache-dtype fp8_e5m2
--max-num-seqs 2
--tool-call-parser qwen3_coder
--reasoning-parser qwen3
--enable-auto-tool-choice
--trust-remote-code
^^^ Great INT4 , performs as well as ~Q5/Q6 gguf, if not better.
NVFP4 (heavier, blackwell)
First run, use: vllm serve cyankiwi/Agents-A1-AWQ-NVFP4
CUDA_VISIBLE_DEVICES=0
VLLM_USE_FLASHINFER_SAMPLER=0
vllm serve /path/to/.cache/huggingface/hub/models--cyankiwi--Agents-A1-AWQ-NVFP4/snapshots/somestring/
--served-model-name cyankiwi/Agents-A1-AWQ-NVFP4
--host 0.0.0.0
--port 8000
--moe-backend marlin
--tensor-parallel-size 1
--max-model-len 172032
--gpu-memory-utilization 0.88
--kv-cache-dtype fp8
--max-num-seqs 2
--tool-call-parser qwen3_coder
--reasoning-parser qwen3
--enable-auto-tool-choice
--trust-remote-code
^^^ Great NVFP4, performs as well as ~Q6 gguf, if not better.
For sm120 - i.e. 5090, consumer blackwell
Non-negotiable moe-backend and flashinfer sampler env var - discovered from (this model - link to highlight) - where they broke the vision heads 🤷
YMMV with system ram for profiling/warmup - Specs: 5090 + 64GB — vLLM runtime on CUDA host