โ๏ธ Configuration Referenceยถ
This page is the complete reference for every parameter in the MMIRAGE YAML configuration file.
A pipeline config is split into four top-level sections: processors, loading_params,
processing_params, and execution_params.
To route inference through a provider batch API (OpenAI or Anthropic), use the batch_api processor instead of llm (see below).
If you are new to MMIRAGE, read Concepts first to understand the terminology,
then follow Quickstart for a minimal working example.
processorsยถ
The list of supported processor types:
llmโ runs a local SGLang server.image_genโ runs a local Diffusers pipeline for text-to-image generation, see Image Generation.customโ runs your own Python function instead of a model, see Custom Module.batch_apiโ submits the same requests to an API provider.
vision-language inference and image_gen for image generation. The fields below
describe llm and batch_api; see Image Generation for the complete
image_gen processor and output reference.
processors:
- type: llm
server_args:
model_path: Qwen/Qwen3-8B
tp_size: 4
trust_remote_code: true
disable_custom_all_reduce: false
chat_template: "" # Set to e.g. "qwen2-vl" for VLMs
default_sampling_params:
temperature: 0.1
top_p: 0.9
max_new_tokens: 1024
processors[*].server_argsยถ
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
HuggingFace model ID or local path |
|
|
auto from |
Tensor parallelism size |
|
|
|
Allow custom model code from HuggingFace |
|
|
|
Disable custom all-reduce kernel |
|
|
|
Additional keyword arguments forwarded verbatim to |
Use extra_engine_args to pass SGLang engine options not listed above:
server_args:
model_path: Qwen/Qwen3-8B
tp_size: 4
extra_engine_args:
max_running_requests: 1000
chunked_prefill_size: 32768
mem_fraction_static: 0.88
processors[*].default_sampling_paramsยถ
Any key-value pairs accepted by the SGLang sampling API, e.g.:
Field |
Description |
|---|---|
|
Sampling temperature |
|
Top-p nucleus sampling |
|
Maximum tokens to generate |
Additional model-specific options can be passed under custom_params:
default_sampling_params:
temperature: 0.1
top_p: 0.9
max_new_tokens: 1024
custom_params:
chat_template_kwargs:
enable_thinking: false # Qwen3 thinking-mode control
processors[*].chat_templateยถ
Optional. Set to a named template (e.g. qwen2-vl, llava, internvl, phi3_v) for vision-language models. Defaults to the tokenizerโs built-in template.
batch_api โ Provider batch executionยถ
Routes requests through a provider batch API instead of a local SGLang server, for large-scale processing without a GPU. Outputs served by this processor must use type: batch_api.
processors:
- type: batch_api
provider: openai
model: gpt-4o-mini
max_chunk_bytes: 52428800 # 50 MB per batch file
metadata_output_path: /path/to/batch_metadata.jsonl
The API key is read from the environment (OPENAI_API_KEY, ANTHROPIC_API_KEY) and cannot be set in the config.
Shared fields:
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
โ |
Provider identifier: |
|
|
|
Max serialized bytes per batch file (50 MB) |
|
|
|
Optional hard cap on requests per chunk |
|
|
|
Base path for submission receipt files |
|
|
|
|
provider: openai fields:
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Model name for chat completion requests |
|
|
|
Target endpoint used by OpenAI batch jobs |
|
|
|
OpenAI batch completion window |
|
|
|
Optional base URL for API-compatible gateways |
|
|
|
Key-value pairs sent on batch creation |
provider: anthropic fields:
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Model name used in each Messages request body |
|
|
|
Max tokens for the generated response |
|
|
|
Sampling temperature in |
|
|
|
Nucleus sampling probability in |
|
|
|
Optional request timeout |
|
|
|
Optional base URL for API-compatible gateways |
Setting both temperature and top_p is rejected at config load; setting neither leaves sampling at the provider default.
loading_paramsยถ
Controls how datasets are loaded and distributed across shards.
loading_params:
state_dir: ~/.cache/MMIRAGE/state_dir
datasets:
- path: /path/to/data.jsonl
type: JSONL
output_dir: /path/to/output/shards
image_base_path: /path/to/images # optional, for vision tasks
num_shards: 4
shard_id: "$SLURM_ARRAY_TASK_ID"
batch_size: 64
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Shared directory for shard state, retry markers, and status files |
|
|
|
List of dataset configurations (see below) |
|
|
|
Total number of shards to split datasets into |
|
|
|
Index of this shard (0-based). In SLURM use |
|
|
|
Batch size for processing samples |
loading_params.datasets[*]ยถ
Field |
Type |
Required |
Description |
|---|---|---|---|
|
|
โ |
Path to dataset file or directory |
|
|
โ |
Loader type: |
|
|
โ |
Directory where processed shards are written |
|
|
โ |
Base directory for resolving relative image paths |
processing_paramsยถ
Defines variable extraction, LLM-driven generation, and the final output structure.
processing_params:
inputs:
- name: my_var
key: field.nested[0].value # JMESPath expression
type: text # "text" (default) or "image"
outputs:
- name: my_output
type: llm
output_type: plain # "plain" or "JSON"
prompt: |
Do something with {{ my_var }}
output_schema: # Only for output_type: JSON
field_a: str # field: type
field_b: # type plus optional numeric bounds
type: int
min: 0
max: 3
remove_columns: false
output_schema:
result: "{{ my_output }}"
processing_params.inputs[*]ยถ
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
โ |
Variable name used in Jinja2 templates |
|
|
โ |
JMESPath expression to extract value from a sample |
|
|
|
|
processing_params.outputs[*]ยถ
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
โ |
Variable name made available in |
|
|
โ |
Processor type โ must match a processor declared in |
|
|
|
|
|
|
โ |
Jinja2 template for the LLM prompt |
|
|
|
Fields the model must produce when |
processing_params.outputs[*].output_schemaยถ
Declares the fields of a structured JSON output. Required when output_type: JSON,
ignored otherwise. In local/SGLang mode the schema is compiled into a Pydantic
model and handed to the engine as a JSON schema, so the model is constrained
at decode time to emit exactly these fields with these types. In batch mode
(OpenAI Batch API) only the field names are used: every field is requested as a
string, and type or min/max constraints are not enforced.
Three forms are accepted, and the two mapping forms may be mixed freely:
output_schema: # list form โ every field typed as str
- summary
- verdict
output_schema:
summary: str # shorthand mapping โ field: type
score: int
output_schema:
score: # nested mapping โ type plus optional bounds
type: int
min: 0
max: 3
summary: str # mixed with the shorthand form
Nested field keys:
Key |
Type |
Required |
Description |
|---|---|---|---|
|
|
โ |
|
|
|
โ |
Inclusive lower bound. Numeric types only |
|
|
โ |
Inclusive upper bound. Numeric types only |
Bounds become JSON-schema minimum/maximum, which the grammar backend enforces
while decoding, and are re-checked after parsing (see Pipeline).
Either bound may be given on its own.
The schema is validated when the config loads. A ValueError is raised for an
unknown key, a missing or unsupported type, min/max on a non-numeric field,
a non-numeric bound, a fractional bound on an int field, or min greater than
max.
Bounds given as strings are accepted when they look like a number (matching
-?\d+(\.\d+)?) and coerced to the fieldโs numeric type. Because ${ENV_VAR}
expansion always produces a string, this is what keeps min: ${MIN_SCORE}
working; a string that is not numeric is still rejected.
output_type, prompt, and output_schema apply to llm outputs only. A custom
output needs just name and type โ the value comes from your Python function.
processing_params.output_schemaยถ
A dictionary describing the structure of each output sample. Values are Jinja2 templates that reference input or output variable names. Nested dicts and lists are supported.
processing_params.remove_columnsยถ
If true, all original columns are removed from the dataset before writing; only columns defined in output_schema are kept. Defaults to false.
execution_paramsยถ
Controls where and how the pipeline runs.
execution_params:
mode: local # "local" or "slurm"
retry: false
merge: false
max_retries: 3
poll_interval_seconds: 30
settle_time_seconds: 60
# SLURM-specific (required when mode: slurm)
account: my_account
job_name: mmirage-sharded
reservation: ""
nodes: 1
ntasks_per_node: 1
gpus: 4
cpus_per_task: 288
time_limit: "11:59:59"
# Paths
project_root: /path/to/project # Supports ${ENV_VAR} expansion
report_dir: ~/reports
hf_home: ~/hf
edf_env: ""
Core fieldsยถ
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
|
|
|
|
Auto-retry failed shards until success or |
|
|
|
Merge shard outputs after a successful run |
|
|
|
Maximum retries per shard |
|
|
|
Seconds between SLURM job status polls |
|
|
|
Seconds to wait after a SLURM job finishes before checking shard state |
SLURM-specific fieldsยถ
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
โ |
HPC account/partition (required for SLURM mode) |
|
|
|
SLURM job name |
|
|
โ |
Optional SLURM reservation |
|
|
|
Number of nodes |
|
|
|
Tasks per node |
|
|
|
GPUs per node |
|
|
|
CPUs per task |
|
|
|
Wall-clock time limit ( |
Path fieldsยถ
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
โ |
Base project directory. Supports |
|
|
|
Directory for SLURM stdout/stderr logs |
|
|
|
HuggingFace cache directory |
|
|
โ |
Optional EDF environment file path |
Merge output behaviourยถ
Trigger |
Merged output location |
|---|---|
|
|
|
|
|
|
|
|
If shard_* folders are present directly inside --input-dir, MMIRAGE merges that dataset and ignores nested subdirectories (e.g. _pipeline_state).
See alsoยถ
Concepts โ vocabulary for all parameters on this page
Quickstart โ minimal working config examples
Multimodal Processing โ image inputs and
chat_templateSLURM & Cluster Deployment โ
execution_paramsfor SLURM modeBatch API โ the
batch_apiprocessor in depthCLI Reference โ how to run a configured pipeline