Jump to content
Wikitech

Machine Learning/LiftWing/Large Language Models

From Wikitech
This page is currently a draft.
Material may not yet be complete, information may presently be omitted, and certain parts of the content may be subject to radical, rapid alteration. More information pertaining to this may be available on the talk page.

LiftWing has been expanded to bring large language model capabilities to Wikimedia projects and beyond. The platform hosts small and medium open-source LLMs (up to roughly 30B parameters), served with vLLM on AMD GPUs.

Overview

The platform serves general-purpose open-weight LLMs for public use, alongside project-specific models for internal use. It currently focuses on single-GPU inference with horizontal scaling; models are quantized (FP8 where supported) to fit within a single GPU partition, running on the LiftWing Kubernetes / KServe infrastructure.

There are two families of models:

  • General-purpose llm-* models (Qwen) are the public offering: they are reachable through the public API and appear in LiftWing Studio.
  • Project-specific models (safeguard / policy-violation, embeddings, etc.) are internal only — they are not exposed publicly and do not appear in Studio.

Events & programs

Program pages capture what the platform offered at a given event, aimed at that event's participants. Past events are archived here as a record of how the service has evolved.

Program Date Status Page
Wikimania 2026 21–25 July 2026 Current Wikimania 2026

Quick Start

The fastest way to try a model:

  1. No code: open LiftWing Studio and chat with a general-purpose model in the browser.
  2. From the terminal: the public API is OpenAI-compatible, so a single curl gets you a completion.
curlhttps://api.wikimedia.org/service/lw/inference/v1/models/llm-qwen3-14b/openai/v1/chat/completions\
-H"Content-Type: application/json"\
-d'{"model": "llm-qwen3-14b", "messages": [{"role": "user", "content": "In two sentences, what is the Wikimedia Foundation?"}]}'
Keep the JSON body as a single -d '...' argument (single-quoted, on one line). If the request body is split across lines and the trailing \ continuations are lost on paste, curl treats the JSON braces as URL globbing (nested brace in URL) and sends a bodyless GET, which the server rejects with {"detail":"Method Not Allowed"}.
No API key is required for public access, but anonymous traffic shares a 100 requests/hour budget (see Rate Limits & Access). For anything beyond casual testing, run from Toolforge/WMCS or request a higher tier.

LiftWing Studio

LiftWing Studio gives the LiftWing LLMs a user-friendly chat interface, so you can use the models in the browser instead of only through the API. Pick a model, type a prompt, and iterate interactively — no code required. It is the recommended first stop for exploring what the models can do.

Open Studio liftwing-studio.wmcloud.org
Source code gitlab.wikimedia.org/repos/machine-learning/liftwing-studio

Access

Register an account on the Studio sign-in page. New accounts must be approved by an admin before you can sign in and start chatting.

What it offers

  • Chat history across sessions
  • Document uploads
  • Model selection from the available general-purpose models
Only llm-* models appear here. Studio exposes the public general-purpose Qwen models only. Internal project-specific models (safeguard, embeddings, etc.) are not available in Studio.

How it works

Studio runs as three Docker services on a Cloud VPS instance:

Service Role
Open WebUI The user-facing front end (chat history, document uploads, model selection). Chosen over LibreChat for fast deployment, native admin approval/roles, and compatibility with LiftWing; extensible via Python functions and pipelines.
LiteLLM OpenAI-API shim that presents the LiftWing models in a standard OpenAI API format.
Nginx shim Fixes gateway compatibility by stripping the Authorization header and adding the required Api-User-Agent header.
Deploying / adding models (operators). Studio can be deployed on a Cloud VPS with at least 4 GB RAM and 30 GB disk: create the instance, configure security groups, install Docker, and launch the stack. Configuration — including the model list — lives in docker-compose.yml and litellm-config.yaml; add a model by adding an entry to litellm-config.yaml. See the repository for full instructions.

Available Models

The public models run on a single MI300X GPU or GPU partition; context windows are listed per model below.

