Instructions to use AlexanderKyng/Agents-A1-Q8-Plus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlexanderKyng/Agents-A1-Q8-Plus with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AlexanderKyng/Agents-A1-Q8-Plus") 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 AutoModel model = AutoModel.from_pretrained("AlexanderKyng/Agents-A1-Q8-Plus", dtype="auto") - llama-cpp-python
How to use AlexanderKyng/Agents-A1-Q8-Plus with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="AlexanderKyng/Agents-A1-Q8-Plus", filename="Agents-A1-Q8-Plus.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AlexanderKyng/Agents-A1-Q8-Plus with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf AlexanderKyng/Agents-A1-Q8-Plus # Run inference directly in the terminal: llama cli -hf AlexanderKyng/Agents-A1-Q8-Plus
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AlexanderKyng/Agents-A1-Q8-Plus # Run inference directly in the terminal: llama cli -hf AlexanderKyng/Agents-A1-Q8-Plus
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf AlexanderKyng/Agents-A1-Q8-Plus # Run inference directly in the terminal: ./llama-cli -hf AlexanderKyng/Agents-A1-Q8-Plus
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf AlexanderKyng/Agents-A1-Q8-Plus # Run inference directly in the terminal: ./build/bin/llama-cli -hf AlexanderKyng/Agents-A1-Q8-Plus
Use Docker
docker model run hf.co/AlexanderKyng/Agents-A1-Q8-Plus
- LM Studio
- Jan
- vLLM
How to use AlexanderKyng/Agents-A1-Q8-Plus with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AlexanderKyng/Agents-A1-Q8-Plus" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AlexanderKyng/Agents-A1-Q8-Plus", "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/AlexanderKyng/Agents-A1-Q8-Plus
- SGLang
How to use AlexanderKyng/Agents-A1-Q8-Plus 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 "AlexanderKyng/Agents-A1-Q8-Plus" \ --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": "AlexanderKyng/Agents-A1-Q8-Plus", "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 "AlexanderKyng/Agents-A1-Q8-Plus" \ --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": "AlexanderKyng/Agents-A1-Q8-Plus", "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" } } ] } ] }' - Ollama
How to use AlexanderKyng/Agents-A1-Q8-Plus with Ollama:
ollama run hf.co/AlexanderKyng/Agents-A1-Q8-Plus
- Unsloth Studio
How to use AlexanderKyng/Agents-A1-Q8-Plus with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AlexanderKyng/Agents-A1-Q8-Plus to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AlexanderKyng/Agents-A1-Q8-Plus to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AlexanderKyng/Agents-A1-Q8-Plus to start chatting
- Pi
How to use AlexanderKyng/Agents-A1-Q8-Plus with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AlexanderKyng/Agents-A1-Q8-Plus
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "AlexanderKyng/Agents-A1-Q8-Plus" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use AlexanderKyng/Agents-A1-Q8-Plus with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AlexanderKyng/Agents-A1-Q8-Plus
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default AlexanderKyng/Agents-A1-Q8-Plus
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use AlexanderKyng/Agents-A1-Q8-Plus with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AlexanderKyng/Agents-A1-Q8-Plus
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "AlexanderKyng/Agents-A1-Q8-Plus" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use AlexanderKyng/Agents-A1-Q8-Plus with Docker Model Runner:
docker model run hf.co/AlexanderKyng/Agents-A1-Q8-Plus
- Lemonade
How to use AlexanderKyng/Agents-A1-Q8-Plus with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AlexanderKyng/Agents-A1-Q8-Plus
Run and chat with the model
lemonade run user.Agents-A1-Q8-Plus-{{QUANT_TAG}}List all available models
lemonade list
Agents-A1-Q8-Plus
Overview
This repository provides a highly optimized, custom-quantized GGUF model of Agents-A1, specifically engineered for local deployment on Dual RTX 3090 setups.
The primary research objective of this quantization is to achieve an extreme context length (full 262K tokens in F16 KV Cache) while maximizing inference speed through adapted BPW and retaining most of the original model's capacities. To achieve this, the base network was quantized to Q8_0 using a custom iMatrix, while the critical layers, including outputs and embeddings were strictly preserved in f16.
The base model used for this requantization is InternScience/Agents-A1.
Research & Methodology
Selective precision Quantization for high-speed inference
Most standard quantization pipelines compress the entire model, which severely degrades the quality and the inference speeds. On RTX 3090s and llama.cpp f16 enables the highest speeds and several community researches found out that f16 is largely sufficient compared with bf16.
To maintain capacities while optimizing for a Dual RTX 3090 (NVLink) setup, I have implemented a Selective Precision Mapping strategy. By carefully partitioning the model into f16 (Highest Precision) and Q8_0 tensors, it preserves the critical activation flows, without sacrificing the throughput necessary for processing massive contexts (full 262K tokens).
Strategic Layer Mapping
The following quantization scheme was applied :
--tensor-type 'blk\.[0-9]+\.ffn_gate_inp\.weight=f16'
--tensor-type 'blk\.[0-9]+\.ffn_gate_inp_shexp\.weight=f16'
--tensor-type 'blk\.[0-9]+\.ssm_alpha\.weight=f16'
--tensor-type 'blk\.[0-9]+\.ssm_beta\.weight=f16'
--tensor-type 'blk\.[0-9]+\.attn_gate\.weight=f16'
--tensor-type 'blk\.[0-9]+\.attn_qkv\.weight=f16'
--tensor-type 'blk\.[0-9]+\.ffn_gate_shexp\.weight=f16'
--tensor-type 'blk\.[0-9]+\.ffn_up_shexp\.weight=f16'
--tensor-type 'blk\.[0-9]+\.ffn_down_shexp\.weight=f16'
--tensor-type 'token_embd\.weight=f16'
--tensor-type 'output\.weight=f16'
--tensor-type 'blk\.[0-9]+\.ssm_out\.weight=f16'
--tensor-type 'blk\.[0-9]+\.attn_q\.weight=f16'
--tensor-type 'blk\.[0-9]+\.attn_k\.weight=f16'
--tensor-type 'blk\.[0-9]+\.attn_v\.weight=f16'
Q8_0
This scheme keeps the most important layers at high precision (f16) and lowers the GGUF size on disk, enabling full offload on dual RTX 3090 setups.
iMatrix Calibration
The model was calibrated using a custom, shuffled iMatrix to ensure high fidelity across coding, instruction-following, and bilingual tasks (English/French).
Chat Template
Agents-A1 appears to be fine-tuned from Qwen3.5-35B-A3B and therefore supports the same chat templates. Considering all the experience I have with both Qwen3.5 and 3.6 models, I chose to add, from the very beginning, the froggeric Chat_template made for 3.6. As far as I tested, it is fully compatible and therefore is benefiting from all the improvements made by the original creator.
Accuracy Analysis
I compared the perplexity and KL-Divergence on a custom calibration set, based on code extracted from llama.cpp, here after refered as 'Code', and Wiki-Text-Raw to evaluate the precision loss after the mixed-quantization scheme:
| Métrique | Code - Base F16 | Code - Agents-A1-Q8-Plus | Wiki-Text-Raw Base F16 | Wiki-Text-Raw Agents-A1-Q8-Plus |
|---|---|---|---|---|
| Mean PPL | 1.990062 ± 0.006568 | 1.991289 ± 0.006585 | 6.546251 ± 0.042329 | 6.547322 ± 0.042369 |
| PPL(Q)/PPL(base) | — | 1.000616 ± 0.000150 | — | 1.000164 ± 0.000255 |
| Cor(ln PPL) | — | 99.90% | — | 99.92% |
| Mean KLD | — | 0.001844 ± 0.000029 | — | 0.003265 ± 0.000024 |
| 99.9% KLD | — | 0.073602 | — | 0.104013 |
| 99.0% KLD | — | 0.023360 | — | 0.030409 |
| 95.0% KLD | — | 0.008369 | — | 0.011282 |
| Median KLD | — | 0.000083 | — | 0.001440 |
| Max KLD | — | 5.675012 | — | 0.869830 |
| RMS Δp | — | 1.526 ± 0.019 % | — | 1.680 ± 0.016 % |
| Same top p | — | 98.836 ± 0.020 % | — | 97.200 ± 0.043 % |
Key Findings:
- Near-Lossless: The perplexity degradation is minimal at +0.001071 on wiki-text-raw and +0.001227, indicating that this mixed precision layout preserves the original model's reasoning capabilities.
Recommended Usage
To replicate the optimal performance (262K context, F16 Cache, Multi-GPU) using llama.cpp, use the following llama-server command. Note the specific use of --split-mode tensor and --tensor-split 1,1 for optimal PCIe bandwidth management across dual RTX 3090s. This command appeared to be the best one I could come across using an NVLink.
/path/to/llama.cpp/build/bin/llama-server \
-m /path/to/Agents-A1-Q8-Plus \
--split-mode tensor \
--tensor-split 1,1 \
--host 0.0.0.0 \
--port 8080 \
--ctx-size 262144 \
--parallel 1 \
--gpu-layers 999 \
--cache-type-k f16 \
--cache-type-v f16 \
--flash-attn on \
-b 2048 -ub 2048 \
--alias Agents-A1 \
--jinja
If I may add, I also developed a proxy to enable users to select thinking or non-thinking behaviors and applied the recommended sampling parameters AND the "Preserve Thinking" option. You may find it on my GitHub.
Hardware Requirements
- Target VRAM: 48 GB (Tested on 2x NVIDIA RTX 3090 24GB).
- RAM: Minimum 32GB system RAM (Prompt caching and system overhead).
- Context limit: The command above loads ~9GB of KV cache across the two GPUs. If you experience OOM (Out of Memory) errors, consider reducing
--ctx-sizeor using 8-bit cache (--cache-type-k q8_0 --cache-type-v q8_0, not recommended unless strictly necessary).
Acknowledgments
This project was made possible thanks to the outstanding tools and contributions from the open-source AI community. Special thanks to:
- Lei Bai et al. (InternScience): For their groundbreaking research "Scaling the Horizon, Not the Parameters" and for releasing the Agents-A1 base model.
- llama.cpp: Using the new Tensor split mode, it finally achieves extremelly high performances on dual-GPU setups.
- froggeric: For the immense work done on fixing Qwen3.5 and 3.6 chat_template.
- The Qwen Team: For researching and releasing the exceptional Qwen3.5 architecture.
- Downloads last month
- 376
We're not able to determine the quantization variants.
Model tree for AlexanderKyng/Agents-A1-Q8-Plus
Base model
InternScience/Agents-A1