Files
xpu-llm-ports/lfm3/vllm_lfm3/__init__.py
T
Pascal LinxweilerandClaude Opus 5.5 4e7a7ce903 Add LFM3-1.7B vLLM XPU plugin
Out-of-tree vLLM 0.32 plugin for LiquidAI LFM3 on Intel XPU: model,
width-7 short-conv Triton kernels, Dockerfile, reference/API/bench
tests, working notes and benchmark results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 22:06:44 +01:00

30 lines
942 B
Python

# SPDX-License-Identifier: Apache-2.0
"""Out-of-tree vLLM plugin for LiquidAI LFM3 (Lfm3ForCausalLM).
Loaded through the ``vllm.general_plugins`` entry point in every vLLM process
(API server, EngineCore, workers).
"""
import logging
logger = logging.getLogger(__name__)
def register() -> None:
from vllm import ModelRegistry
if "Lfm3ForCausalLM" not in ModelRegistry.get_supported_archs():
# lazy "module:class" form: the model module is only imported when used
ModelRegistry.register_model("Lfm3ForCausalLM", "vllm_lfm3.model:Lfm3ForCausalLM")
# Lets transformers (and therefore vLLM) parse config.json with model_type "lfm3"
# without --trust-remote-code.
from transformers import AutoConfig
from .configuration_lfm3 import Lfm3Config
try:
AutoConfig.register("lfm3", Lfm3Config)
except ValueError:
pass # already registered (e.g. a future transformers ships lfm3)