LIVE · Thursday 3 December

Self-Hosting a Fine-Tuned Decision Model: Get the Weights, Serve With vLLM, Calibrate Before You Act

A private endpoint for a fine-tuned decision model needs the full artifact set, a hardened server, calibrated scores and a fallback. Fine-tuning API access alone gives you none of the weights.

By Surya11 min read

You can self-host a fine-tuned decision model when you hold its weights and a licence that allows your use. That means a full checkpoint, or the base model plus its adapter, with the tokenizer, any retriever and the calibration files. Serve it behind your own endpoint, for example vLLM's OpenAI-compatible server, and validate every decision in application code. Only act automatically on scores that are calibrated on held-out data, and defer the rest.

A decision model in this guide is a model that picks one option from a fixed list, such as routing a ticket, choosing a tool or approving a refund. It differs from a chat model in one useful way. Its output can be checked against a closed set of allowed answers, and its confidence can be measured against real outcomes.

Fine-tuning API access does not give you a model that you can deploy

Check first whether your fine-tuning process gives you files that you can host. A hosted fine-tuning service may return only a name for the trained model. OpenAI's supervised fine-tuning guide describes the result of a job as a fine_tuned_model ID to use "in Responses or Chat Completions," and the guide does not mention downloading weights. The same guide now opens with the statement that OpenAI "is winding down the fine-tuning platform." A model that exists only as an API ID cannot be moved to your own hardware. It has to be retrained on an open-weight base from your own data.

If you trained with Hugging Face PEFT, you have an adapter, not a model. According to the PEFT checkpoint documentation, save_pretrained() writes adapter_model.safetensors, adapter_config.json and a model card. The saved state "only contains the parameters of the adapter module, not the base model." To load it, "you need to have the original model available as well."

The artifact checklist covers more than the adapter file

A decision model is usually a pipeline, and every stage changes the answer. Before you plan any hardware, collect the following items and record a version or hash for each one:

  1. Record the exact base-model revision that the adapter was trained on. The adapter config stores base_model_name_or_path and a revision field, and the PEFT example shows that field left as null. Fill it with a commit hash so that a later upload to the base repository cannot change your model.
  2. Keep the adapter or full checkpoint in safetensors format. The PEFT documentation warns that the older .bin format uses pickle and carries known security risks.
  3. Pin the tokenizer or processor that was used in training, including the chat template if the model expects one.
  4. Version the retriever and its index if the model selects options or context through a separate retrieval step.
  5. Store the calibration assets, such as a fitted temperature or isotonic map, together with the decision threshold.
  6. Save the inference configuration, including precision, attention implementation, maximum input length and sampling settings.
  7. Confirm the licence for each component. The adapter and the base model can carry different terms.

Merging the adapter into the base produces a single model that is easier to ship. PEFT's merge_and_unload() does this, and the documentation states that inference with a merged model "should be a bit faster." It also lists the costs. After merging, you cannot unmerge, switch adapters or disable the adapter. "Not all PEFT methods support merging weights," and some methods cannot be merged with certain quantization settings. Merge only after you confirm that your adapter type and your quantization choice support it, and then re-run your evaluation on the merged file.

TOD shows why a decision model is more than a set of weights

Parsec's TOD release is a concrete case of the checklist. Parsec describes TOD as a "universal decision model" that ranks the next action from a list of allowed actions and passes low-confidence turns to a parent LLM. Its Hugging Face model card describes LoRA adapters on google/gemma-4-12B-it plus a ModernBERT-base retriever. The base weights are not included. The card lists the adapters as Apache-2.0 and requires users to accept the Gemma 4 terms for the base. Google's own model page lists gemma-4-12B-it under Apache 2.0, so check the base model's current licence directly before you deploy. TOD's documented interface is a Python call, predict(state, options, question, images), which returns one probability per option, summing to 1. Its repository specifies chunked_eager or eager attention rather than sdpa. It also advises against bitsandbytes int8, which, according to the repository, flips 8% of picks. Parsec's TOD page also reports that the release scored below its untrained base model on a public benchmark, and Parsec states that the regression is to be fixed in the next release. No one has published peak memory, throughput or latency for a self-hosted TOD pipeline on your kind of workload. Parsec sells hosted TOD decisions at $0.30 per 1,000, according to its TOD page. Its separate custom-tuning service for decision models has no published price and names no deployment options.

