Prompts Forms Resume Reports ★ Saved ★ Saved★ + Submit a tool
Tools and frameworks

Xinference

About 4536 characters Updated Nov 30, 2026 28 views AI wiki

Xinference is a one-stop open-source model inference and serving framework from Xorbits Inference, known for "running any open-source model with a single command". It covers not only large language models but also modalities such as speech recognition, speech synthesis, image generation, Embedding and Rerank, serving them through a unified API, and is suited to be the infrastructure base for enterprise internal model-as-a-service.

Core Principles

The architecture is a distributed server-plus-worker model: the control node handles scheduling and routing, multiple workers can be deployed on different machines and different GPUs, and models are assigned to a worker for loading according to rules at startup. Starting xinference-local gives single-machine mode, while xinference-supervisor plus xinference-worker can scale horizontally into a cluster, suitable for large-scale multi-machine, multi-GPU deployment.

The core abstraction is the model instance: each loaded model is an actor inside an independent process with its own VRAM, lifecycle and request queue. It supports on-demand loading and also automatic unloading - releasing VRAM after an idle timeout to avoid long-term occupation. It also supports model replicas to increase concurrent throughput, and dynamic mounting of LoRA adapters, where the base model is loaded only once and multiple fine-tuned variants share the same weights, replacing only the small adapter on switch and saving substantial VRAM.

Inference backends are pluggable: for LLMs one can choose engines such as vLLM, SGLang, llama.cpp, Transformers and MLX, corresponding respectively to high throughput, structured output, low-spec CPU and maximum compatibility; images and speech use dedicated libraries such as diffusers and whisper. Users only specify with --model-engine at startup without changing business code.

For practical selection there is a handy rule: with multiple NVIDIA GPUs, prefer vLLM or SGLang; for structured output choose SGLang; for local development on a Mac choose MLX; for pure CPU or very small memory choose llama.cpp; and when a model is new and no engine supports it yet, fall back to Transformers. This "one platform, many engines" design is exactly why it is better suited as an enterprise base than single-engine solutions.

Key Points

There are two sets of external protocols. One is the OpenAI-compatible interface, including /v1/chat/completions, /v1/embeddings, /v1/audio/transcriptions and /v1/images/generations, so existing applications can be connected by simply replacing the base_url in the client. The other is Xinference's native RESTful interface: /v1/models lists loaded instances, and specific inference endpoints are then called by model_uid, suitable for scenarios requiring fine-grained control.

In deployment form it supports command-line startup after a pip install, and also provides container images and Kubernetes Helm deployment, which can attach to an existing GPU cluster. In multi-tenant scenarios, the control node centrally accounts for the VRAM and card count occupied by each instance, so operations staff can see the allocation of the entire resource pool from a single panel instead of logging into each machine to check nvidia-smi, saving a great deal of communication cost in teams with dozens of cards.

The Web UI is built into the service port, allowing users to browse all supported models, view VRAM usage, and start or stop instances with one click. Model sources are mainly Hugging Face and ModelScope; in domestic network environments, configuring a mirror source allows everything to go through ModelScope without downloading across the firewall. Quantization formats depend on the backend: the vLLM side supports AWQ, GPTQ, FP8 and bitsandbytes; the llama.cpp side uses GGUF; and the Transformers side can load in 4bit or 8bit.

The difference from Ollama: Ollama focuses on local single-machine use, unifies model format as GGUF, offers a higher level of abstraction and works out of the box; Xinference is more like an enterprise deployment platform, supporting multi-GPU multi-machine, multimodality, LoRA hot-plugging and cluster scheduling. Compared with Ray Serve, it is ready to use out of the box but places less emphasis on custom business logic orchestration, while the latter is more flexible for complex pipelines.

Common Misconceptions

First, treating Xinference as an inference accelerator - its value lies in unified management and scheduling, and how fast it actually runs depends on the chosen engine backend. Second, loading multiple large models on a single card at the same time and causing OOM; the correct approach is to enable idle unloading, or to scale capacity with replica count rather than parallel multi-model loading. Third, ignoring the network exposure problem between supervisor and worker; in cluster mode, attention must be paid to port ranges and authentication configuration, otherwise inference endpoints may be left exposed on the public internet and become a data leak entry point.

Application Scenarios

Enterprise internal model service platforms, backends for multimodal AI applications, Embedding and Rerank services for RAG systems, multi-tenant LoRA fine-tuning deployment, unified scheduling of GPU resource pools, and private replacements for cloud APIs.