Public — general-purpose (public API and Studio)

Model ID Base model Precision Context GPUs Notes
llm-qwen3-14b Qwen3-14B-FP8 FP8 + FP8 KV cache 16,384 1 General-purpose chat/completions.
llm-qwen36-27b Qwen3.6-27B-FP8 FP8 + FP8 KV cache 32,768 1 Largest public model; text-only (multimodal disabled).

Internal — project-specific (not public, not in Studio)

Model ID Base / type Precision Context GPUs Purpose
gpt-oss-safeguard-20b gpt-oss-safeguard, ~20B MoE MXFP4 16,384 2 (TP) Policy-violation / safeguard classification.
cope-b-a4b Zentropi CoPE-B (MoE, ~26B total / ~4B active) bf16 16,384 1 Policy-violation detection.
qwen3-embedding Qwen3-Embedding-0.6B fp16 1 Text embeddings (not a chat model).
jina-embedding Jina-Embeddings-v5-text-nano-Retrieval bf16 1 Text embeddings (not a chat model).

API Usage

Public models are served through the Wikimedia REST Gateway at api.wikimedia.org. Each model exposes an OpenAI-compatible interface, so existing OpenAI client libraries work by pointing base_url at the model's endpoint.

Endpoint

The supported interface is chat completions, which is OpenAI-compatible. Paths are relative to https://api.wikimedia.org , and only services named llm-* (the public Qwen models) are routed here.

Interface Path Request body
Chat completions /service/lw/inference/v1/models/llm-<model>/openai/v1/chat/completions messages array

The Qwen models are instruction-tuned chat models, so chat completions is the interface to use: send a messages array and the server applies the model's chat template automatically. Because it is OpenAI-compatible, any OpenAI client library works by pointing base_url at the model's endpoint.

Reasoning tokens in the output. The Qwen models may include their chain-of-thought wrapped in <think>...</think> at the start of the response. Strip or handle these tags if you only want the final answer.

Python (OpenAI SDK)

fromopenaiimport OpenAI
client = OpenAI(
 base_url="https://api.wikimedia.org/service/lw/inference/v1/models/llm-qwen3-14b/openai/v1",
 api_key="none", # public endpoint; no key required
)
resp = client.chat.completions.create(
 model="llm-qwen3-14b",
 messages=[{"role": "user", "content": "Explain vLLM in one sentence."}],
 stream=True, # server-sent events supported
)
for chunk in resp:
 print(chunk.choices[0].delta.content or "", end="")
API reference. Chat completions follows the OpenAI Chat Completions API — use that reference for the full request and response schema. Note that the LiftWing OpenAPI spec (/service/lw/specs/openapi.yaml) currently documents the classic KServe :predict models only and does not yet cover the LLM endpoints.

Deployment Information

LLM inference services are deployed as KServe InferenceServices via the kserve-inference chart, defined in operations/deployment-charts → helmfile.d/ml-services/llm/.

Namespace llm (public llm-* models live here so the gateway can match them by name)
Serving runtime vLLM on ROCm
Hardware AMD MI300X GPUs on ml-serve (eqiad) nodes
Scaling Knative request-per-second autoscaling; single GPU per model (2 for tensor-parallel gpt-oss-safeguard-20b)
Public exposure REST Gateway → api.wikimedia.org, matching llm-* service names
Metrics vLLM Prometheus metrics emitted by all LLM services

Deployments (ml-serve-eqiad)

Per-model deployment details, derived from helmfile.d/ml-services/{llm,experimental}/values-ml-serve-eqiad.yaml. GPU count equals the tensor-parallel size. VRAM figures are weights-only estimates — parameter count ×ばつ precision bytes (2 for BF16/FP16, 1 for FP8, 0.5 for 4-bit int4/MXFP4, using total parameters for MoE models); actual runtime use is higher (KV cache, activations, and vLLM overhead).