vLLM serves adapters behind an OpenAI-compatible API, but a custom pipeline needs its own wrapper

vLLM's documentation describes an HTTP server that implements OpenAI's Completions and Chat APIs. It also serves LoRA adapters next to their base model. The commands below follow vLLM's documentation for release v0.34.0, published on November 16, 2026. Pin the versions that you test, because both vLLM and PEFT change often.

pip install "vllm==0.34.0" "peft==0.22.0" "scikit-learn==1.9.1"
export VLLM_API_KEY="replace-with-a-secret"
vllm serve <base-model> \
  --revision <commit-hash> \
  --enable-lora \
  --lora-modules decision-v3=./adapters/decision-v3 \
  --max-lora-rank 16 \
  --generation-config vllm

The adapter then appears in /v1/models beside the base model, and a request selects it through the model field. Set --max-lora-rank to the largest rank among your adapters, because the documentation states that a higher value wastes memory. The --revision flag pins the base model to the same commit that the adapter config records. The --generation-config vllm flag stops the server from applying the model repository's own default sampling settings.

The versions in the command above were current on November 24, 2026, and each one changes a step in this guide:

Component Version and release date What changes for a decision model
vLLM 0.34.0, November 16, 2026 structured_outputs replaces the removed guided_* fields
PEFT 0.22.0, November 19, 2026 Merging depends on the adapter method and quantization
scikit-learn 1.9.1, September 11, 2026 FrozenEstimator calibrates a model that is already trained
Accelerate 1.16.0, November 16, 2026 estimate-memory reports load size, not inference size

The TOD pipeline is left out of the table because its retrieval and option-scoring path has not been tested under vLLM.

The Chat Completions API applies only to text-generation models with a chat template. A pipeline with a retriever and a scoring call that returns probabilities does not map onto that API without your own code. In that case, run the pipeline's documented runtime inside a small service, and expose only the endpoints that you need. Treat any vLLM path for such a pipeline as unverified until you have run the full retrieval and scoring path end to end and compared its picks with the reference implementation.

Structured outputs make the format valid, not the decision correct

A decision request has three parts: the current state, the question and the allowed options. The model returns a score for each option. Your application then selects, defers or rejects. The example below uses illustrative numbers.

{
  "state": {"order_id": "A-1042", "status": "delivered", "days_since_delivery": 3},
  "question": "What should happen to this refund request?",
  "options": ["approve_refund", "request_photo", "escalate_to_agent"],
  "scores": {"approve_refund": 0.71, "request_photo": 0.22, "escalate_to_agent": 0.07},
  "threshold": 0.85,
  "result": {"selected": null, "deferred": true, "reason": "top score 0.71 below threshold"}
}

If you serve a generative model, vLLM can constrain its output. Its structured-outputs documentation lists a choice parameter, which makes the output "exactly one of the choices," and a json parameter that follows a JSON Schema. These are passed as extra parameters, for example extra_body={"structured_outputs": {"choice": [...]}}. The older guided_choice and guided_json fields were removed in v0.12.0. The lm-format-enforcer backend needs an explicit opt-in in v0.34.0 and is due for removal in v0.35.0.

A valid JSON object is still only a format check. Your application code should do the following, in this order, outside the model:

  1. Check that the selected option is in the list that you sent for this request.
  2. Resolve the arguments, such as the order ID or the refund amount, from your own records.
  3. Apply business rules and authorization for the user and the action.
  4. Execute the action, and log the scores, the threshold and the model version.

Keeping these steps separate means that a model error can cause a wrong choice but cannot cause an unauthorized action.

Calibrated probabilities decide when the model acts and when it defers

A score of 0.9 is useful only if about 90% of such picks are right. scikit-learn's calibration guide defines a well-calibrated classifier as one whose predict_proba output "can be directly interpreted as a confidence level." The guide plots this with a calibration curve, also called a reliability diagram.

