You trained a LoRA fine-tune and now want to serve it as an API your app can call. This guide covers the two ways to do that on BitsRun: merge the LoRA into the base model and upload the result, or register the adapter and serve it next to the base model on one endpoint. Either way you end with a private, OpenAI-compatible URL that bills by the second, in about 15 minutes.
A LoRA adapter (low-rank adaptation) is a small set of extra weights that changes how a base model answers: your task, your tone, your format. It is far smaller than the model it changes.
Before you start
- A BitsRun account with credit. Create your account and add credit from $10. Uploads and adapters need a positive balance, because the files are stored for you.
- Your LoRA, saved by PEFT (
adapter_config.jsonandadapter_model.safetensors), on Hugging Face or on your computer. - For the merged path: Python with
transformersandpeftinstalled, and enough disk space for the full model. - Optional: the
bitsruncommand line, installed withcurl -fsSL https://get.bitsrun.com | sh, thenbitsrun login.
Merged weights or adapters: which is better
| Merged weights (upload) | Adapters on Qwen3 8B | |
|---|---|---|
| Base model | Any text or embedding model BitsRun can serve | Qwen3 8B only |
| What you upload | The full model: a safetensors folder or one GGUF file | adapter_config.json and adapter_model.safetensors, up to 1 GB |
| Runtime | vLLM (safetensors) or llama.cpp (GGUF) | vLLM |
| Fine-tunes per endpoint | One | Up to 4, plus the base model |
| Limits | Up to 20 uploads per account | Up to 10 adapters per account; plain LoRA, rank up to 64 |
| Storage | The full model size | The adapter size |
| Extra cost | Storage above your plan's free amount | None beyond storage; the endpoint's GPU price is the same |
Choose adapters when your fine-tunes are on Qwen3 8B and you have more than one: a support tone, a JSON extractor and a summarizer can share one endpoint, one GPU and one bill. Pay as you go allows 2 endpoints, so this also keeps you within the plan.
Choose merged weights when your base model is anything other than Qwen3 8B, when you want a GGUF quant on llama.cpp for lower memory, or when your adapter uses something we do not serve as an adapter (DoRA, modules_to_save, rank above 64).
How to serve LoRA adapters on Qwen3 8B
What we accept, from LoRA adapters:
base_model_name_or_pathinadapter_config.jsonisQwen/Qwen3-8B(or a copy such asunsloth/Qwen3-8B).- Plain LoRA with rank (
r) up to 64, on any ofq_proj,k_proj,v_proj,o_proj,gate_proj,up_projanddown_proj. - No DoRA, no prompt tuning, no
modules_to_save, no per-layer settings. No.binfiles.
Steps:
Register the adapter. In the dashboard, open Adapters and select Register adapter. Type
hf:owner/repoor paste the repo page, or choose Upload a folder and pick the folder PEFT saved. Only the two adapter files are sent. Select Register adapter. The row shows Ready, usually in under a minute.Deploy the base model. Run:
bashbitsrun deploy hf:Qwen/Qwen3-8B-FP8 --name "Tuned Qwen" --keyOr use New endpoint in the dashboard with
hf:Qwen/Qwen3-8B-FP8. Save the API key the command prints: it is shown once.Add the adapters. On the endpoint card, select Performance, choose up to 4 ready adapters under Settings, then Review changes and Apply settings. The endpoint restarts on its next request with the new set. (For a new endpoint you can also choose them under Adapters right after Check model.)
Copy the adapter id. It starts with
lora-and is shown on the Adapters page, with a ready-made sample for your endpoint.
The adapters' memory comes out of the endpoint's context, so a long context may get a little shorter.
How to call an adapter
Send the adapter id as model. Replace <endpoint-id> with the id from your endpoint URL and <adapter-id> with the rest of the adapter id:
export BITSRUN_API_KEY="brk_your_key"
curl https://<endpoint-id>.endpoint.bitsrun.com/v1/chat/completions \
-H "Authorization: Bearer $BITSRUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "lora-<adapter-id>", "messages": [{"role": "user", "content": "Hello"}]}'Any other model name answers with the base Qwen3 8B, so one endpoint serves the base model and every adapter you added. With the OpenAI SDKs, set the base URL to https://<endpoint-id>.endpoint.bitsrun.com/v1 and pass the adapter id as model.
How to serve merged LoRA weights
Merging folds the LoRA into the base weights, so the result is a normal standalone model. PEFT's merge_and_unload() does it:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "Qwen/Qwen3-8B"
adapter = "./my-lora"
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="auto")
model = PeftModel.from_pretrained(model, adapter)
model = model.merge_and_unload()
model.save_pretrained("./my-finetune")
AutoTokenizer.from_pretrained(base).save_pretrained("./my-finetune")merge_and_unload() returns the merged model rather than changing it in place, so keep the returned value. Check that ./my-finetune holds config.json, the tokenizer files and .safetensors weights (not .bin).
Upload and deploy the folder (it runs on vLLM):
bashbitsrun deploy ./my-finetune --name "My fine-tune" --keyThe CLI uploads the folder, checks it and creates the endpoint. You can also use Or upload your own model on the New endpoint form.
Or make a GGUF quant first (it runs on llama.cpp, with less memory). llama.cpp's quantize guide converts with
convert_hf_to_gguf.py, then quantizes withllama-quantize. Run these from a built llama.cpp checkout:bashpython convert_hf_to_gguf.py ./my-finetune --outfile my-finetune-bf16.gguf --outtype bf16 ./build/bin/llama-quantize my-finetune-bf16.gguf my-finetune-Q4_K_M.gguf Q4_K_M bitsrun deploy ./my-finetune-Q4_K_M.gguf --name "My fine-tune" --key
Uploads must be one GGUF file (not split into parts) or a safetensors folder of up to 64 files, with no code or pickle files. Call the endpoint like any other, with any model name. See Upload your own model.
How much does it cost to serve a fine-tune
The GPU is billed by the second while the endpoint is awake. Starting and loading are free.
| GPU | Per hour | Fits (examples) |
|---|---|---|
| NVIDIA L4, 24 GB | $0.95 | Qwen3 8B FP8 with adapters, an 8B fine-tune at Q4_K_M or in BF16 |
| NVIDIA L40S, 48 GB | $3.20 | 14B fine-tunes in BF16, 32B at Q4_K_M |
| 4x NVIDIA L4, 96 GB | $8.52 | 32B fine-tunes in BF16, 70B at Q4_K_M |
Storage is free up to 10 GB on Pay as you go (200 GB on Pro, 1 TB on Business), then $0.05 per GB a month. A merged Qwen3 8B in BF16 is about 16.4 GB, so on Pay as you go it costs about 6.4 GB x $0.05 = $0.32 a month to keep. A Q4_K_M GGUF of the same model is about 5 GB and fits in the free amount. Adapters on your endpoint cost nothing extra.
Check sizes before you upload with the VRAM calculator and How much VRAM do you need to run an LLM, and the monthly bill with the cost calculator.
If something goes wrong
| Message or code | What to do |
|---|---|
adapter_wrong_base | The adapter was not trained on Qwen3 8B. Train on Qwen/Qwen3-8B or merge and upload instead |
adapter_rank_too_high | Train again with r at 64 or less, or merge and upload |
adapter_endpoint_unsupported | Adapters need an endpoint from hf:Qwen/Qwen3-8B-FP8 or hf:Qwen/Qwen3-8B |
adapter_not_found | Check the lora- id and that the adapter is added to this endpoint |
upload_is_adapter | You uploaded an adapter as a model. Register it on the Adapters page instead |
upload_invalid_model | The folder needs config.json and valid .safetensors weights |
storage_quota_reached | Delete a model you no longer use, or move to a bigger plan |
All codes are in Error codes.
Next step
Create your account and register your first adapter, or upload your merged model. Related guides: Run a Hugging Face model as a private API and Host a GGUF model as an OpenAI-compatible API.
Frequently asked questions
Which base models support LoRA adapters on BitsRun?
Today only Qwen3 8B, served by vLLM on an endpoint deployed from hf:Qwen/Qwen3-8B-FP8 or hf:Qwen/Qwen3-8B. For any other base model, merge the LoRA into the weights and upload the merged model.
How many adapters can one endpoint serve?
Up to 4 adapters per endpoint, next to the base model, and up to 10 adapters per account. Each request picks one by sending its lora- id as model.
Do adapters cost extra?
No. You pay the endpoint's GPU price by the second while it runs, as always. An adapter's files count toward your model storage, like an upload.
Should I merge my LoRA or serve it as an adapter?
Serve it as an adapter if it is a plain LoRA on Qwen3 8B, especially when you have several. Merge it when the base is another model, when you want a smaller GGUF quant, or when it uses DoRA, modules_to_save or a rank above 64.
Can I upload a LoRA adapter saved as .bin files?
No. Only adapter_model.safetensors is accepted, because pickle files can run code when loaded. Save the adapter again with PEFT, which writes safetensors by default.