Downloads · 30 days
38
3% of all-time downloads
Tonic/c4ai-command-a-03-2025-4bit_fp4
c4ai-command-a-03-2025-4bit_fp4 is a text generation model from Tonic. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
This repository contains quantized versions of the C4AI Command A model, an open weights research release by Cohere and Cohere For AI. The original model is a 111 billion parameter language model optimized for enterpr…
Downloads · 30 days
38
3% of all-time downloads
All-time downloads
1.4K
Public
Parameters
113B
67 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors67 GB · 100%
How the weights are stored.
U8108B · 96%
From the Hugging Face model README
This repository contains quantized versions of the C4AI Command A model, an open weights research release by Cohere and Cohere For AI. The original model is a 111 billion parameter language model optimized for enterprise use cases, excelling in agentic, multilingual, and retrieval-augmented generation (RAG) tasks while being deployable on minimal hardware (e.g., two GPUs). Here, we provide multiple quantized variants to further reduce memory footprint and enhance deployment flexibility across various hardware setups, including multi-GPU environments.
For details on the original model, refer to the official model card below.
We have quantized the original CohereForAI/c4ai-command-a-03-2025 model using the bitsandbytes library with various configurations to balance performance, memory efficiency, and accuracy. Below are the available quantized versions:
| Quantization Type | Description | Compute Dtype | Double Quantization | Notes |
|---|---|---|---|---|
4bit_nf4_double | 4-bit quantization with nf4 (Normal Float 4) | bfloat16 | Yes | High precision with reduced memory usage |
4bit_fp4 | 4-bit quantization with fp4 (Float Point 4) | bfloat16 | No | Lightweight, slightly less precise |
8bit_standard | Standard 8-bit quantization | bfloat16 | N/A | Balanced memory and accuracy |
8bit_mixed | 8-bit quantization with mixed precision and CPU offloading capability | float16 | N/A | Flexible for constrained environments |
4bit_nf4_no_double | 4-bit quantization with nf4, no double quantization | bfloat16 | No | Minimal memory footprint |
These models are optimized for multi-GPU deployment using the accelerate library, ensuring efficient distribution across available GPUs. Each variant is hosted in its own sub-repository:
Tonic/c4ai-command-a-03-2025-4bit_nf4_doubleTonic/c4ai-command-a-03-2025-4bit_fp4Tonic/c4ai-command-a-03-2025-8bit_standardTonic/c4ai-command-a-03-2025-8bit_mixedTonic/c4ai-command-a-03-2025-4bit_nf4_no_doubleTo use a quantized model, install the required dependencies and load the desired variant as shown below. Multi-GPU support is enabled via accelerate.
pip install transformers bitsandbytes accelerate torch huggingface_hub
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from accelerate import Accelerator
# Initialize Accelerator for multi-GPU support
accelerator = Accelerator()
# Specify the quantized model ID
model_id = "Tonic/c4ai-command-a-03-2025-4bit_nf4_double" # Replace with desired variant
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16)
# Prepare model for multi-GPU
model = accelerator.prepare(model)
# Format message with chat template
messages = [{"role": "user", "content": "Hello, how are you?"}]
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(accelerator.device)
# Generate text
gen_tokens = model.generate(
input_ids,
max_new_tokens=100,
do_sample=True,
temperature=0.3,
)
gen_text = tokenizer.decode(gen_tokens[0])
print(gen_text)
device_map="auto" ensures the model is distributed across all available GPUs.torch_dtype (e.g., torch.bfloat16 or torch.float16) based on your hardware and the quantization type.The quantization process leverages bitsandbytes with the following configurations:
nf4 or fp4 quantization types, with optional double quantization for improved precision.accelerate library handles model sharding and distribution, allowing deployment on systems with multiple GPUs.For the exact quantization script, see this Gist (replace with a link to your script if hosted).
Below is the original model card for C4AI Command A, adapted for this repository.
C4AI Command A is an open weights research release of a 111 billion parameter model optimized for demanding enterprises that require fast, secure, and high-quality AI. Compared to other leading proprietary and open-weights models, Command A delivers maximum performance with minimum hardware costs, excelling on business-critical agentic and multilingual tasks while being deployable on just two GPUs.
c4ai-command-a-03-2025Try C4AI Command A
You can try the original model before downloading weights in the hosted Hugging Face Space.
Command A is configured as a conversational model by default with two safety modes: contextual (default, fewer constraints) and strict (avoids sensitive topics). See Command A prompt format docs for details.
Command A excels in Retrieval Augmented Generation (RAG) tasks. Use the apply_chat_template method with document snippets for RAG functionality. Example:
conversation = [{"role": "user", "content": "What has Man always dreamed of?"}]
documents = [
{"heading": "The Moon", "body": "Man has always dreamed of destroying the moon..."},
{"heading": "Love", "body": "Man's dream has always been to find love..."}
]
input_ids = tokenizer.apply_chat_template(conversation, documents=documents, tokenize=True, add_generation_prompt=True, return_tensors="pt")
Command A supports conversational tool use with JSON schema-based tool descriptions. See the tool use example in the original model card for implementation details.
The model performs well on enterprise-relevant code tasks (e.g., SQL generation, code translation). Use low temperature or greedy decoding for optimal code generation.
This model is released under a CC-BY-NC license for non-commercial use only, adhering to C4AI's Acceptable Use Policy. For commercial inquiries, contact Cohere’s Sales team.
For issues or questions, reach out to [email protected].