Calibration needs its own data. The scikit-learn guide states that the calibrator should be fit on data that is independent of the training data, or it will push probabilities toward 0 and 1. For a model that is already trained, it shows CalibratedClassifierCV(estimator=FrozenEstimator(estimator)). The guide lists three methods:

  • Use method="sigmoid" for small calibration sets, where Platt's logistic fit is most effective.
  • Use method="isotonic" when you have more than about 1,000 samples, because it overfits on small data.
  • Use method="temperature" to rescale softmax scores over many options with a single fitted parameter.

The threshold is a separate choice. scikit-learn's default binary rule predicts the positive class above 0.5. Its TunedThresholdClassifierCV instead picks the threshold that maximizes a metric that you choose, and FixedThresholdClassifier sets one by hand. For a decision model, choose the threshold that keeps the error rate on automated picks under your limit. Then report coverage, which is the share of requests that the model handles at that threshold.

Held-out evaluation must compare the tuned model with simpler options

Tuning does not guarantee a better model, so measure it before you assume it. A tuned model can score below its own base on the same test.

Build one held-out set from real decisions, and keep it away from training and calibration. Then score these five candidates on it:

  1. Score the tuned model with its calibration applied.
  2. Score the unchanged base model with the same prompt and options.
  3. Score a prompted or frozen baseline, such as a hosted model with instructions.
  4. Score a conventional classifier, such as logistic regression on structured fields.
  5. Score your existing rules.

For each candidate, report false positives and false negatives separately, a calibration curve, and coverage at your chosen error limit. Report whole-task success, such as a resolved ticket, apart from single-decision accuracy, because one correct pick does not finish a task.

Hardware sizing starts from the named model and your workload

Weight storage and runtime memory are different numbers. Hugging Face's accelerate estimate-memory command loads a model on the meta device and reports its size at float32, float16, int8 and int4. Its documentation states that this is the memory "to purely load the model in, not to perform inference," and that inference can add "up to an additional 20%."

For a model on gemma-4-12B-it, which the model card lists at 11.95 billion parameters, bf16 weights take about 23.9 GB. Adding 20% gives about 28.7 GB. That fits on one 40 GB or 80 GB GPU on paper. Long inputs, many candidate options, batching and concurrent requests all add memory beyond that estimate. A model that reads tens of thousands of tokens per decision needs a measured figure, not this rule of thumb.

Before you commit to hardware, measure these on your own workload at your chosen precision, option count, input length and concurrency:

  • Measure peak GPU memory under your highest expected concurrency.
  • Measure throughput in decisions per second.
  • Measure p50 and p95 latency per decision, end to end, retrieval included.
  • Measure total operating cost per 1,000 decisions, including idle hours.

Latency figures from one model or GPU do not carry over to another, so a timing from a compact encoder says nothing about a 12-billion-parameter release.

The endpoint needs access control, versioning, fallback and rollback

vLLM's --api-key option protects only some routes. Its documentation states that the key applies to the /v1, /v2, /inference and /cohere prefixes. Other routes, including /invocations, /score and /generative_scoring, are not authenticated. The documentation advises against relying on --api-key alone and suggests a reverse proxy. Its LoRA guide also warns that runtime adapter loading "should not be used in production unless it is an isolated, fully trusted environment."

A sensible operating setup includes these steps:

  1. Put the server behind a reverse proxy that allowlists only the routes that your application calls, and keep it on a private network.
  2. Version the model, adapter, retriever and calibration map together, so that one release ID identifies all four.
  3. Route every deferred or failed request to a fallback, such as a human queue, the parent LLM or your rules.
  4. Monitor coverage, deferral rate and the error rate on a labelled sample of live traffic.
  5. Keep the previous release loaded so that a rollback is a configuration change.

The right choice depends on whether tuning beats the simpler options on your data

Use an unmodified model when it reaches your error limit at acceptable coverage on the held-out set. You then skip training, adapter management and part of the calibration work.

Choose a smaller model or a conventional classifier when your inputs are mostly structured fields and the options are fixed labels. A classifier is cheaper to serve, and scikit-learn calibrates it directly.

Commission or build a custom model when the tuned candidate beats every simpler option on false negatives, false positives and coverage. Confirm that you will receive the weights, the base-model revision, the retriever and the calibration files. A documented SDK that you run yourself is a different product from a negotiated service that a vendor deploys, so get the terms for each in writing.

Sources

More in Models

All Models →