Downloads · 30 days
42
7% of all-time downloads
AlexanderKyng/Agents-A1-Q8-Plus
Agents-A1-Q8-Plus is a image-text-to-text model from AlexanderKyng. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
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 ac…
Downloads · 30 days
42
7% of all-time downloads
All-time downloads
599
Public
Repo size
39.4 GB
Likes
1
Public
Click a slice to open those files.
.gguf39.4 GB · 100%
From the Hugging Face model README
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.
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).
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.
The model was calibrated using a custom, shuffled iMatrix to ensure high fidelity across coding, instruction-following, and bilingual tasks (English/French).
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.
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:
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.
--ctx-size or using 8-bit cache (--cache-type-k q8_0 --cache-type-v q8_0, not recommended unless strictly necessary).This project was made possible thanks to the outstanding tools and contributions from the open-source AI community. Special thanks to: