Logo: Vllm

Vllm

Communautéit
AlexAI-MCP
vllm

Deploy and serve LLMs with vLLM — OpenAI-compatible inference server with PagedAttention, continuous batching, and quantization support.

Iwwersiicht

EditeurAlexAI-MCP
Repositoryhermes-CCC
Skill-Nummvllm
Stären
134
Forks
22
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    AlexAI-MCP huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Vllm an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/AlexAI-MCP/hermes-CCC/tree/master/skills/vllm
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AlexAI-MCP/hermes-CCC.git /tmp/hermes-CCC
mkdir -p .claude/skills
cp -r /tmp/hermes-CCC/skills/vllm .claude/skills/vllm
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Vllm an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Vllm automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Vllm net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

vLLM

Purpose

  • Use this skill to deploy local or remote LLM inference with vllm.
  • Prefer it when you need OpenAI-compatible serving, high throughput, and modern GPU utilization.
  • vLLM is strongest for decoder-only chat and completion models.
  • It is a good default for production inference when latency and token throughput matter.

Install

  • Install from PyPI:
bash
pip install vllm
  • Verify the install:
bash
python -c "import vllm; print(vllm.__version__)"
  • Match your CUDA, NVIDIA driver, and PyTorch stack before deploying on GPUs.
  • If deployment is containerized, prefer pinning a known-good image or package version.

What vLLM Gives You

  • OpenAI-compatible HTTP API for chat and completion workflows
  • PagedAttention for efficient KV cache memory usage
  • Continuous batching for higher aggregate throughput
  • Tensor parallelism for multi-GPU serving
  • Quantization support for lower memory footprints
  • Streaming token responses
  • Good support for major open-weight model families

Common Models

  • meta-llama/Llama-3.1-8B-Instruct
  • meta-llama/Llama-3.1-70B-Instruct
  • Qwen/Qwen2.5-7B-Instruct
  • Qwen/Qwen2.5-14B-Instruct
  • mistralai/Mistral-7B-Instruct-v0.3
  • microsoft/Phi-3-medium-4k-instruct
  • google/gemma-2-9b-it

Basic Serve

  • Minimal OpenAI-compatible server:
bash
python -m vllm.entrypoints.openai.api_server --model meta-llama/Llama-3.1-8B-Instruct
  • By default this serves on port 8000.
  • The API base path is http://localhost:8000/v1.
  • Health check endpoint:
bash
curl http://localhost:8000/health

Key Flags

  • --port: bind a non-default server port
  • --tensor-parallel-size: split one model across multiple GPUs
  • --gpu-memory-utilization: cap how much GPU RAM vLLM should attempt to use
  • --max-model-len: set maximum sequence length for inference
  • --quantization: load quantized weights when supported

Serve Examples

  • Serve on port 8080:
bash
python -m vllm.entrypoints.openai.api_server \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --port 8080
  • Raise the context window and tune memory usage:
bash
python -m vllm.entrypoints.openai.api_server \
  --model Qwen/Qwen2.5-7B-Instruct \
  --max-model-len 32768 \
  --gpu-memory-utilization 0.92
  • Use four GPUs with tensor parallelism:
bash
python -m vllm.entrypoints.openai.api_server \
  --model meta-llama/Llama-3.1-70B-Instruct \
  --tensor-parallel-size 4

Quantization

  • vLLM commonly works with these quantization paths:

  • awq

  • gptq

  • bitsandbytes

  • fp8

  • Example with AWQ:

bash
python -m vllm.entrypoints.openai.api_server \
  --model Qwen/Qwen2.5-7B-Instruct-AWQ \
  --quantization awq
  • Example with GPTQ:
bash
python -m vllm.entrypoints.openai.api_server \
  --model TheBloke/Mistral-7B-Instruct-v0.2-GPTQ \
  --quantization gptq
  • Example with FP8:
bash
python -m vllm.entrypoints.openai.api_server \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --quantization fp8
  • AWQ and GPTQ reduce VRAM pressure at some accuracy or compatibility cost.
  • bitsandbytes is useful when using 4-bit or 8-bit HF-compatible flows.
  • FP8 is hardware-sensitive and best validated on your actual deployment target.

Call Through the OpenAI Client

  • vLLM exposes an OpenAI-style API, so the standard OpenAI Python client is a common fit.
  • Point the client at the local base URL:
python
from openai import OpenAI

client = OpenAI(
    api_key="dummy",
    base_url="http://localhost:8000/v1",
)

response = client.chat.completions.create(
    model="meta-llama/Llama-3.1-8B-Instruct",
    messages=[
        {"role": "system", "content": "You are a concise assistant."},
        {"role": "user", "content": "Summarize why continuous batching matters."},
    ],
    temperature=0.2,
    max_tokens=256,
)

