alexrs commited on
Commit
ffeb401
·
verified ·
1 Parent(s): 9af5711

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +235 -2
README.md CHANGED
@@ -51,10 +51,243 @@ language:
51
  - vi # Vietnamese
52
  - zh # Chinese
53
  license: apache-2.0
54
- base_model: CohereLabs/command-a-plus-05-2026
55
- base_model_relation: quantized
56
  pipeline_tag: text-generation
57
  tags:
58
  - conversational
59
  - chat
60
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  - vi # Vietnamese
52
  - zh # Chinese
53
  license: apache-2.0
 
 
54
  pipeline_tag: text-generation
55
  tags:
56
  - conversational
57
  - chat
58
  ---
59
+
60
+ # **Model Card for Command A+**
61
+
62
+ ## **Model Summary**
63
+
64
+ Command A+ is an open source model with 25 billion active parameters and 218B total parameters model optimized for agentic, multilingual, and reasoning-heavy tasks with a focus on enterprise performance, while also providing support for vision inputs for processing image inputs.
65
+
66
+ Developed by: [Cohere](https://cohere.com/) and [Cohere Labs](https://cohere.com/research)
67
+
68
+ * Point of Contact: [**Cohere Labs**](https://cohere.com/research)
69
+ * License: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
70
+ * Model: command-a-plus-05-2026
71
+ * Model Size: 25B active parameters, 218B total parameters
72
+ * Context length: 128K input
73
+
74
+ For more details about this model, please check out our [blog post](http://cohere.com/blog/command-a-plus).
75
+
76
+ You can try out Command A+ before downloading the weights in our hosted [Hugging Face Space](https://huggingface.co/spaces/CohereLabs/command-a-plus-05-2026).
77
+
78
+
79
+ **Available quantizations**
80
+
81
+ The following quantizations are available with example minimum GPU requirements
82
+
83
+ | Quantization | Blackwell | Hopper |
84
+ | :---- | :---- | :---- |
85
+ | [BF16 (16-bit)](https://huggingface.co/CohereLabs/command-a-plus-05-2026-bf16) | 4 x B200 | 8 x H100 |
86
+ | [FP8 (8-bit)](https://huggingface.co/CohereLabs/command-a-plus-05-2026-fp8) | 2 x B200 | 4 x H100 |
87
+ | [W4A4 (4-bit)](https://huggingface.co/CohereLabs/command-a-plus-05-2026-w4a4) | 1 x B200 | 2 x H100 |
88
+
89
+ All three quantizations show negligible differences in benchmark quality and performance. **Our recommended quantization for most uses is [W4A4](https://huggingface.co/CohereLabs/command-a-plus-05-2026-w4a4) which boasts superior speed and latency characteristics alongside a smaller hardware footprint.**
90
+
91
+ For more details, please check out our [blog post](http://cohere.com/blog/command-a-plus).
92
+
93
+
94
+ **Usage**
95
+
96
+ **Transformers**
97
+
98
+ Please install transformers from the source repository that includes the necessary changes for this model.
99
+
100
+ ```py
101
+ # pip install transformers
102
+ from transformers import AutoTokenizer, AutoModelForImageTextToText
103
+
104
+ model_id = "CohereLabs/command-a-plus-05-2026-fp8"
105
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
106
+ model = AutoModelForImageTextToText.from_pretrained(model_id)
107
+
108
+ # Format message with the command-a-plus-05-2026-fp8 chat template
109
+ messages = [{"role": "user", "content": "What has keys but can't open locks?"}]
110
+ input_ids = tokenizer.apply_chat_template(
111
+ messages,
112
+ tokenize=True,
113
+ add_generation_prompt=True,
114
+ return_tensors="pt",
115
+ )
116
+
117
+ gen_tokens = model.generate(
118
+ input_ids,
119
+ max_new_tokens=4096,
120
+ do_sample=True,
121
+ temperature=0.6,
122
+ top_p=0.95
123
+ )
124
+
125
+ gen_text = tokenizer.decode(gen_tokens[0])
126
+ print(gen_text)
127
+ ```
128
+
129
+ As a result, you should get an output that looks like this, where the thinking is generated between the `<START_THINKING>` and `<END_THINKING>`:
130
+
131
+ ```py
132
+ <|START_THINKING|>The user asks a riddle: "What has keys but can't open locks?" The answer is a piano (or keyboard). So respond with answer.<|END_THINKING|>
133
+ ```
134
+
135
+ You can also use the model directly using transformers pipeline abstraction:
136
+
137
+ ```py
138
+ from transformers import pipeline
139
+ import torch
140
+
141
+ model_id = "CohereLabs/command-a-plus-05-2026-fp8"
142
+
143
+ pipe = pipeline(
144
+ "text-generation",
145
+ model=model_id,
146
+ dtype="auto",
147
+ device_map="auto",
148
+ )
149
+
150
+ messages = [
151
+ {"role": "user", "content": "Explain the Transformer architecture"},
152
+ ]
153
+
154
+ tokenizer = pipe.tokenizer
155
+
156
+ text = tokenizer.apply_chat_template(
157
+ messages,
158
+ tokenize=False,
159
+ add_generation_prompt=True,
160
+ )
161
+
162
+
163
+ outputs = pipe(
164
+ messages,
165
+ max_new_tokens=300,
166
+ )
167
+ print(outputs[0]["generated_text"][-1])
168
+
169
+
170
+ ```
171
+
172
+ **vLLM**
173
+
174
+ You can also run the model in vLLM. `vllm>=0.21.0` is required for Command A+ and accurate response parsing also requires installing [Cohere’s `melody` library](https://pypi.org/project/cohere-melody/).
175
+
176
+ ```
177
+ uv pip install vllm>=0.21.0
178
+ uv pip install transformers uv pip install cohere_melody>=0.9.0
179
+ ```
180
+
181
+ Then the vllm server can be started with the following command:
182
+
183
+ ```
184
+ # This is for B200, adjust tp for your device vllm serve CohereLabs/command-a-plus-05-2026-fp8 -tp 4 --tool-call-parser cohere_command4 --reasoning-parser cohere_command4 --enable-auto-tool-choice
185
+ ```
186
+
187
+ ## **Model Details**
188
+
189
+ **Input**: Text and images.
190
+
191
+ **Output**: Model generates text.
192
+
193
+ **Model Architecture**: Command A+ is a decoder-only Sparse Mixture-of-Experts Transformer Model. With 25B active parameters and 218B total parameters, it has 128 experts, out of which 8 are active per token, and a single shared expert is applied to all tokens. The attention layers interleave sliding-window attention layers with Rotational Positional Embeddings and global attention layers without positional embeddings in a 3:1 ratio, as first introduced in Command A. The sparse MoE layer is trained in a fully dropless manner and uses a token-choice router. We use additive-bias-based load balancing to encourage balanced token load across all experts, and swap out the softmax router activation function with a normalized sigmoid over the topk expert logits per token.
194
+
195
+ **Languages covered:** The model has been trained on 48 languages: English, Arabic, Bulgarian, Bengali, Catalan, Czech, Danish, German, Greek, Spanish, Estonian, Persian, Finnish, Filipino, French, Irish, Hebrew, Hindi, Croatian, Hungarian, Indonesian, Icelandic, Italian, Japanese, Korean, Lithuanian, Latvian, Malay, Maltese, Dutch, Norwegian, Punjabi, Polish, Portuguese, Romanian, Russian, Slovak, Slovenian, Serbian, Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu, Vietnamese, Chinese.
196
+
197
+ **Context Length:** Command A+ supports a context length of 128K & 64K output length.
198
+
199
+ ### **Tool Use Capabilities:**
200
+
201
+ Command A+ has been specifically trained with conversational tool use capabilities. This allows the model to interact with external tools like APIs, databases, or search engines.
202
+
203
+ Tool use with Command A+ is supported through [chat templates](https://huggingface.co/docs/transformers/main/en/chat_templating#advanced-tool-use--function-calling) in Transformers. We recommend providing tool descriptions using JSON schema.
204
+
205
+ <details>
206
+ <summary><b>Tool Use Example [CLICK TO EXPAND]</b></summary>
207
+
208
+ ```py
209
+ from transformers import AutoTokenizer
210
+
211
+ model_id = "CohereLabs/command-a-plus-05-2026-fp8"
212
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
213
+
214
+ # Define tools
215
+ tools = [{
216
+ "type": "function",
217
+ "function": {
218
+ "name": "query_daily_sales_report",
219
+ "description": "Connects to a database to retrieve overall sales volumes and sales information for a given day.",
220
+ "parameters": {
221
+ "type": "object",
222
+ "properties": {
223
+ "day": {
224
+ "description": "Retrieves sales data for this day, formatted as YYYY-MM-DD.",
225
+ "type": "string",
226
+ }
227
+ },
228
+ "required": ["day"],
229
+ },
230
+ },
231
+ }]
232
+
233
+ # Define conversation input
234
+ conversation = [
235
+ {"role": "user", "content": "Can you provide a sales summary for 29th September 2023?"}
236
+ ]
237
+
238
+ # Tokenize the Tool Use prompt directly
239
+ input_ids = tokenizer.apply_chat_template(
240
+ conversation=conversation,
241
+ tools=tools,
242
+ tokenize=True,
243
+ add_generation_prompt=True,
244
+ return_tensors="pt",
245
+ )
246
+ ```
247
+
248
+ You can then generate from this input as normal.
249
+
250
+ If the model generates a plan and tool calls, you should add them to the chat history like so:
251
+
252
+ ```py
253
+ tool_call = {"name": "query_daily_sales_report", "arguments": {"day": "2023-09-29"}}
254
+ thinking = "I will use the query_daily_sales_report tool to find the sales summary for 29th September 2023."
255
+ conversation.append({"role": "assistant", "tool_calls": [{"id": "0", "type": "function", "function": tool_call}], "thinking": thinking})
256
+ ```
257
+
258
+ and then call the tool and append the result, as a dictionary, with the tool role, like so:
259
+
260
+ ```py
261
+ api_response_query_daily_sales_report = {"date": "2023-09-29", "summary": "Total Sales Amount: 10000, Total Units Sold: 250"} # this needs to be a dictionary!!
262
+
263
+ # Append tool results
264
+ conversation.append({"role": "tool", "tool_call_id": "0", "content": api_response_query_daily_sales_report})
265
+ ```
266
+
267
+ After that, you can generate() again to let the model use the tool result in the chat.
268
+
269
+ Note that this was a very brief introduction to tool calling \- for more information, see the Transformers [tool use documentation](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling).
270
+ </details>
271
+
272
+ <details>
273
+ <summary><b>Tool Use With Citations [CLICK TO EXPAND]</b></summary>
274
+
275
+ Optionally, one can ask the model to include grounding spans (citations) in its response to indicate the source of the information, by using `enable_citations=True` in `tokenizer.apply_chat_template(*)`. The generation would look like this:
276
+
277
+ ```
278
+ On 29th September 2023, the total sales amount was <co>10000</co: 0:[0]> and the total units sold were <co>250.</co: 0:[0]>
279
+ ```
280
+
281
+ When citations are turned on, the model associates pieces of texts (called "spans") with those specific tool results that support them (called "sources"). Command A+ uses a pair of tags `<co>` and `</co>` to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. For example, `<co>span</co: 0:[1,2],1:[0]>` means that "span" is supported by result 1 and 2 from `tool_call_id=0` as well as result 0 from `tool_call_id=1`. Sources from the same tool call are grouped together and listed as `{tool_call_id}:[{list of result indices}]`, before they are joined together by ",".
282
+ </details>
283
+
284
+
285
+ ## **Model Card Contact**
286
+
287
+ For errors or additional questions about details in this model card, contact \[[labs@cohere.com](mailto:labs@cohere.com)\].
288
+
289
+ **Try it now:**
290
+
291
+ You can try Command A+ in the [playground](https://dashboard.cohere.com/playground/chat?model=command-a-plus-05-2026). You can also use it in our dedicated [Hugging Face Space](https://huggingface.co/spaces/CohereLabs/command-a-plus-05-2026).
292
+
293
+