vllm_mlx.model_workflow¶
Model acquisition, inspection, and conversion workflow helpers.
View the complete module source at #L1-L661.
API details¶
Each callable below includes its exact signature, type annotations, inputs, defaults, return contract, documented exceptions, implementation source, and parsed docstring sections when the source provides them.
vllm_mlx.model_workflow
¶
Model acquisition, inspection, and conversion workflow helpers.
The functions in this module intentionally avoid loading model weights. They collect repository/file metadata, download artifacts, and record manifests so a model can be qualified before it is served.
vllm_mlx.model_workflow.MODEL_MANIFEST_NAME
module-attribute
¶
vllm_mlx.model_workflow.CONVERSION_MANIFEST_NAME
module-attribute
¶
vllm_mlx.model_workflow.REGISTRATION_MANIFEST_NAME
module-attribute
¶
vllm_mlx.model_workflow.QUALIFICATION_REQUEST_NAME
module-attribute
¶
vllm_mlx.model_workflow._MODEL_ID_RE
module-attribute
¶
vllm_mlx.model_workflow._NON_MLX_QUANT_METHODS
module-attribute
¶
vllm_mlx.model_workflow.AcquisitionOptions
dataclass
¶
AcquisitionOptions(revision: str | None = None, target_dir: str | None = None, staging_dir: str | None = None, is_mllm: bool = False, fast_transfer: bool = True, local_files_only: bool = False)
Options for Hugging Face model acquisition.
vllm_mlx.model_workflow.AcquisitionOptions.revision
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.AcquisitionOptions.target_dir
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.AcquisitionOptions.staging_dir
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.AcquisitionOptions.is_mllm
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.AcquisitionOptions.fast_transfer
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.AcquisitionOptions.local_files_only
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.ConversionOptions
dataclass
¶
ConversionOptions(source_path: str, output_path: str, quantize: bool = False, q_bits: int | None = None, q_group_size: int | None = None, q_mode: str | None = None, quant_predicate: str | None = None, dtype: str | None = None, trust_remote_code: bool = False, dry_run: bool = False)
Options for the mlx-lm conversion backend.
vllm_mlx.model_workflow.ConversionOptions.quantize
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.ConversionOptions.q_bits
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.ConversionOptions.q_group_size
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.ConversionOptions.q_mode
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.ConversionOptions.quant_predicate
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.ConversionOptions.dtype
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.ConversionOptions.trust_remote_code
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.ConversionOptions.dry_run
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions
dataclass
¶
RegistrationOptions(artifact_path: str, model_id: str | None = None, served_model_name: str | None = None, preset_alias: str | None = None, output_path: str | None = None, mllm: bool | None = None, tool_call_parser: str | None = None, reasoning_parser: str | None = None, default_temperature: float | None = None, default_top_p: float | None = None, default_top_k: int | None = None, default_min_p: float | None = None, default_presence_penalty: float | None = None, default_repetition_penalty: float | None = None, chat_template_kwargs: dict[str, Any] | None = None, feature_flags: list[str] | None = None)
Options for generating a portable model registration manifest.
vllm_mlx.model_workflow.RegistrationOptions.model_id
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.served_model_name
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.preset_alias
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.output_path
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.mllm
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.tool_call_parser
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.reasoning_parser
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.default_temperature
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.default_top_p
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.default_top_k
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.default_min_p
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.default_presence_penalty
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.default_repetition_penalty
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.chat_template_kwargs
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.RegistrationOptions.feature_flags
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.QualificationOptions
dataclass
¶
QualificationOptions(model_id: str, server_url: str = 'http://127.0.0.1:8080', workload_path: str | None = None, output_path: str | None = None, result_path: str | None = None, repetitions: int | None = None, dry_run: bool = False, extra_args: list[str] | None = None)
Options for creating or running a bench-serve qualification handoff.
vllm_mlx.model_workflow.QualificationOptions.server_url
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.QualificationOptions.workload_path
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.QualificationOptions.output_path
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.QualificationOptions.result_path
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.QualificationOptions.repetitions
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.QualificationOptions.dry_run
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow.QualificationOptions.extra_args
class-attribute
instance-attribute
¶
vllm_mlx.model_workflow._now_iso
¶
vllm_mlx.model_workflow._bytes_to_gb
¶
vllm_mlx.model_workflow._read_json
¶
vllm_mlx.model_workflow._write_json
¶
vllm_mlx.model_workflow._local_file_inventory
¶
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._hf_file_inventory
¶
_hf_file_inventory(model_id: str, *, revision: str | None, local_files_only: bool) -> tuple[list[dict[str, Any]], int | None, str | None]
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._hf_config
¶
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._config_value
¶
vllm_mlx.model_workflow._model_family
¶
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._estimate_fit
¶
_estimate_fit(*, total_bytes: int | None, model_files_bytes: int | None, config: dict[str, Any]) -> dict[str, Any]
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._model_file_bytes
¶
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._is_mlx_quantization
¶
Return True only when quant looks like an mlx-lm quantization config.
PyTorch quantization configs (GPTQ, AWQ, ...) carry a quant_method
key that MLX configs never set. Treating those as MLX-ready is a false
positive reported in review.
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._looks_like_mlx_name
¶
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._is_model_id
¶
vllm_mlx.model_workflow._fast_transfer_env
¶
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow.inspect_model
¶
inspect_model(model: str, *, revision: str | None = None, local_files_only: bool = False) -> dict[str, Any]
Inspect a local model path or Hugging Face model id without loading weights.
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow.acquire_model
¶
acquire_model(model_id: str, *, options: AcquisitionOptions | None = None) -> dict[str, Any]
Download a model repository and write a finalized artifact manifest.
Source code in vllm_mlx/model_workflow.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | |
vllm_mlx.model_workflow._conversion_command
¶
_conversion_command(options: ConversionOptions) -> list[str]
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow.convert_model
¶
convert_model(options: ConversionOptions) -> dict[str, Any]
Run mlx-lm conversion and record the exact recipe.
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._existing_manifests
¶
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._drop_none
¶
vllm_mlx.model_workflow.register_model
¶
register_model(options: RegistrationOptions) -> dict[str, Any]
Write a portable registration manifest for a finalized local artifact.
This deliberately does not mutate a production registry. The manifest is a handoff artifact that Ops or a deployment tool can apply after qualification.
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow._qualification_command
¶
_qualification_command(options: QualificationOptions) -> list[str]
Source code in vllm_mlx/model_workflow.py
vllm_mlx.model_workflow.qualify_model
¶
qualify_model(options: QualificationOptions) -> dict[str, Any]
Create or run a bench-serve qualification handoff.
Source code in vllm_mlx/model_workflow.py
Complete contract reference¶
Expand any definition for its exact inputs, annotations, defaults, return contract, directly raised exceptions, source-grounded behavior, and immutable line link. This section includes private and nested definitions that ordinary API generators omit.
vllm_mlx.model_workflow.AcquisitionOptions · class
vllm_mlx.model_workflow.AcquisitionOptions(revision: str | None = None, target_dir: str | None = None, staging_dir: str | None = None, is_mllm: bool = False, fast_transfer: bool = True, local_files_only: bool = False)
Options for Hugging Face model acquisition.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
revision |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
target_dir |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
staging_dir |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
is_mllm |
bool |
no |
False |
Optional constructor field; defaults to False. |
fast_transfer |
bool |
no |
True |
Optional constructor field; defaults to True. |
local_files_only |
bool |
no |
False |
Optional constructor field; defaults to False. |
Returns
- Constructs:
vllm_mlx.model_workflow.AcquisitionOptions
Exceptions and behavior
Class AcquisitionOptions declares 0 direct member(s).
No direct raise statement appears in this definition.
vllm_mlx.model_workflow.ConversionOptions · class
vllm_mlx.model_workflow.ConversionOptions(source_path: str, output_path: str, quantize: bool = False, q_bits: int | None = None, q_group_size: int | None = None, q_mode: str | None = None, quant_predicate: str | None = None, dtype: str | None = None, trust_remote_code: bool = False, dry_run: bool = False)
Options for the mlx-lm conversion backend.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
source_path |
str |
yes |
none |
Required constructor field. |
output_path |
str |
yes |
none |
Required constructor field. |
quantize |
bool |
no |
False |
Optional constructor field; defaults to False. |
q_bits |
int \| None |
no |
None |
Optional constructor field; defaults to None. |
q_group_size |
int \| None |
no |
None |
Optional constructor field; defaults to None. |
q_mode |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
quant_predicate |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
dtype |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
trust_remote_code |
bool |
no |
False |
Optional constructor field; defaults to False. |
dry_run |
bool |
no |
False |
Optional constructor field; defaults to False. |
Returns
- Constructs:
vllm_mlx.model_workflow.ConversionOptions
Exceptions and behavior
Class ConversionOptions declares 0 direct member(s).
No direct raise statement appears in this definition.
vllm_mlx.model_workflow.RegistrationOptions · class
vllm_mlx.model_workflow.RegistrationOptions(artifact_path: str, model_id: str | None = None, served_model_name: str | None = None, preset_alias: str | None = None, output_path: str | None = None, mllm: bool | None = None, tool_call_parser: str | None = None, reasoning_parser: str | None = None, default_temperature: float | None = None, default_top_p: float | None = None, default_top_k: int | None = None, default_min_p: float | None = None, default_presence_penalty: float | None = None, default_repetition_penalty: float | None = None, chat_template_kwargs: dict[str, Any] | None = None, feature_flags: list[str] | None = None)
Options for generating a portable model registration manifest.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
artifact_path |
str |
yes |
none |
Required constructor field. |
model_id |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
served_model_name |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
preset_alias |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
output_path |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
mllm |
bool \| None |
no |
None |
Optional constructor field; defaults to None. |
tool_call_parser |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
reasoning_parser |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
default_temperature |
float \| None |
no |
None |
Optional constructor field; defaults to None. |
default_top_p |
float \| None |
no |
None |
Optional constructor field; defaults to None. |
default_top_k |
int \| None |
no |
None |
Optional constructor field; defaults to None. |
default_min_p |
float \| None |
no |
None |
Optional constructor field; defaults to None. |
default_presence_penalty |
float \| None |
no |
None |
Optional constructor field; defaults to None. |
default_repetition_penalty |
float \| None |
no |
None |
Optional constructor field; defaults to None. |
chat_template_kwargs |
dict[str, Any] \| None |
no |
None |
Optional constructor field; defaults to None. |
feature_flags |
list[str] \| None |
no |
None |
Optional constructor field; defaults to None. |
Returns
- Constructs:
vllm_mlx.model_workflow.RegistrationOptions
Exceptions and behavior
Class RegistrationOptions declares 0 direct member(s).
No direct raise statement appears in this definition.
vllm_mlx.model_workflow.QualificationOptions · class
vllm_mlx.model_workflow.QualificationOptions(model_id: str, server_url: str = 'http://127.0.0.1:8080', workload_path: str | None = None, output_path: str | None = None, result_path: str | None = None, repetitions: int | None = None, dry_run: bool = False, extra_args: list[str] | None = None)
Options for creating or running a bench-serve qualification handoff.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_id |
str |
yes |
none |
Required constructor field. |
server_url |
str |
no |
'http://127.0.0.1:8080' |
Optional constructor field; defaults to 'http://127.0.0.1:8080'. |
workload_path |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
output_path |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
result_path |
str \| None |
no |
None |
Optional constructor field; defaults to None. |
repetitions |
int \| None |
no |
None |
Optional constructor field; defaults to None. |
dry_run |
bool |
no |
False |
Optional constructor field; defaults to False. |
extra_args |
list[str] \| None |
no |
None |
Optional constructor field; defaults to None. |
Returns
- Constructs:
vllm_mlx.model_workflow.QualificationOptions
Exceptions and behavior
Class QualificationOptions declares 0 direct member(s).
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._now_iso · function
Function _now_iso calls datetime.now(timezone.utc).isoformat, datetime.now; returns datetime.now(timezone.utc).isoformat().
Parameters
This callable has no explicit inputs.
Returns
- Type:
str - Direct return expressions:
datetime.now(timezone.utc).isoformat()
Exceptions and behavior
Function _now_iso calls datetime.now(timezone.utc).isoformat, datetime.now; returns datetime.now(timezone.utc).isoformat().
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._bytes_to_gb · function
Function _bytes_to_gb calls round, float; has 2 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
size |
int \| float \| None |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
float | None - Direct return expressions:
None;round(float(size) / 1024 ** 3, 3)
Exceptions and behavior
Function _bytes_to_gb calls round, float; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._read_json · function
Function _read_json calls json.loads, path.read_text; has 2 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path |
Path |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
json.loads(path.read_text());{}
Exceptions and behavior
Function _read_json calls json.loads, path.read_text; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._write_json · function
Function _write_json calls path.parent.mkdir, path.write_text, json.dumps.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path |
Path |
yes |
none |
Required positional or keyword input. |
payload |
dict[str, Any] |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
None
Exceptions and behavior
Function _write_json calls path.parent.mkdir, path.write_text, json.dumps.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._local_file_inventory · function
Function _local_file_inventory calls sorted, path.rglob, item.is_file, item.stat; returns (files, total).
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path |
Path |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
tuple[list[dict[str, Any]], int] - Direct return expressions:
(files, total)
Exceptions and behavior
Function _local_file_inventory calls sorted, path.rglob, item.is_file, item.stat; returns (files, total).
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._hf_file_inventory · function
vllm_mlx.model_workflow._hf_file_inventory(model_id: str, *, revision: str | None, local_files_only: bool) -> tuple[list[dict[str, Any]], int | None, str | None]
Function _hf_file_inventory calls HfApi().model_info, HfApi, getattr, int; has 2 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_id |
str |
yes |
none |
Required positional or keyword input. |
revision |
str \| None |
yes |
none |
Required keyword-only input. |
local_files_only |
bool |
yes |
none |
Required keyword-only input. |
Returns
- Type:
tuple[list[dict[str, Any]], int | None, str | None] - Direct return expressions:
([], None, revision);(files, total if total_known else None, getattr(info, 'sha', revision))
Exceptions and behavior
Function _hf_file_inventory calls HfApi().model_info, HfApi, getattr, int; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._hf_config · function
vllm_mlx.model_workflow._hf_config(model_id: str, *, revision: str | None, local_files_only: bool) -> dict[str, Any]
Function _hf_config calls hf_hub_download, _read_json, Path; returns _read_json(Path(config_path)).
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_id |
str |
yes |
none |
Required positional or keyword input. |
revision |
str \| None |
yes |
none |
Required keyword-only input. |
local_files_only |
bool |
yes |
none |
Required keyword-only input. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
_read_json(Path(config_path))
Exceptions and behavior
Function _hf_config calls hf_hub_download, _read_json, Path; returns _read_json(Path(config_path)).
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._config_value · function
Function _config_value calls config.get, isinstance, text_config.get; has 3 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
config |
dict[str, Any] |
yes |
none |
Required positional or keyword input. |
key |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
Any - Direct return expressions:
config[key];text_config.get(key);None
Exceptions and behavior
Function _config_value calls config.get, isinstance, text_config.get; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._model_family · function
Function _model_family calls _config_value, isinstance, config.get; returns {'model_type': _config_value(config, 'model_type'), 'architectures': architectures, 'torch_dtype': _config_value(config….
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
config |
dict[str, Any] |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
{'model_type': _config_value(config, 'model_type'), 'architectures': architectures, 'torch_dtype': _config_value(config…
Exceptions and behavior
Function _model_family calls _config_value, isinstance, config.get; returns {'model_type': _config_value(config, 'model_type'), 'architectures': architectures, 'torch_dtype': _config_value(config….
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._estimate_fit · function
vllm_mlx.model_workflow._estimate_fit(*, total_bytes: int | None, model_files_bytes: int | None, config: dict[str, Any]) -> dict[str, Any]
Function _estimate_fit calls _model_family(config).get, _model_family, isinstance, warnings.append; returns {'download_size_gb': _bytes_to_gb(total_bytes), 'model_file_size_gb': _bytes_to_gb(model_files_bytes), 'estimated_conve….
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
total_bytes |
int \| None |
yes |
none |
Required keyword-only input. |
model_files_bytes |
int \| None |
yes |
none |
Required keyword-only input. |
config |
dict[str, Any] |
yes |
none |
Required keyword-only input. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
{'download_size_gb': _bytes_to_gb(total_bytes), 'model_file_size_gb': _bytes_to_gb(model_files_bytes), 'estimated_conve…
Exceptions and behavior
Function _estimate_fit calls _model_family(config).get, _model_family, isinstance, warnings.append; returns {'download_size_gb': _bytes_to_gb(total_bytes), 'model_file_size_gb': _bytes_to_gb(model_files_bytes), 'estimated_conve….
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._model_file_bytes · function
Function _model_file_bytes calls str, entry.get, path.endswith, int; has 2 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
files |
list[dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
int | None - Direct return expressions:
None;total if known else None
Exceptions and behavior
Function _model_file_bytes calls str, entry.get, path.endswith, int; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._is_mlx_quantization · function
Return True only when quant looks like an mlx-lm quantization config.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
quant |
Any |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
bool - Direct return expressions:
False;'bits' in quant
Exceptions and behavior
Function _is_mlx_quantization calls isinstance, str(quant.get('quant_method', '')).lower, str, quant.get; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._looks_like_mlx_name · function
Function _looks_like_mlx_name calls model.lower, Path(model).name.lower, Path, name.startswith; returns name.startswith('mlx-community/') or '-mlx' in name or '_mlx' in name or name.endswith('mlx').
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model |
str |
yes |
none |
Required positional or keyword input. |
source |
str |
yes |
none |
Required keyword-only input. |
Returns
- Type:
bool - Direct return expressions:
name.startswith('mlx-community/') or '-mlx' in name or '_mlx' in name or name.endswith('mlx')
Exceptions and behavior
Function _looks_like_mlx_name calls model.lower, Path(model).name.lower, Path, name.startswith; returns name.startswith('mlx-community/') or '-mlx' in name or '_mlx' in name or name.endswith('mlx').
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._is_model_id · function
Function _is_model_id calls bool, _MODEL_ID_RE.fullmatch; returns bool(_MODEL_ID_RE.fullmatch(value)).
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
value |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
bool - Direct return expressions:
bool(_MODEL_ID_RE.fullmatch(value))
Exceptions and behavior
Function _is_model_id calls bool, _MODEL_ID_RE.fullmatch; returns bool(_MODEL_ID_RE.fullmatch(value)).
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._fast_transfer_env · function
vllm_mlx.model_workflow._fast_transfer_env(requested: bool) -> tuple[dict[str, str], dict[str, Any]]
Function _fast_transfer_env calls find_spec; has 3 explicit return paths.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
requested |
bool |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
tuple[dict[str, str], dict[str, Any]] - Direct return expressions:
({}, {'requested': False, 'enabled': False, 'reason': 'disabled'});({}, {'requested': True, 'enabled': False, 'reason': 'hf_transfer package is not installed'});({'HF_HUB_ENABLE_HF_TRANSFER': '1'}, {'requested': True, 'enabled': True, 'reason': 'enabled'})
Exceptions and behavior
Function _fast_transfer_env calls find_spec; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow.inspect_model · function
vllm_mlx.model_workflow.inspect_model(model: str, *, revision: str | None = None, local_files_only: bool = False) -> dict[str, Any]
Inspect a local model path or Hugging Face model id without loading weights.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model |
str |
yes |
none |
Required positional or keyword input. |
revision |
str \| None |
no |
None |
Optional keyword-only input; defaults to None. |
local_files_only |
bool |
no |
False |
Optional keyword-only input; defaults to False. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
{'model': model, 'source': source, 'location': location, 'revision': resolved_revision or revision, 'inspected_at': _no…
Exceptions and behavior
Function inspect_model calls Path(model).expanduser, Path, model_path.exists, _local_file_inventory; can raise ValueError; returns {'model': model, 'source': source, 'location': location, 'revision': resolved_revision or revision, 'inspected_at': _no….
Directly raised exceptions: ValueError.
vllm_mlx.model_workflow.acquire_model · function
vllm_mlx.model_workflow.acquire_model(model_id: str, *, options: AcquisitionOptions | None = None) -> dict[str, Any]
Download a model repository and write a finalized artifact manifest.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_id |
str |
yes |
none |
Required positional or keyword input. |
options |
AcquisitionOptions \| None |
no |
None |
Optional keyword-only input; defaults to None. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
manifest
Exceptions and behavior
Function acquire_model calls AcquisitionOptions, _is_model_id, ValueError, _fast_transfer_env; can raise ValueError, FileExistsError; returns manifest.
Directly raised exceptions: ValueError, FileExistsError.
vllm_mlx.model_workflow._conversion_command · function
Function _conversion_command calls command.append, command.extend, str; returns command.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
options |
ConversionOptions |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
list[str] - Direct return expressions:
command
Exceptions and behavior
Function _conversion_command calls command.append, command.extend, str; returns command.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow.convert_model · function
Run mlx-lm conversion and record the exact recipe.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
options |
ConversionOptions |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
result
Exceptions and behavior
Function convert_model calls _conversion_command, _now_iso, inspect_model, sys.version.split; returns result.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._existing_manifests · function
Function _existing_manifests calls manifest_path.exists, str, _read_json; returns manifests.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path |
Path |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
manifests
Exceptions and behavior
Function _existing_manifests calls manifest_path.exists, str, _read_json; returns manifests.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow._drop_none · function
Function _drop_none calls payload.items; returns {key: value for key, value in payload.items() if value is not None}.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
payload |
dict[str, Any] |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
{key: value for key, value in payload.items() if value is not None}
Exceptions and behavior
Function _drop_none calls payload.items; returns {key: value for key, value in payload.items() if value is not None}.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow.register_model · function
Write a portable registration manifest for a finalized local artifact.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
options |
RegistrationOptions |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
payload
Exceptions and behavior
Function register_model calls Path(options.artifact_path).expanduser, Path, artifact.exists, FileNotFoundError; can raise FileNotFoundError, NotADirectoryError; returns payload.
Directly raised exceptions: FileNotFoundError, NotADirectoryError.
vllm_mlx.model_workflow._qualification_command · function
Function _qualification_command calls command.extend, str; returns command.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
options |
QualificationOptions |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
list[str] - Direct return expressions:
command
Exceptions and behavior
Function _qualification_command calls command.extend, str; returns command.
No direct raise statement appears in this definition.
vllm_mlx.model_workflow.qualify_model · function
Create or run a bench-serve qualification handoff.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
options |
QualificationOptions |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
dict[str, Any] - Direct return expressions:
payload
Exceptions and behavior
Function qualify_model calls _qualification_command, _now_iso, subprocess.run, Path(options.output_path).expanduser; returns payload.
No direct raise statement appears in this definition.
Complete symbol map¶
This map also includes private definitions and nested helpers. The signature column exposes every explicit input even when an internal helper has no dedicated parameter prose.
| Symbol | Kind | Signature and inputs | What it does | Source |
|---|---|---|---|---|
AcquisitionOptions |
class | AcquisitionOptions(revision: str \| None = None, target_dir: str \| None = None, staging_dir: str \| None = None, is_mllm: bool = False, fast_transfer: bool = True, local_files_only: bool = False) |
Options for Hugging Face model acquisition. | #L38-L46 |
ConversionOptions |
class | ConversionOptions(source_path: str, output_path: str, quantize: bool = False, q_bits: int \| None = None, q_group_size: int \| None = None, q_mode: str \| None = None, quant_predicate: str \| None = None, dtype: str \| None = None, trust_remote_code: bool = False, dry_run: bool = False) |
Options for the mlx-lm conversion backend. | #L50-L62 |
RegistrationOptions |
class | RegistrationOptions(artifact_path: str, model_id: str \| None = None, served_model_name: str \| None = None, preset_alias: str \| None = None, output_path: str \| None = None, mllm: bool \| None = None, tool_call_parser: str \| None = None, reasoning_parser: str \| None = None, default_temperature: float \| None = None, default_top_p: float \| None = None, default_top_k: int \| None = None, default_min_p: float \| None = None, default_presence_penalty: float \| None = None, default_repetition_penalty: float \| None = None, chat_template_kwargs: dict[str, Any] \| None = None, feature_flags: list[str] \| None = None) |
Options for generating a portable model registration manifest. | #L66-L84 |
QualificationOptions |
class | QualificationOptions(model_id: str, server_url: str = 'http://127.0.0.1:8080', workload_path: str \| None = None, output_path: str \| None = None, result_path: str \| None = None, repetitions: int \| None = None, dry_run: bool = False, extra_args: list[str] \| None = None) |
Options for creating or running a bench-serve qualification handoff. | #L88-L98 |
_now_iso |
function | _now_iso() -> str |
Function _now_iso calls datetime.now(timezone.utc).isoformat, datetime.now; returns datetime.now(timezone.utc).isoformat(). |
#L101-L102 |
_bytes_to_gb |
function | _bytes_to_gb(size: int \| float \| None) -> float \| None |
Function _bytes_to_gb calls round, float; has 2 explicit return paths. |
#L105-L108 |
_read_json |
function | _read_json(path: Path) -> dict[str, Any] |
Function _read_json calls json.loads, path.read_text; has 2 explicit return paths. |
#L111-L115 |
_write_json |
function | _write_json(path: Path, payload: dict[str, Any]) -> None |
Function _write_json calls path.parent.mkdir, path.write_text, json.dumps. |
#L118-L120 |
_local_file_inventory |
function | _local_file_inventory(path: Path) -> tuple[list[dict[str, Any]], int] |
Function _local_file_inventory calls sorted, path.rglob, item.is_file, item.stat; returns (files, total). |
#L123-L135 |
_hf_file_inventory |
function | _hf_file_inventory(model_id: str, *, revision: str \| None, local_files_only: bool) -> tuple[list[dict[str, Any]], int \| None, str \| None] |
Function _hf_file_inventory calls HfApi().model_info, HfApi, getattr, int; has 2 explicit return paths. |
#L138-L158 |
_hf_config |
function | _hf_config(model_id: str, *, revision: str \| None, local_files_only: bool) -> dict[str, Any] |
Function _hf_config calls hf_hub_download, _read_json, Path; returns _read_json(Path(config_path)). |
#L161-L170 |
_config_value |
function | _config_value(config: dict[str, Any], key: str) -> Any |
Function _config_value calls config.get, isinstance, text_config.get; has 3 explicit return paths. |
#L173-L179 |
_model_family |
function | _model_family(config: dict[str, Any]) -> dict[str, Any] |
Function _model_family calls _config_value, isinstance, config.get; returns {'model_type': _config_value(config, 'model_type'), 'architectures': architectures, 'torch_dtype': _config_value(config…. |
#L182-L201 |
_estimate_fit |
function | _estimate_fit(*, total_bytes: int \| None, model_files_bytes: int \| None, config: dict[str, Any]) -> dict[str, Any] |
Function _estimate_fit calls _model_family(config).get, _model_family, isinstance, warnings.append; returns {'download_size_gb': _bytes_to_gb(total_bytes), 'model_file_size_gb': _bytes_to_gb(model_files_bytes), 'estimated_conve…. |
#L204-L231 |
_model_file_bytes |
function | _model_file_bytes(files: list[dict[str, Any]]) -> int \| None |
Function _model_file_bytes calls str, entry.get, path.endswith, int; has 2 explicit return paths. |
#L234-L246 |
_is_mlx_quantization |
function | _is_mlx_quantization(quant: Any) -> bool |
Return True only when quant looks like an mlx-lm quantization config. | #L252-L265 |
_looks_like_mlx_name |
function | _looks_like_mlx_name(model: str, *, source: str) -> bool |
Function _looks_like_mlx_name calls model.lower, Path(model).name.lower, Path, name.startswith; returns name.startswith('mlx-community/') or '-mlx' in name or '_mlx' in name or name.endswith('mlx'). |
#L268-L275 |
_is_model_id |
function | _is_model_id(value: str) -> bool |
Function _is_model_id calls bool, _MODEL_ID_RE.fullmatch; returns bool(_MODEL_ID_RE.fullmatch(value)). |
#L278-L279 |
_fast_transfer_env |
function | _fast_transfer_env(requested: bool) -> tuple[dict[str, str], dict[str, Any]] |
Function _fast_transfer_env calls find_spec; has 3 explicit return paths. |
#L282-L297 |
inspect_model |
function | inspect_model(model: str, *, revision: str \| None = None, local_files_only: bool = False) -> dict[str, Any] |
Inspect a local model path or Hugging Face model id without loading weights. | #L300-L366 |
acquire_model |
function | acquire_model(model_id: str, *, options: AcquisitionOptions \| None = None) -> dict[str, Any] |
Download a model repository and write a finalized artifact manifest. | #L369-L446 |
_conversion_command |
function | _conversion_command(options: ConversionOptions) -> list[str] |
Function _conversion_command calls command.append, command.extend, str; returns command. |
#L449-L474 |
convert_model |
function | convert_model(options: ConversionOptions) -> dict[str, Any] |
Run mlx-lm conversion and record the exact recipe. | #L477-L525 |
_existing_manifests |
function | _existing_manifests(path: Path) -> dict[str, Any] |
Function _existing_manifests calls manifest_path.exists, str, _read_json; returns manifests. |
#L528-L540 |
_drop_none |
function | _drop_none(payload: dict[str, Any]) -> dict[str, Any] |
Function _drop_none calls payload.items; returns {key: value for key, value in payload.items() if value is not None}. |
#L543-L544 |
register_model |
function | register_model(options: RegistrationOptions) -> dict[str, Any] |
Write a portable registration manifest for a finalized local artifact. | #L547-L603 |
_qualification_command |
function | _qualification_command(options: QualificationOptions) -> list[str] |
Function _qualification_command calls command.extend, str; returns command. |
#L606-L627 |
qualify_model |
function | qualify_model(options: QualificationOptions) -> dict[str, Any] |
Create or run a bench-serve qualification handoff. | #L630-L661 |