vllm.model_executor.models.clef_omni
¶
Clef-Omni (https://huggingface.co/Cloudflare/clef-omni).
The Qwen3-Omni thinker with a joint schema head that scores every option of
every question in one forward pass. The head reads the final hidden states of
the whole prompt, so it runs as a token_classify pooler.
Each request carries its schema in PoolingParams.extra_kwargs under
"joint_schema":
question_types: 0 (noul), 1 (choice) or 2 (score) per question.question_spans: the[start, end)of each question's instructions.option_spans: the[start, end)of each option, question by question.option_counts: the number of options of each question.
Spans count from the end of the prompt (-len(prompt) <= start < end <= 0),
so they hold after multimodal placeholders are expanded. The output has one
value per option, in option_spans order: its probability within its
question, or its logit with use_activation=False.
Classes:
-
ClefOmniMultiModalProcessor–Caps video frames at the reference's per-frame pixel count.
-
JointSchemaHead– -
JointSchemaPooler–Runs the joint schema head on each finished prompt.
-
SchemaIndices–Where one prompt's questions and options are, on the model's device.
Functions:
-
cap_frame_pixels–The reference reads each video frame at at most 256 * 32 * 32 pixels,
-
parse_joint_schema–The question types, the absolute spans of the questions then of the
ClefOmniMultiModalProcessor
¶
Bases: Qwen3OmniMoeThinkerMultiModalProcessor
Caps video frames at the reference's per-frame pixel count.
Source code in vllm/model_executor/models/clef_omni.py
JointSchemaHead
¶
Bases: Module
Methods:
-
forward–The
[O]option logits of one prompt, from its[L, hidden]
Source code in vllm/model_executor/models/clef_omni.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
forward(hidden_states, lexical, schema)
¶
The [O] option logits of one prompt, from its [L, hidden]
final hidden states and each option's [O, hidden] mean output
embedding.
Source code in vllm/model_executor/models/clef_omni.py
JointSchemaPooler
¶
Bases: Pooler
Runs the joint schema head on each finished prompt.
It never raises, because it runs in the engine core: a prompt without a valid schema, such as a profiling dummy, gets an empty output.
Source code in vllm/model_executor/models/clef_omni.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | |
_indices(types, spans, counts, device)
staticmethod
¶
The schema's indices, plus the option tokens' positions (on the CPU) and their option spans, for the lexical embeddings.
Source code in vllm/model_executor/models/clef_omni.py
SchemaIndices
dataclass
¶
Where one prompt's questions and options are, on the model's device.
Attributes:
-
option_mask(Tensor) –[Q, max_options], true at the slots of options. -
option_question(Tensor) –The question of each option,
[O]. -
option_slots(Tensor) –Each option's flat index in a
[Q, max_options]grid,[O]. -
positions(Tensor) –Every token of every span, questions first.
-
question_types(Tensor) –[Q]. -
span_ids(Tensor) –The span of each of
positions. -
span_lengths(Tensor) –[Q + O].
Source code in vllm/model_executor/models/clef_omni.py
option_mask
instance-attribute
¶
[Q, max_options], true at the slots of options.
option_question
instance-attribute
¶
The question of each option, [O].
option_slots
instance-attribute
¶
Each option's flat index in a [Q, max_options] grid, [O].
positions
instance-attribute
¶
Every token of every span, questions first.
question_types
instance-attribute
¶
[Q].
span_ids
instance-attribute
¶
The span of each of positions.
span_lengths
instance-attribute
¶
[Q + O].
cap_frame_pixels(frames)
¶
The reference reads each video frame at at most 256 * 32 * 32 pixels, in even sizes. Frames are NHWC uint8, numpy or tensor; tensors stay on their device (a CUDA tensor from torchcodec must not round-trip).
Source code in vllm/model_executor/models/clef_omni.py
parse_joint_schema(extra_kwargs, prompt_len)
¶
The question types, the absolute spans of the questions then of the options, and the option counts. None if the schema is missing or invalid.