Toolverse
All skills

serving-llms-vllm

by davila7

Serves LLMs with high throughput using vLLM's PagedAttention and continuous batching. Use when deploying production LLM APIs, optimizing inference latency/throughput, or serving models with limited GPU memory. Supports OpenAI-compatible endpoints, quantization (GPTQ/AWQ/FP8),

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
davila7
Category
Security
Views
6

About this skill

Serves LLMs with high throughput using vLLM's PagedAttention and continuous batching. Use when deploying production LLM APIs, optimizing inference latency/throughput, or serving models with limited GPU memory. Supports OpenAI-compatible endpoints, quantization (GPTQ/AWQ/FP8), and tensor parallelism.

How to use

  1. Zainstaluj vLLM poleceniem pip install vllm. Upewnij się, że masz zainstalowane zależności: torch i transformers.

  2. Aby uruchomić serwer kompatybilny z API OpenAI, wykonaj vllm serve meta-llama/Llama-3-8B-Instruct. Serwer będzie dostępny na http://localhost:8000/v1.

  3. Wysyłaj zapytania do serwera za pomocą OpenAI SDK. Utwórz klienta z adresem http://localhost:8000/v1 i kluczem API ustawionym na 'EMPTY', następnie użyj client.chat.completions.create() z nazwą modelu i wiadomościami.

  4. Dla wnioskowania offline bez serwera zaimportuj LLM i SamplingParams z vllm, załaduj model, ustaw parametry (temperatura, max_tokens), a następnie wywołaj llm.generate() z listą promptów.

  5. W produkcji skonfiguruj ustawienia serwera w zależności od rozmiaru modelu (np. dla modeli 7B-13B na jednym GPU dostosuj parametry pamięci i batching'u).

  6. Monitoruj metryki wydajności i przepustowości, aby upewnić się, że osiągasz oczekiwaną optymalizację latencji i wykorzystania zasobów GPU.

Related skills