Lift Wing LLM deployments (ml-serve-eqiad)
Model (release) Namespace Access Weight size Context (max tokens) GPUs (tensor-parallel) Node selectors Notes
gpt-oss-safeguard-20b llm Internal 20B MoE, ~3.6B active (MXFP4 ≈13 GB) 16,384 2 ml-serve1012 only Tensor-parallel; pinned to 1012 per T421461. Policy-violation.
cope-b-a4b llm Internal Zentropi CoPE-B, 26B MoE / ~4B active (BF16 ≈52 GB) 16,384 1 ml-serve1012 Policy-violation.
llm-qwen3-14b llm Public 14B params (FP8 ≈14 GB) 16,384 1 ml-serve1013 General-purpose; on a 24 GB GPU partition; public API + Studio.
llm-qwen36-27b llm Public Qwen3.6-27B, 27B params (FP8 ≈27 GB) + FP8 KV cache 32,768 1 ml-serve1012 General-purpose; text-only (multimodal disabled); public API + Studio.
qwen3-embedding llm Internal 0.6B params (FP16 ≈1.2 GB) 500 (max input length) 1 ml-serve1013–1015 Qwen3-Embedding-0.6B; embeddings, not a chat model.
Jina-embedding llm Internal 0.2B params (BF16 ≈0.4 GB) 8,192 1 ml-serve1013–1015 jina-embeddings-v5-text-nano-retrieval; embeddings, not a chat model.
cope-a-9b experimental Internal Zentropi CoPE-A, 9B (Gemma-2-9b LoRA merge; BF16 ≈17–18 GB) 4,096 1 ml-serve1013 Policy-violation (experimental).

Rate Limits & Access

Public llm-* endpoints are governed by the LiftWingLLM rate-limit policy in the REST Gateway (T426749). It is a coarse, interim limit until cost/token-based limiting lands.

Client class Limit Who
Public / anonymous 100 / hour Anonymous, user-agent-only, and authenticated users. Shared per-client budget across all llm-* models.
Known network Effectively unlimited WMCS — Cloud VPS and Toolforge (CDN x-trusted-request: A).
Known client Effectively unlimited Networks associated with a known client (x-trusted-request: B).
Approved bot Effectively unlimited Community-approved bots (JWT auth).

Access & sign-in by platform

Platform How to access Sign-in / authentication
LiftWing Studio Browser chat UI at liftwing-studio.wmcloud.org Register an account; usable after admin approval.
Public API OpenAI-compatible endpoint at api.wikimedia.org No API key — open to anonymous requests, subject to the shared 100 req/hour limit above. Run from Toolforge/WMCS for the higher tier.
Internal endpoint Production-network / in-cluster only Not publicly reachable; for internal WMF services and clients.
Because LiftWing Studio runs on Cloud VPS (a known network), Studio requests use the effectively-unlimited tier rather than the public 100 req/hour cap. The gateway sees Studio as a single WMCS client rather than individual users, so any per-user limits are managed within Studio itself.

Accessing from Toolforge (higher rate limit)

Running from Toolforge is the recommended way to get the higher rate limit. Toolforge is part of WMCS, so its egress traffic is classified as a known network and the shared 100 req/hour cap is lifted to effectively unlimited — no API key or extra configuration required. For a quick call you don't need to build anything; step 1 is one-time.

1. Create a Wikimedia developer account and join Toolforge. If you don't have one, create a developer account and request Toolforge membership — the Toolforge Quickstart covers both in a few minutes.

2. Log in to the Toolforge bastion:

ssh<your-username>@login.toolforge.org

3. Call the model. Run the same request you would anywhere — because it now egresses through Toolforge, it automatically gets the higher rate limit:

curlhttps://api.wikimedia.org/service/lw/inference/v1/models/llm-qwen3-14b/openai/v1/chat/completions\
-H"Content-Type: application/json"\
-d'{"model": "llm-qwen3-14b", "messages": [{"role": "user", "content": "Hello from Toolforge!"}]}'
Building a tool or application? The bastion is for quick, interactive use. For anything sustained — a running service, scheduled jobs, or a shared project — create a dedicated tool account and run your code there via the jobs framework or a web service.

