Adapters, not bigger GPUs, decide what a fine-tuned API costs. You pay for the base model's memory once, and each extra variant adds about 0.14 GB.
How do you serve several fine-tuned models in production without paying for a GPU per variant? Our example: five fine-tuned variants of Qwen3.8 27B, an open model from Qwen.
How much GPU memory a fine-tuned model needs
A fine-tuned model needs GPU memory (VRAM) for its weights and for the requests it is answering. Request memory grows with every token in flight.
Qwen3.8 27B has 27,781,427,952 parameters, stored in 16-bit precision (BF16), so 2 bytes each. That is about 55.6 GB of weights. A full fine-tune changes every weight, so each variant is another complete copy. Five variants need 278 GB. On 80 GB GPUs, that means five GPUs and five endpoints, one per variant.
The second part is the KV cache (key-value cache). It is the record the model keeps of every token it has read, so it need not read them again. Attention is the step in each layer where a token looks back at earlier tokens. A full-attention layer stores a key and a value for every token. KV heads are the parallel units that store them, and the head size is the length of each stored vector. The Qwen3.8 27B config lists 4 KV heads and a head size of 256. Per token, that gives:
KV cache per token = full-attention layers × 2 (key and value) × KV heads × head size × bytes per value
= 16 × 2 × 4 × 256 × 2 bytes = 65,536 bytes (64 KiB)
Qwen3.8 27B uses full attention in only 16 of its 64 layers. The other 48 layers use linear attention, a cheaper kind that keeps a fixed-size summary of the conversation instead of one entry per token. That summary takes about 75.5 MB per request, however long the conversation gets. One conversation of 8,192 tokens therefore needs:
8,192 tokens × 64 KiB = 512 MiB ≈ 537 MB
537 MB + 75.5 MB ≈ 0.61 GB per conversation
Our guide to KV cache memory calculation covers other model layouts.
Serve many fine-tunes on one base model with LoRA adapters
Multi-LoRA serving keeps one base model in VRAM and adds a small adapter per request. LoRA (low-rank adaptation) freezes the base model and trains two small matrices per layer instead. The original LoRA paper reports 10,000 times fewer trainable parameters than a full fine-tune of GPT-3 175B.
The rank is the width of an adapter's two small matrices: rank 16 means 16 columns, and a higher rank stores more numbers. Each layer also has a feed-forward block, three large matrices (projections) that process every token after attention. Each projection maps between 5,120 and 17,408 numbers, so its rank-16 adapter holds 16 × (5,120 + 17,408) = 360,448 parameters. Three projections in 64 layers give 360,448 × 3 × 64 ≈ 69.2 million parameters, or 0.14 GB in BF16.
| Setup, Qwen3.8 27B in BF16 (our calculation) | Weight memory | GPUs at 80 GB |
|---|---|---|
| Five full fine-tunes, one endpoint each | 5 × 55.6 GB = 278 GB | 5 |
| One base model and five rank-16 adapters | 55.6 GB + 5 × 0.14 GB ≈ 56.3 GB | 1 |
vLLM, the open-source serving engine, applies adapters on a per-request basis. Start the server with --enable-lora, register each adapter with --lora-modules, and cap how many stay in VRAM and in CPU memory with max_loras and max_cpu_loras. By default vLLM uses 92% of GPU memory. On one 80 GB H100 that is 73.6 GB. After 56.3 GB of weights, 17.3 GB remain for conversations. At 0.61 GB per 8,192-token conversation, 17.3 ÷ 0.61 ≈ 28 conversations fit at once.
This whole calculation is a memory budget, not a speed measurement. It also leaves out two smaller costs, so the real count is lower. Activation memory is the working space for numbers computed during a request. CUDA graphs are pre-recorded GPU work that vLLM keeps in memory to run faster. Our multi-model serving guide for vLLM shows a full server setup, and LoRA vs full fine-tuning memory cost covers the training side.
Group adapters of different sizes
Adapters of different ranks do different amounts of work per token. A batch is the group of requests the GPU computes in one pass. When a small and a large adapter share a batch, the GPU processes them together. Requests on the small adapter then wait for the large one. LoRAServe, a 2025 study on production traces, measured this slowdown and fixed it by placing and routing adapters by rank. It served up to 2 times as many tokens per second, and answers started up to 9 times sooner. It used up to 50% fewer GPUs. In practice, group requests by rank and keep busy adapters loaded. A replica is one running copy of the model: send each request to a replica that already holds its adapter.
Pick a serving engine and measure latency on your own traffic
Start with vLLM for several fine-tuned variants, and measure before you switch. The engine stores the KV cache in small blocks and adds blocks as a conversation grows. It calls this method PagedAttention. The vLLM team measured older serving systems wasting 60% to 80% of that memory, against under 4% with PagedAttention.
TensorRT-LLM is NVIDIA's serving library, tuned for its own GPUs. TensorRT-LLM used to compile each model into a fixed engine ahead of time. On 15 July 2026, release candidate 1.3.0rc21 removed the Python modules of that older path. The latest stable release is still 1.2.1, from 20 April 2026. If you test TensorRT-LLM now, use its PyTorch backend, which runs the model without the separate compile step. Pin a stable release, because the older path is going away. Our vLLM vs TensorRT-LLM benchmark compares the two in detail.
Two numbers describe what a user feels:
- Time to first token (TTFT): how long the user waits before the answer starts.
- Time per output token (TPOT): how fast the rest of the answer arrives.
NVIDIA's benchmarking guide for TensorRT-LLM reports both and shows the trade-off. Throughput is the number of tokens a GPU produces per second. More users at once raise it, but each user gets tokens more slowly. Test with your real prompt and answer lengths: uniform test requests hide the slow cases. For our own platform's latency and incidents, see the Lyceum status page.
Where to run a fine-tuned API: our fine-tuning, a dedicated endpoint or your own GPU
Lyceum is a sovereign European AI inference provider for open-source models: built and run in Europe. The GPUs run in European data centres, and prompts and outputs are processed, not stored, and never used for training. You can run a fine-tuned model with us in three ways.
- Our fine-tuning (early access). Upload a few hundred examples as a JSONL file and pick GLM-5.3 Flash or Qwen3.8 27B. We train a LoRA adapter and serve the tuned model on our serverless inference, the shared OpenAI-compatible endpoint billed per token. Only the model name changes in your code. The adapter is yours to download, and our guide to porting LoRA adapters between providers lists what has to match elsewhere.
- A dedicated endpoint for a merged model. A merged model has its adapter folded into the base weights, so it loads as one ordinary model. The endpoint runs it from Hugging Face on GPU replicas reserved for you. You pay for the time replicas run, not per request.
- A GPU virtual machine for your own multi-LoRA server. Launch one with 1, 2, 4 or 8 GPUs and run vLLM as above. See GPU virtual machines.
A dedicated endpoint scales itself. It adds or removes replicas based on requests per second per replica (default 10) and the 95th-percentile latency (default 5,000 ms). After 1 hour without requests, the deployment pauses and billing stops. The next request resumes it, and that first request is slower while replicas start.
When to distil instead of serving a large fine-tune
Distil when the task is narrow and a large model is more than it needs. Distillation trains a smaller student model to copy the answers of a larger teacher. Hinton, Vinyals and Dean introduced it in 2015.
An 8-billion-parameter student in 16-bit precision needs about 16 GB of weights. It fits on one 48 GB L40S. If your API only pulls fields out of contracts, let the large model label your examples and train the small one on them. Predibase's distillation playbook notes that the teacher's quality caps the student's.
Deploy a fine-tuned model as an API in three steps
Deploying a merged fine-tune takes three steps: publish the weights, deploy them, call the endpoint.
First, push the merged weights to a private Hugging Face repository. Then deploy it with our CLI and pass a Hugging Face token for the private repository:
lyceum infer deploy your-org/your-fine-tuned-model \
-g gpu.h100 \
--min-replicas 1 \
--max-replicas 3 \
--hf-token $HF_TOKEN \
--wait
Finally, call the deployment with any OpenAI-compatible client and set the model field to your deployment_id:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_LYCEUM_API_KEY",
base_url="https://api.lyceum.technology/api/v2/external",
)
resp = client.chat.completions.create(
model="YOUR_DEPLOYMENT_ID",
messages=[{"role": "user", "content": "Summarise this contract in five bullet points."}],
)
print(resp.choices[0].message.content)
Have a narrow task and a few hundred good examples? Tell us about it on our fine-tuning page, and we set up your first training runs with you.
Frequently asked questions
Can I call a fine-tuned model with my existing OpenAI code?
Yes. Change the base URL, the API key and the model name. A model tuned with our fine-tuning uses our serverless base URL and the model name we give it. A dedicated deployment uses its deployment ID as the model name.
Sources
- huggingface.co
- huggingface.co
- LoRA: Low-Rank Adaptation of Large Language Models (Hu et al., 2021)
- vLLM documentation: LoRA Adapters
- docs.vllm.ai
- Serving Heterogeneous LoRA Adapters in Distributed LLM Inference Systems (arXiv:2511.22880, 2025)
- vLLM: Easy, Fast, and Cheap LLM Serving with PagedAttention
- NVIDIA TensorRT-LLM Documentation
- TensorRT-LLM v1.3.0rc21 release notes (July 2026): legacy TensorRT backend removed
- developer.nvidia.com
- Distilling the Knowledge in a Neural Network (Hinton, Vinyals, Dean, 2015)
- Predibase: LLM Distillation Playbook