Skip to content

LLM Server Helper

Use start_vllm_servers() to start one local vLLM server for each URL in config.remote.server_urls. With the default configuration, this starts one server.

matchminer_ai.llm.vllm_server

Helpers for starting OpenAI-compatible local vLLM servers.

start_vllm_servers

start_vllm_servers(*, config: MMAIConfig | None = None, task: str = 'patient', extra_args: Sequence[str] | None = None, stdout: int | None = None, stderr: int | None = None, print_url: bool = True, wait_until_ready: bool = True, ready_timeout: float = 600.0, ready_poll_interval: float = 5.0) -> list[subprocess.Popen[str]]

Start one local vLLM server for each URL in config.remote.server_urls.

Source code in src/matchminer_ai/llm/vllm_server.py
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
def start_vllm_servers(
    *,
    config: MMAIConfig | None = None,
    task: str = "patient",
    extra_args: Sequence[str] | None = None,
    stdout: int | None = None,
    stderr: int | None = None,
    print_url: bool = True,
    wait_until_ready: bool = True,
    ready_timeout: float = 600.0,
    ready_poll_interval: float = 5.0,
) -> list[subprocess.Popen[str]]:
    """Start one local vLLM server for each URL in ``config.remote.server_urls``."""
    resolved_config = config or load_default_preset()
    return [
        start_vllm_server(
            config=resolved_config,
            task=task,
            server_index=server_index,
            extra_args=extra_args,
            stdout=stdout,
            stderr=stderr,
            print_url=print_url,
            wait_until_ready=wait_until_ready,
            ready_timeout=ready_timeout,
            ready_poll_interval=ready_poll_interval,
        )
        for server_index, _url in enumerate(_remote_server_urls(resolved_config))
    ]