Becoming a known client or a community-approved bot (JWT auth) also lifts the limit — contact the ML team (see below) if your use case needs it.

Data & privacy

How your data is handled differs between the API and LiftWing Studio.

API

The API does not log or retain your data — the prompts you send and the responses returned are not persisted, and are not used to train or fine-tune the models. Each request is processed only to generate its response.

LiftWing Studio

Unlike the API, LiftWing Studio stores your conversations by default:

  • Saved chats: by default, chats are saved in Studio's database, so your history is available across sessions.
  • Temporary chats: Studio offers temporary chats, where nothing is persisted in the database — use these if you don't want your prompts stored.
  • Sharing: chats can be shared with other users via the share button.
Prompt retention. Prompts entered into LiftWing Studio are saved in its database by default, and can be shared with other users. If you don't want your prompts and responses persisted, use a temporary chat. This is the key difference from the API, which persists nothing.

Performance

Observability

GPU and vLLM serving metrics are collected in Grafana. The work-in-progress ML infrastructure dashboard covers two layers — infrastructure (GPU compute & capacity, VRAM, system metrics) and service (Kubernetes deployments, vLLM). All LLM inference services now emit vLLM Prometheus metrics (T431136).

ML infra dashboard grafana.wikimedia.org/d/dpzzsnh/ml-infra (WIP)
Progress tracking T429597 — LLM observability

Benchmarking

An initial performance baseline has been recorded for llm-qwen36-27b (FP8) on the internal endpoint, measured with vllm-bench.


llm-qwen36-27b (FP8) — internal endpoint, single replica (2026年07月17日)
Concurrency Req/s Output tok/s TTFT p50 (ms) TTFT p99 (ms) E2EL p50 (ms) E2EL p99 (ms) Failures
1 0.37 35 197 435 3,614 3,650 0
8 1.90 179 255 1,225 5,270 6,270 0
32 3.63 349 730 4,798 10,342 12,393 0
64 4.24 413 3,729 9,401 18,125 19,845 0

Key takeaways:

  • Single-stream (concurrency 1): ~197 ms to first token, ~35 output tokens/s, ~3.6 s for a 128-token response.
  • Throughput saturates around concurrency 64 (~410 output tok/s, ~4.2 req/s); scaling is sub-linear beyond ~8–16, and latency rises sharply under load (end-to-end p50 3.6 s → 18 s).
  • No failed requests across the sweep.
  • Capacity is added by scaling out replicas (horizontal scaling), not by pushing a single replica harder.

This is a single-replica, internal-endpoint baseline on a synthetic fixed-length workload; public-endpoint and additional-model (e.g. llm-qwen3-14b) results will follow, along with comparisons across GPU-partitioning changes. Full procedure, wrapper script, and raw results live in benchmarks/ in the inference-services repository; metric definitions follow T431554; further benchmarking and load-testing work is tracked in T431851.

Capabilities & Limitations

Supported Not supported yet
OpenAI-compatible chat & text completions Tool / function calling
Streaming responses (server-sent events) Web search / browsing
32K-token context (public models) Retrieval-augmented generation (RAG)
Multilingual prompts Vision / multimodal input
Horizontal scaling of single-GPU models Multi-GPU inference for public models (tensor parallelism / distributed)
Experimental. The platform is experimental and does not yet offer an availability SLA. Models are quantized (FP8/int4), which can produce small differences from full-precision output. Model set and endpoints may change without notice.

Onboarding, Report Issues & Get Help

New here? Start with the Quick Start, then try LiftWing Studio and the API.

Channel Where
Report an issue Phabricator, tagged Machine-Learning-Team
Chat IRC #wikimedia-ml (Libera Chat)
Email ml@wikimedia.org

AltStyle によって変換されたページ (->オリジナル) /