mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-16 13:20:39 -07:00
Route MLX load, inference, unload, reset, cache cleanup, and shutdown through a single worker. Add affinity and concurrent-unload regression coverage.\n\nVerified: 17 related backend tests; frontend CI; cargo check.
16 lines
435 B
Python
16 lines
435 B
Python
"""
|
|
LLM inference module - delegates to backend abstraction layer.
|
|
"""
|
|
|
|
from ..backends import LLMBackend, get_llm_backend, unload_backend
|
|
|
|
|
|
def get_llm_model() -> LLMBackend:
|
|
"""Get LLM backend instance (MLX or PyTorch based on platform)."""
|
|
return get_llm_backend()
|
|
|
|
|
|
async def unload_llm_model() -> None:
|
|
"""Unload LLM model to free memory, serialized onto the MLX worker."""
|
|
await unload_backend(get_llm_backend())
|