print(response.choices[0].message.content)
  • base_url='http://localhost:8000/v1' is the key integration setting.
  • Many SDK-based applications can switch from OpenAI-hosted inference to vLLM with only the base URL and model name changed.

Curl Chat Example

bash
curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama/Llama-3.1-8B-Instruct",
    "messages": [
      {"role": "system", "content": "You are concise."},
      {"role": "user", "content": "Explain PagedAttention in two sentences."}
    ],
    "temperature": 0.2,
    "max_tokens": 128
  }'

Async Engine Usage in Python

  • Use the async engine when embedding vLLM inside a Python application instead of only exposing the HTTP server.
  • This pattern is useful for custom services, pipelines, or batched internal inference.
python
import asyncio

from vllm import AsyncEngineArgs, AsyncLLMEngine, SamplingParams


async def main() -> None:
    engine_args = AsyncEngineArgs(
        model="meta-llama/Llama-3.1-8B-Instruct",
        gpu_memory_utilization=0.9,
        max_model_len=8192,
    )
    engine = AsyncLLMEngine.from_engine_args(engine_args)
    sampling_params = SamplingParams(temperature=0.2, max_tokens=128)

    request_id = "req-1"
    prompt = "List three use cases for OpenAI-compatible local inference."

    async for output in engine.generate(prompt, sampling_params, request_id):
        if output.finished:
            print(output.outputs[0].text)


asyncio.run(main())
  • Use unique request IDs for concurrent work.
  • Reuse one engine per process rather than creating a new engine for every request.
  • Keep sampling params explicit for reproducibility in evaluation workflows.

Multi-GPU Notes

  • Scale large models with --tensor-parallel-size 4 or another GPU count that matches the host.
  • Ensure all GPUs are visible and comparable in capability.
  • Cross-GPU communication performance matters, so NVLink or high-bandwidth PCIe topology helps.
  • Validate memory headroom with the exact context size and batch profile you plan to serve.

Benchmarking

  • Benchmark throughput before promoting a serving config to production.
  • Example benchmark entry point:
bash
python benchmarks/benchmark_throughput.py
  • Track at least:
  • prompt tokens per second
  • generated tokens per second
  • p50 and p95 latency
  • GPU memory usage
  • concurrency behavior under steady load

Docker Deployment

  • Container deployment is common for consistent drivers, dependencies, and rollout processes.
  • Example run command:
bash
docker run --gpus all --rm -p 8000:8000 \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  vllm/vllm-openai:latest \
  --model meta-llama/Llama-3.1-8B-Instruct
  • Mount the Hugging Face cache to avoid repeated model downloads.
  • Pin the image tag in production instead of relying on latest.
  • Pass the same serving flags in Docker that you would use on bare metal.

Health and Readiness

  • Basic health check:
bash
curl http://localhost:8000/health
  • Add a model list probe for smoke testing:
bash
curl http://localhost:8000/v1/models
  • In production, combine health checks with a real inference probe before shifting traffic.

Operational Guidance

  • Start with an 8B instruct model before scaling to larger checkpoints.
  • Keep --gpu-memory-utilization conservative during initial rollout.
  • Set --max-model-len only as high as the workload requires.
  • Prefer quantization only after validating quality, tool calling, and long-context behavior.
  • Profile with real prompts, not only synthetic benchmarks.

Common Failure Modes

  • Out-of-memory on startup:

  • lower --max-model-len

  • lower concurrency expectations

  • use quantized weights

  • reduce model size

  • Poor throughput:

  • increase batch pressure

  • verify GPU utilization

  • benchmark with realistic prompt and completion lengths

  • Client compatibility issues:

  • confirm the app is targeting http://localhost:8000/v1

  • confirm the requested model name exactly matches the served model

  • Quantized model load failures:

  • confirm the checkpoint format matches the selected --quantization mode

  • test a non-quantized baseline first

When To Use This Skill

  • You need an OpenAI-compatible endpoint for self-hosted LLMs.
  • You want high-throughput local or cluster inference.
  • You need tensor parallel serving for models larger than one GPU can hold.
  • You are comparing quantization tradeoffs in a production-style serving stack.

Quick Reference

  • Install: pip install vllm
  • Serve: python -m vllm.entrypoints.openai.api_server --model meta-llama/Llama-3.1-8B-Instruct
  • Health: curl http://localhost:8000/health
  • API base URL: http://localhost:8000/v1
  • Multi-GPU: --tensor-parallel-size 4
  • Benchmark: python benchmarks/benchmark_throughput.py

Heefeg gestallte Froen

Wat mécht de KI-Skill Vllm?

Deploy and serve LLMs with vLLM — OpenAI-compatible inference server with PagedAttention, continuous batching, and quantization support.

Firwat Vllm op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Vllm besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Vllm an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/AlexAI-MCP/hermes-CCC/tree/master/skills/vllm an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Vllm benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Vllm benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Vllm domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Vllm gratis?

Jo. AlexAI-MCP huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