vllm_mlx.engine.batched¶
Batched engine for continuous batching with multiple concurrent users.
View the complete module source at #L1-L1231.
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.engine.batched
¶
Batched engine for continuous batching with multiple concurrent users.
This engine wraps AsyncEngineCore to provide continuous batching for better throughput when serving multiple concurrent requests.
For MLLM models, all requests (text-only and multimodal) are routed through the MLLMScheduler, which handles vision encoding and batched generation via MLLMBatchGenerator. MLLM models only initialise the MLLM scheduler (not the LLM engine), so text-only requests must also be routed through it.
vllm_mlx.engine.batched.MLLMModelWrapper
¶
Wrapper for MLLM models to make them compatible with BatchGenerator.
BatchGenerator expects model output to be subscriptable (logits array), but MLLM models return LanguageModelOutput objects. This wrapper extracts the logits from the output.
Also handles Gemma 3's required pixel_values argument by injecting None for text-only requests.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.MLLMModelWrapper._is_gemma3
instance-attribute
¶
_is_gemma3 = hasattr(model, 'model_type') and 'gemma3' in str(getattr(model, 'model_type', '')).lower()
vllm_mlx.engine.batched.MLLMModelWrapper.__call__
¶
Call the model and extract logits from LanguageModelOutput.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine
¶
BatchedEngine(model_name: str, trust_remote_code: bool = False, scheduler_config: Any | None = None, stream_interval: int = 1, force_mllm: bool = False, gpu_memory_utilization: float = 0.9)
Bases: BaseEngine
Batched engine for continuous batching.
This engine provides better throughput when serving multiple concurrent users by batching requests together.
For MLLM (multimodal) models, this engine uses MLLMScheduler which handles images and videos alongside text generation.
Initialize the batched engine.
Parameters:
-
model_name(str) –HuggingFace model name or local path
-
trust_remote_code(bool, default:False) –Whether to trust remote code
-
scheduler_config(Any | None, default:None) –Optional scheduler configuration
-
stream_interval(int, default:1) –Tokens to batch before streaming (1=every token)
-
force_mllm(bool, default:False) –Force loading as MLLM even if not auto-detected
-
gpu_memory_utilization(float, default:0.9) –Fraction of device memory for Metal allocation limit and emergency threshold (0.0-1.0, default 0.90)
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine._trust_remote_code
instance-attribute
¶
vllm_mlx.engine.batched.BatchedEngine._scheduler_config
instance-attribute
¶
vllm_mlx.engine.batched.BatchedEngine._stream_interval
instance-attribute
¶
vllm_mlx.engine.batched.BatchedEngine._gpu_memory_utilization
instance-attribute
¶
vllm_mlx.engine.batched.BatchedEngine._is_mllm
instance-attribute
¶
_is_mllm = force_mllm or is_mllm_model(model_name)
vllm_mlx.engine.batched.BatchedEngine.is_mllm
property
¶
Check if this is a multimodal model.
vllm_mlx.engine.batched.BatchedEngine.prepare_for_start
¶
Load heavyweight model state off the serving event loop.
vllm_mlx.engine.batched.BatchedEngine.start
async
¶
Start the engine (load model if not loaded).
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine._uses_default_prepare_for_start
¶
Return True when prepare_for_start is the class implementation.
vllm_mlx.engine.batched.BatchedEngine._prepare_mllm_model
¶
Load the MLLM model before scheduler startup.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine._start_mllm
async
¶
Start the MLLM engine with MLLMScheduler (continuous batching).
Source code in vllm_mlx/engine/batched.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 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 | |
vllm_mlx.engine.batched.BatchedEngine._inject_mtp_mllm
¶
Inject MTP weights into the MLLM model's language_model.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine._prepare_llm_model
¶
Load the LLM model/tokenizer before engine loop startup.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine._configure_metal_memory_limits
¶
Make MLX allocation failures graceful during startup.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine._start_llm
async
¶
Start the LLM engine with AsyncEngineCore.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine.stop
async
¶
Stop the engine and cleanup resources.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine._apply_chat_template
¶
_apply_chat_template(messages: list[dict[str, Any]], tools: list[dict] | None = None, num_images: int = 0, num_audios: int = 0, chat_template_kwargs: dict[str, Any] | None = None, enable_thinking: bool | None = None) -> str
Apply chat template to messages.
Uses the processor's (or tokenizer's) apply_chat_template with the full message list so that system prompts and conversation history are preserved. The previous implementation extracted only the last user message text via mlx_vlm.prompt_utils.apply_chat_template, which dropped system prompts and all prior turns.
Source code in vllm_mlx/engine/batched.py
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | |
vllm_mlx.engine.batched.BatchedEngine._prepare_mllm_messages
staticmethod
¶
Convert OpenAI-style multimodal content to HuggingFace format.
The OpenAI API uses {"type": "image_url", "image_url": {"url": ...}}
and {"type": "audio_url", "audio_url": {"url": ...}} while
HuggingFace processors expect {"type": "image"} / {"type": "audio"}.
Parameters:
-
messages(list[dict[str, Any]]) –List of chat messages in OpenAI format. Each message is a dict with at least
roleandcontentkeys.
Returns:
-
list[dict[str, Any]]–A new list of messages with
image_url/audio_urlparts -
list[dict[str, Any]]–replaced by
{"type": "image"}/{"type": "audio"}entries -
list[dict[str, Any]]–for the HuggingFace processor.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine.generate
async
¶
generate(prompt: str, max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, stop: list[str] | None = None, images: list[str] | None = None, videos: list[str] | None = None, audio: list[str] | None = None, **kwargs) -> GenerationOutput
Generate a complete response (non-streaming).
Parameters:
-
prompt(str) –Input text
-
max_tokens(int, default:256) –Maximum tokens to generate
-
temperature(float, default:0.7) –Sampling temperature
-
top_p(float, default:0.9) –Top-p sampling
-
stop(list[str] | None, default:None) –Stop sequences
-
images(list[str] | None, default:None) –Optional image URLs/paths (for MLLM)
-
videos(list[str] | None, default:None) –Optional video URLs/paths (for MLLM)
-
audio(list[str] | None, default:None) –Optional audio URLs/paths (for MLLM)
-
**kwargs–Additional model-specific parameters
Returns:
-
GenerationOutput–GenerationOutput with complete text
Source code in vllm_mlx/engine/batched.py
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 | |
vllm_mlx.engine.batched.BatchedEngine.stream_generate
async
¶
stream_generate(prompt: str, max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, stop: list[str] | None = None, images: list[str] | None = None, videos: list[str] | None = None, audio: list[str] | None = None, **kwargs) -> AsyncIterator[GenerationOutput]
Stream generation token by token.
Parameters:
-
prompt(str) –Input text
-
max_tokens(int, default:256) –Maximum tokens to generate
-
temperature(float, default:0.7) –Sampling temperature
-
top_p(float, default:0.9) –Top-p sampling
-
stop(list[str] | None, default:None) –Stop sequences
-
images(list[str] | None, default:None) –Optional image URLs/paths (for MLLM)
-
videos(list[str] | None, default:None) –Optional video URLs/paths (for MLLM)
-
audio(list[str] | None, default:None) –Optional audio URLs/paths (for MLLM)
-
**kwargs–Additional model-specific parameters
Yields:
-
AsyncIterator[GenerationOutput]–GenerationOutput with incremental text
Source code in vllm_mlx/engine/batched.py
819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 | |
vllm_mlx.engine.batched.BatchedEngine.chat
async
¶
chat(messages: list[dict[str, Any]], max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, tools: list[dict] | None = None, images: list[str] | None = None, videos: list[str] | None = None, **kwargs) -> GenerationOutput
Chat completion (non-streaming).
For MLLM models, all requests (including text-only) are routed through the MLLMScheduler for vision-aware batched generation. For non-MLLM models, uses the LLM engine with BatchGenerator.
Parameters:
-
messages(list[dict[str, Any]]) –List of chat messages (OpenAI format)
-
max_tokens(int, default:256) –Maximum tokens to generate
-
temperature(float, default:0.7) –Sampling temperature
-
top_p(float, default:0.9) –Top-p sampling
-
tools(list[dict] | None, default:None) –Optional tool definitions
-
images(list[str] | None, default:None) –Optional image URLs/paths
-
videos(list[str] | None, default:None) –Optional video URLs/paths
-
**kwargs–Additional model-specific parameters
Returns:
-
GenerationOutput–GenerationOutput with assistant response
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine._compute_prefix_boundary
¶
_compute_prefix_boundary(messages: list[dict[str, Any]], tools: list[dict] | None = None, chat_template_kwargs: dict[str, Any] | None = None) -> int
Compute token count for the shared prefix across message variations.
Uses a two-tokenization approach: tokenize the full prompt twice
(once as-is, once with the last user message replaced by a dummy)
and find the longest common prefix (LCP). This gives the exact
boundary where different user suffixes diverge, avoiding template
discrepancies (e.g. Qwen3
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine.stream_chat
async
¶
stream_chat(messages: list[dict[str, Any]], max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, tools: list[dict] | None = None, images: list[str] | None = None, videos: list[str] | None = None, **kwargs) -> AsyncIterator[GenerationOutput]
Stream chat completion token by token.
For MLLM models, all requests (including text-only) are streamed through the MLLMScheduler for vision-aware batched generation. For non-MLLM models, uses the LLM engine with BatchGenerator.
Parameters:
-
messages(list[dict[str, Any]]) –List of chat messages (OpenAI format)
-
max_tokens(int, default:256) –Maximum tokens to generate
-
temperature(float, default:0.7) –Sampling temperature
-
top_p(float, default:0.9) –Top-p sampling
-
tools(list[dict] | None, default:None) –Optional tool definitions
-
images(list[str] | None, default:None) –Optional image URLs/paths
-
videos(list[str] | None, default:None) –Optional video URLs/paths
-
**kwargs–Additional model-specific parameters
Yields:
-
AsyncIterator[GenerationOutput]–GenerationOutput with incremental text
Source code in vllm_mlx/engine/batched.py
1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 | |
vllm_mlx.engine.batched.BatchedEngine.get_stats
¶
Get engine statistics.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine.get_cache_stats
¶
Get cache statistics.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine.clear_runtime_caches
¶
Clear engine-managed runtime caches.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine.abort_request
async
¶
Abort an active or queued batched request by request ID.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine.save_cache_to_disk
¶
Save prefix cache to disk for persistence across restarts.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine.load_cache_from_disk
¶
Load prefix cache from disk. Returns number of entries loaded.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched.BatchedEngine.clear_prefix_cache
¶
Clear the in-memory prefix cache. Used by bench-serve for clean cold-start measurements between configurations.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched._resolve_metal_buffer_cache_limit
¶
_resolve_metal_buffer_cache_limit(max_recommended: int, gpu_memory_utilization: float) -> tuple[int, str]
Resolve the MLX retained-buffer cache cap for Metal startup.
Source code in vllm_mlx/engine/batched.py
vllm_mlx.engine.batched._normalize_tool_call_arguments_for_template
¶
Normalize OpenAI tool-call replay for templates expecting mappings.
vllm_mlx.engine.batched._extract_media_from_messages
¶
Extract images, videos, and audio from OpenAI-format messages.
Returns:
-
tuple–Tuple of (has_media, images_list, videos_list, audios_list)
Source code in vllm_mlx/engine/batched.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.engine.batched._resolve_metal_buffer_cache_limit · function
vllm_mlx.engine.batched._resolve_metal_buffer_cache_limit(max_recommended: int, gpu_memory_utilization: float) -> tuple[int, str]
Resolve the MLX retained-buffer cache cap for Metal startup.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
max_recommended |
int |
yes |
none |
Required positional or keyword input. |
gpu_memory_utilization |
float |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
tuple[int, str] - Direct return expressions:
(limit, 'MLX_BUFFER_CACHE_LIMIT');(int(max_recommended * gpu_memory_utilization), 'device-scaled')
Exceptions and behavior
Function _resolve_metal_buffer_cache_limit calls os.environ.get, int, logger.warning; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched._normalize_tool_call_arguments_for_template · function
vllm_mlx.engine.batched._normalize_tool_call_arguments_for_template(messages: list[dict]) -> list[dict]
Normalize OpenAI tool-call replay for templates expecting mappings.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
messages |
list[dict] |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
list[dict] - Direct return expressions:
normalize_messages_for_chat_template(messages)
Exceptions and behavior
Function _normalize_tool_call_arguments_for_template calls normalize_messages_for_chat_template; returns normalize_messages_for_chat_template(messages).
No direct raise statement appears in this definition.
vllm_mlx.engine.batched._extract_media_from_messages · function
Extract images, videos, and audio from OpenAI-format messages.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
messages |
list[dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
tuple - Direct return expressions:
(has_media, images, videos, audios)
Exceptions and behavior
Function _extract_media_from_messages calls msg.get, isinstance, hasattr, item.model_dump; returns (has_media, images, videos, audios).
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.MLLMModelWrapper · class
Wrapper for MLLM models to make them compatible with BatchGenerator.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model |
not annotated |
yes |
none |
Required positional or keyword input. |
Returns
- Constructs:
vllm_mlx.engine.batched.MLLMModelWrapper
Exceptions and behavior
Class MLLMModelWrapper declares 3 direct member(s).
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.MLLMModelWrapper.__init__ · method
Method MLLMModelWrapper.__init__ updates self._model, self._is_gemma3; calls hasattr, str(getattr(model, 'model_type', '')).lower, str, getattr.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model |
not annotated |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
not annotated
Exceptions and behavior
Method MLLMModelWrapper.__init__ updates self._model, self._is_gemma3; calls hasattr, str(getattr(model, 'model_type', '')).lower, str, getattr.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.MLLMModelWrapper.__call__ · method
Call the model and extract logits from LanguageModelOutput.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
*args |
not annotated |
no |
none |
Additional variadic positional inputs accepted by this callable. |
**kwargs |
not annotated |
no |
none |
Additional variadic keyword inputs accepted by this callable. |
Returns
- Type:
not annotated - Direct return expressions:
output.logits;output
Exceptions and behavior
Method MLLMModelWrapper.__call__ calls self._model, hasattr; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.MLLMModelWrapper.__getattr__ · method
Forward all other attributes to the wrapped model.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name |
not annotated |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
not annotated - Direct return expressions:
getattr(self._model, name)
Exceptions and behavior
Method MLLMModelWrapper.__getattr__ calls getattr; returns getattr(self._model, name).
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine · class
vllm_mlx.engine.batched.BatchedEngine(model_name: str, trust_remote_code: bool = False, scheduler_config: Any | None = None, stream_interval: int = 1, force_mllm: bool = False, gpu_memory_utilization: float = 0.9)
Batched engine for continuous batching.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_name |
str |
yes |
none |
HuggingFace model name or local path |
trust_remote_code |
bool |
no |
False |
Whether to trust remote code |
scheduler_config |
Any \| None |
no |
None |
Optional scheduler configuration |
stream_interval |
int |
no |
1 |
Tokens to batch before streaming (1=every token) |
force_mllm |
bool |
no |
False |
Force loading as MLLM even if not auto-detected |
gpu_memory_utilization |
float |
no |
0.9 |
Fraction of device memory for Metal allocation limit and emergency threshold (0.0-1.0, default 0.90) |
Returns
- Constructs:
vllm_mlx.engine.batched.BatchedEngine
Exceptions and behavior
Class BatchedEngine derives from BaseEngine and declares 28 direct member(s).
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.__init__ · method
vllm_mlx.engine.batched.BatchedEngine.__init__(model_name: str, trust_remote_code: bool = False, scheduler_config: Any | None = None, stream_interval: int = 1, force_mllm: bool = False, gpu_memory_utilization: float = 0.9) -> not annotated
Initialize the batched engine.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_name |
str |
yes |
none |
HuggingFace model name or local path |
trust_remote_code |
bool |
no |
False |
Whether to trust remote code |
scheduler_config |
Any \| None |
no |
None |
Optional scheduler configuration |
stream_interval |
int |
no |
1 |
Tokens to batch before streaming (1=every token) |
force_mllm |
bool |
no |
False |
Force loading as MLLM even if not auto-detected |
gpu_memory_utilization |
float |
no |
0.9 |
Fraction of device memory for Metal allocation limit and emergency threshold (0.0-1.0, default 0.90) |
Returns
- Type:
not annotated
Exceptions and behavior
Method BatchedEngine.__init__ updates self._model_name, self._created_at, self._trust_remote_code, self._scheduler_config; calls time.time, is_mllm_model.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.model_name · method
Get the model name.
Parameters
This callable has no explicit inputs.
Returns
- Type:
str - Direct return expressions:
self._model_name
Exceptions and behavior
Method BatchedEngine.model_name returns self._model_name.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.is_mllm · method
Check if this is a multimodal model.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
self._is_mllm
Exceptions and behavior
Method BatchedEngine.is_mllm returns self._is_mllm.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.tokenizer · method
Get the tokenizer.
Parameters
This callable has no explicit inputs.
Returns
- Type:
Any - Direct return expressions:
getattr(self._processor, 'tokenizer', self._processor);self._tokenizer
Exceptions and behavior
Method BatchedEngine.tokenizer calls getattr; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.prepare_for_start · method
Load heavyweight model state off the serving event loop.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None - Direct return expressions:
None
Exceptions and behavior
Method BatchedEngine.prepare_for_start calls self._prepare_mllm_model, self._prepare_llm_model; returns None.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.start · method
Start the engine (load model if not loaded).
Parameters
This callable has no explicit inputs.
Returns
- Type:
None - Direct return expressions:
None
Exceptions and behavior
Method BatchedEngine.start updates self._loaded; calls self._uses_default_prepare_for_start, self.prepare_for_start, run_blocking_startup_work, self._start_mllm; awaits asynchronous work; returns None.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._uses_default_prepare_for_start · method
Return True when prepare_for_start is the class implementation.
Parameters
This callable has no explicit inputs.
Returns
- Type:
bool - Direct return expressions:
method is BatchedEngine.prepare_for_start
Exceptions and behavior
Method BatchedEngine._uses_default_prepare_for_start calls getattr; returns method is BatchedEngine.prepare_for_start.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._prepare_mllm_model · method
Load the MLLM model before scheduler startup.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None
Exceptions and behavior
Method BatchedEngine._prepare_mllm_model updates self._mllm_instance, self._model, self._processor; calls getattr, MLXMultimodalLM, self._mllm_instance.load, mx.metal.is_available.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._start_mllm · method
Start the MLLM engine with MLLMScheduler (continuous batching).
Parameters
This callable has no explicit inputs.
Returns
- Type:
None
Exceptions and behavior
Method BatchedEngine._start_mllm updates self._mllm_scheduler; calls self._prepare_mllm_model, hasattr, getattr, MLLMSchedulerConfig; awaits asynchronous work.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._inject_mtp_mllm · method
Inject MTP weights into the MLLM model's language_model.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None - Direct return expressions:
None
Exceptions and behavior
Method BatchedEngine._inject_mtp_mllm calls Path, _download, config_path.exists, logger.warning; returns None.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._prepare_llm_model · method
Load the LLM model/tokenizer before engine loop startup.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None - Direct return expressions:
None
Exceptions and behavior
Method BatchedEngine._prepare_llm_model updates self._model, self._tokenizer; calls self._model_name.lower, load_model_with_fallback, validate_mtp_support, validate_35; returns None.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._configure_metal_memory_limits · method
Make MLX allocation failures graceful during startup.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None
Exceptions and behavior
Method BatchedEngine._configure_metal_memory_limits calls mx.metal.is_available, mx.device_info, device_info.get, int.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._start_llm · method
Start the LLM engine with AsyncEngineCore.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None
Exceptions and behavior
Method BatchedEngine._start_llm updates self._engine; calls self._prepare_llm_model, validate_mtp_support, logger.info, logger.warning; awaits asynchronous work.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.stop · method
Stop the engine and cleanup resources.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None
Exceptions and behavior
Method BatchedEngine.stop updates self._mllm_scheduler, self._engine, self._model, self._tokenizer; calls self._mllm_scheduler.stop, self._engine.stop, self._engine.engine.close, logger.info; awaits asynchronous work.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._apply_chat_template · method
vllm_mlx.engine.batched.BatchedEngine._apply_chat_template(messages: list[dict[str, Any]], tools: list[dict] | None = None, num_images: int = 0, num_audios: int = 0, chat_template_kwargs: dict[str, Any] | None = None, enable_thinking: bool | None = None) -> str
Apply chat template to messages.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
messages |
list[dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
tools |
list[dict] \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
num_images |
int |
no |
0 |
Optional positional or keyword input; defaults to 0. |
num_audios |
int |
no |
0 |
Optional positional or keyword input; defaults to 0. |
chat_template_kwargs |
dict[str, Any] \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
enable_thinking |
bool \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Type:
str - Direct return expressions:
template_applicator.apply_chat_template(messages, **template_kwargs);tokenizer_applicator.apply_chat_template(messages, **template_kwargs);prompt + '\nassistant:'
Exceptions and behavior
Method BatchedEngine._apply_chat_template calls _normalize_tool_call_arguments_for_template, hasattr, self._prepare_mllm_messages, self._model_name.lower; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._prepare_mllm_messages · method
vllm_mlx.engine.batched.BatchedEngine._prepare_mllm_messages(messages: list[dict[str, Any]]) -> list[dict[str, Any]]
Convert OpenAI-style multimodal content to HuggingFace format.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
messages |
list[dict[str, Any]] |
yes |
none |
List of chat messages in OpenAI format. Each message is a dict with at least role and content keys. |
Returns
- Type:
list[dict[str, Any]] - Direct return expressions:
prepared
Exceptions and behavior
Method BatchedEngine._prepare_mllm_messages calls isinstance, msg.get, part.get, new_content.append; returns prepared.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.generate · method
async vllm_mlx.engine.batched.BatchedEngine.generate(prompt: str, max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, stop: list[str] | None = None, images: list[str] | None = None, videos: list[str] | None = None, audio: list[str] | None = None, **kwargs) -> GenerationOutput
Generate a complete response (non-streaming).
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
prompt |
str |
yes |
none |
Input text |
max_tokens |
int |
no |
256 |
Maximum tokens to generate |
temperature |
float |
no |
0.7 |
Sampling temperature |
top_p |
float |
no |
0.9 |
Top-p sampling |
stop |
list[str] \| None |
no |
None |
Stop sequences |
images |
list[str] \| None |
no |
None |
Optional image URLs/paths (for MLLM) |
videos |
list[str] \| None |
no |
None |
Optional video URLs/paths (for MLLM) |
audio |
list[str] \| None |
no |
None |
Optional audio URLs/paths (for MLLM) |
**kwargs |
not annotated |
no |
none |
Additional model-specific parameters |
Returns
- Type:
GenerationOutput - Direct return expressions:
GenerationOutput(text=clean_output_text(output.output_text), tokens=output.output_token_ids, prompt_tokens=output.promp…;GenerationOutput(text=text, tokens=output.output_token_ids, prompt_tokens=output.prompt_tokens, completion_tokens=outpu…
Exceptions and behavior
Method BatchedEngine.generate calls self.start, self._mllm_scheduler.generate, kwargs.pop, GenerationOutput; awaits asynchronous work; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.stream_generate · method
async vllm_mlx.engine.batched.BatchedEngine.stream_generate(prompt: str, max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, stop: list[str] | None = None, images: list[str] | None = None, videos: list[str] | None = None, audio: list[str] | None = None, **kwargs) -> AsyncIterator[GenerationOutput]
Stream generation token by token.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
prompt |
str |
yes |
none |
Input text |
max_tokens |
int |
no |
256 |
Maximum tokens to generate |
temperature |
float |
no |
0.7 |
Sampling temperature |
top_p |
float |
no |
0.9 |
Top-p sampling |
stop |
list[str] \| None |
no |
None |
Stop sequences |
images |
list[str] \| None |
no |
None |
Optional image URLs/paths (for MLLM) |
videos |
list[str] \| None |
no |
None |
Optional video URLs/paths (for MLLM) |
audio |
list[str] \| None |
no |
None |
Optional audio URLs/paths (for MLLM) |
**kwargs |
not annotated |
no |
none |
Additional model-specific parameters |
Returns
- Type:
AsyncIterator[GenerationOutput] - Direct return expressions:
None - Yields values incrementally.
Exceptions and behavior
Method BatchedEngine.stream_generate calls self.start, self._mllm_scheduler.add_request_async, kwargs.pop, self._mllm_scheduler.stream_outputs; awaits asynchronous work; yields values incrementally; returns None.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.chat · method
async vllm_mlx.engine.batched.BatchedEngine.chat(messages: list[dict[str, Any]], max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, tools: list[dict] | None = None, images: list[str] | None = None, videos: list[str] | None = None, **kwargs) -> GenerationOutput
Chat completion (non-streaming).
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
messages |
list[dict[str, Any]] |
yes |
none |
List of chat messages (OpenAI format) |
max_tokens |
int |
no |
256 |
Maximum tokens to generate |
temperature |
float |
no |
0.7 |
Sampling temperature |
top_p |
float |
no |
0.9 |
Top-p sampling |
tools |
list[dict] \| None |
no |
None |
Optional tool definitions |
images |
list[str] \| None |
no |
None |
Optional image URLs/paths |
videos |
list[str] \| None |
no |
None |
Optional video URLs/paths |
**kwargs |
not annotated |
no |
none |
Additional model-specific parameters |
Returns
- Type:
GenerationOutput - Direct return expressions:
await self.generate(prompt=prompt, max_tokens=max_tokens, temperature=temperature, top_p=top_p, images=all_images if al…
Exceptions and behavior
Method BatchedEngine.chat calls self.start, extract_multimodal_content, convert_tools_for_template, dict; awaits asynchronous work; returns await self.generate(prompt=prompt, max_tokens=max_tokens, temperature=temperature, top_p=top_p, images=all_images if al….
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine._compute_prefix_boundary · method
vllm_mlx.engine.batched.BatchedEngine._compute_prefix_boundary(messages: list[dict[str, Any]], tools: list[dict] | None = None, chat_template_kwargs: dict[str, Any] | None = None) -> int
Compute token count for the shared prefix across message variations.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
messages |
list[dict[str, Any]] |
yes |
none |
Required positional or keyword input. |
tools |
list[dict] \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
chat_template_kwargs |
dict[str, Any] \| None |
no |
None |
Optional positional or keyword input; defaults to None. |
Returns
- Type:
int - Direct return expressions:
0;lcp
Exceptions and behavior
Method BatchedEngine._compute_prefix_boundary calls range, len, messages[i].get, convert_tools_for_template; has 2 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.stream_chat · method
async vllm_mlx.engine.batched.BatchedEngine.stream_chat(messages: list[dict[str, Any]], max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, tools: list[dict] | None = None, images: list[str] | None = None, videos: list[str] | None = None, **kwargs) -> AsyncIterator[GenerationOutput]
Stream chat completion token by token.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
messages |
list[dict[str, Any]] |
yes |
none |
List of chat messages (OpenAI format) |
max_tokens |
int |
no |
256 |
Maximum tokens to generate |
temperature |
float |
no |
0.7 |
Sampling temperature |
top_p |
float |
no |
0.9 |
Top-p sampling |
tools |
list[dict] \| None |
no |
None |
Optional tool definitions |
images |
list[str] \| None |
no |
None |
Optional image URLs/paths |
videos |
list[str] \| None |
no |
None |
Optional video URLs/paths |
**kwargs |
not annotated |
no |
none |
Additional model-specific parameters |
Returns
- Type:
AsyncIterator[GenerationOutput] - Yields values incrementally.
Exceptions and behavior
Method BatchedEngine.stream_chat calls self.start, extract_multimodal_content, convert_tools_for_template, dict; awaits asynchronous work; yields values incrementally.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.get_stats · method
Get engine statistics.
Parameters
This callable has no explicit inputs.
Returns
- Type:
dict[str, Any] - Direct return expressions:
stats
Exceptions and behavior
Method BatchedEngine.get_stats calls time.time, self._mllm_scheduler.get_stats, stats.update, self._engine.get_stats; returns stats.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.get_cache_stats · method
Get cache statistics.
Parameters
This callable has no explicit inputs.
Returns
- Type:
dict[str, Any] | None - Direct return expressions:
{'prefix_cache': self._mllm_scheduler.batch_generator.get_prefix_cache_stats(), 'vision_embedding_cache': self._mllm_sc…;self._engine.get_cache_stats();None
Exceptions and behavior
Method BatchedEngine.get_cache_stats calls self._mllm_scheduler.batch_generator.get_prefix_cache_stats, self._mllm_scheduler.batch_generator.get_vision_cache_stats, self._engine.get_cache_stats; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.clear_runtime_caches · method
Clear engine-managed runtime caches.
Parameters
This callable has no explicit inputs.
Returns
- Type:
dict[str, Any] | None - Direct return expressions:
self._mllm_scheduler.clear_runtime_caches();self._engine.clear_runtime_caches();None
Exceptions and behavior
Method BatchedEngine.clear_runtime_caches calls self._mllm_scheduler.clear_runtime_caches, self._engine.clear_runtime_caches; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.abort_request · method
Abort an active or queued batched request by request ID.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
request_id |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
bool - Direct return expressions:
self._mllm_scheduler.abort_request(request_id);await result;result;False
Exceptions and behavior
Method BatchedEngine.abort_request calls self._mllm_scheduler.abort_request, hasattr, self._engine.abort_request, inspect.isawaitable; awaits asynchronous work; has 4 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.save_cache_to_disk · method
Save prefix cache to disk for persistence across restarts.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
cache_dir |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
bool - Direct return expressions:
pc.save_to_disk(cache_dir);self._engine.save_cache_to_disk(cache_dir);False
Exceptions and behavior
Method BatchedEngine.save_cache_to_disk calls pc.save_to_disk, self._engine.save_cache_to_disk; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.load_cache_from_disk · method
Load prefix cache from disk.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
cache_dir |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
int - Direct return expressions:
pc.load_from_disk(cache_dir);self._engine.load_cache_from_disk(cache_dir);0
Exceptions and behavior
Method BatchedEngine.load_cache_from_disk calls self._mllm_scheduler._ensure_batch_generator, pc.load_from_disk, self._engine.load_cache_from_disk; has 3 explicit return paths.
No direct raise statement appears in this definition.
vllm_mlx.engine.batched.BatchedEngine.clear_prefix_cache · method
Clear the in-memory prefix cache.
Parameters
This callable has no explicit inputs.
Returns
- Type:
None - Direct return expressions:
None
Exceptions and behavior
Method BatchedEngine.clear_prefix_cache calls hasattr, pc.clear, self._engine.clear_prefix_cache; returns None.
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 |
|---|---|---|---|---|
_resolve_metal_buffer_cache_limit |
function | _resolve_metal_buffer_cache_limit(max_recommended: int, gpu_memory_utilization: float) -> tuple[int, str] |
Resolve the MLX retained-buffer cache cap for Metal startup. | #L35-L58 |
_normalize_tool_call_arguments_for_template |
function | _normalize_tool_call_arguments_for_template(messages: list[dict]) -> list[dict] |
Normalize OpenAI tool-call replay for templates expecting mappings. | #L61-L63 |
_extract_media_from_messages |
function | _extract_media_from_messages(messages: list[dict[str, Any]]) -> tuple |
Extract images, videos, and audio from OpenAI-format messages. | #L66-L137 |
MLLMModelWrapper |
class | MLLMModelWrapper(model) |
Wrapper for MLLM models to make them compatible with BatchGenerator. | #L140-L175 |
MLLMModelWrapper.__init__ |
method | MLLMModelWrapper.__init__(model) -> not annotated |
Method MLLMModelWrapper.__init__ updates self._model, self._is_gemma3; calls hasattr, str(getattr(model, 'model_type', '')).lower, str, getattr. |
#L152-L158 |
MLLMModelWrapper.__call__ |
method | MLLMModelWrapper.__call__(*args, **kwargs) -> not annotated |
Call the model and extract logits from LanguageModelOutput. | #L160-L171 |
MLLMModelWrapper.__getattr__ |
method | MLLMModelWrapper.__getattr__(name) -> not annotated |
Forward all other attributes to the wrapped model. | #L173-L175 |
BatchedEngine |
class | BatchedEngine(model_name: str, trust_remote_code: bool = False, scheduler_config: Any \| None = None, stream_interval: int = 1, force_mllm: bool = False, gpu_memory_utilization: float = 0.9) |
Batched engine for continuous batching. | #L178-L1231 |
BatchedEngine.__init__ |
method | BatchedEngine.__init__(model_name: str, trust_remote_code: bool = False, scheduler_config: Any \| None = None, stream_interval: int = 1, force_mllm: bool = False, gpu_memory_utilization: float = 0.9) -> not annotated |
Initialize the batched engine. | #L189-L224 |
BatchedEngine.model_name |
method | BatchedEngine.model_name() -> str |
Get the model name. | #L227-L229 |
BatchedEngine.is_mllm |
method | BatchedEngine.is_mllm() -> bool |
Check if this is a multimodal model. | #L232-L234 |
BatchedEngine.tokenizer |
method | BatchedEngine.tokenizer() -> Any |
Get the tokenizer. | #L237-L241 |
BatchedEngine.prepare_for_start |
method | BatchedEngine.prepare_for_start() -> None |
Load heavyweight model state off the serving event loop. | #L243-L251 |
BatchedEngine.start |
method | async BatchedEngine.start() -> None |
Start the engine (load model if not loaded). | #L253-L282 |
BatchedEngine._uses_default_prepare_for_start |
method | BatchedEngine._uses_default_prepare_for_start() -> bool |
Return True when prepare_for_start is the class implementation. | #L284-L287 |
BatchedEngine._prepare_mllm_model |
method | BatchedEngine._prepare_mllm_model() -> None |
Load the MLLM model before scheduler startup. | #L289-L334 |
BatchedEngine._start_mllm |
method | async BatchedEngine._start_mllm() -> None |
Start the MLLM engine with MLLMScheduler (continuous batching). | #L336-L429 |
BatchedEngine._inject_mtp_mllm |
method | BatchedEngine._inject_mtp_mllm() -> None |
Inject MTP weights into the MLLM model's language_model. | #L431-L477 |
BatchedEngine._prepare_llm_model |
method | BatchedEngine._prepare_llm_model() -> None |
Load the LLM model/tokenizer before engine loop startup. | #L479-L511 |
BatchedEngine._configure_metal_memory_limits |
method | BatchedEngine._configure_metal_memory_limits() -> None |
Make MLX allocation failures graceful during startup. | #L513-L541 |
BatchedEngine._start_llm |
method | async BatchedEngine._start_llm() -> None |
Start the LLM engine with AsyncEngineCore. | #L543-L579 |
BatchedEngine.stop |
method | async BatchedEngine.stop() -> None |
Stop the engine and cleanup resources. | #L581-L597 |
BatchedEngine._apply_chat_template |
method | BatchedEngine._apply_chat_template(messages: list[dict[str, Any]], tools: list[dict] \| None = None, num_images: int = 0, num_audios: int = 0, chat_template_kwargs: dict[str, Any] \| None = None, enable_thinking: bool \| None = None) -> str |
Apply chat template to messages. | #L599-L687 |
BatchedEngine._prepare_mllm_messages |
method | BatchedEngine._prepare_mllm_messages(messages: list[dict[str, Any]]) -> list[dict[str, Any]] |
Convert OpenAI-style multimodal content to HuggingFace format. | #L690-L726 |
BatchedEngine.generate |
method | async BatchedEngine.generate(prompt: str, max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, stop: list[str] \| None = None, images: list[str] \| None = None, videos: list[str] \| None = None, audio: list[str] \| None = None, **kwargs) -> GenerationOutput |
Generate a complete response (non-streaming). | #L728-L817 |
BatchedEngine.stream_generate |
method | async BatchedEngine.stream_generate(prompt: str, max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, stop: list[str] \| None = None, images: list[str] \| None = None, videos: list[str] \| None = None, audio: list[str] \| None = None, **kwargs) -> AsyncIterator[GenerationOutput] |
Stream generation token by token. | #L819-L913 |
BatchedEngine.chat |
method | async BatchedEngine.chat(messages: list[dict[str, Any]], max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, tools: list[dict] \| None = None, images: list[str] \| None = None, videos: list[str] \| None = None, **kwargs) -> GenerationOutput |
Chat completion (non-streaming). | #L915-L984 |
BatchedEngine._compute_prefix_boundary |
method | BatchedEngine._compute_prefix_boundary(messages: list[dict[str, Any]], tools: list[dict] \| None = None, chat_template_kwargs: dict[str, Any] \| None = None) -> int |
Compute token count for the shared prefix across message variations. | #L986-L1046 |
BatchedEngine.stream_chat |
method | async BatchedEngine.stream_chat(messages: list[dict[str, Any]], max_tokens: int = 256, temperature: float = 0.7, top_p: float = 0.9, tools: list[dict] \| None = None, images: list[str] \| None = None, videos: list[str] \| None = None, **kwargs) -> AsyncIterator[GenerationOutput] |
Stream chat completion token by token. | #L1048-L1127 |
BatchedEngine.get_stats |
method | BatchedEngine.get_stats() -> dict[str, Any] |
Get engine statistics. | #L1129-L1169 |
BatchedEngine.get_cache_stats |
method | BatchedEngine.get_cache_stats() -> dict[str, Any] \| None |
Get cache statistics. | #L1171-L1180 |
BatchedEngine.clear_runtime_caches |
method | BatchedEngine.clear_runtime_caches() -> dict[str, Any] \| None |
Clear engine-managed runtime caches. | #L1182-L1188 |
BatchedEngine.abort_request |
method | async BatchedEngine.abort_request(request_id: str) -> bool |
Abort an active or queued batched request by request ID. | #L1190-L1199 |
BatchedEngine.save_cache_to_disk |
method | BatchedEngine.save_cache_to_disk(cache_dir: str) -> bool |
Save prefix cache to disk for persistence across restarts. | #L1201-L1209 |
BatchedEngine.load_cache_from_disk |
method | BatchedEngine.load_cache_from_disk(cache_dir: str) -> int |
Load prefix cache from disk. | #L1211-L1220 |
BatchedEngine.clear_prefix_cache |
method | BatchedEngine.clear_prefix_cache() -> None |
Clear the in-memory prefix cache. | #L1222-L1231 |