DocsRun on your hardware
Serve your own adapter
Load a LoRA adapter you trained on the base, give it its own temperatures, check that the server serves it, and know what it does to certificates.
Answer a question with your own fine-tuned adapter or with the base, on one server, by naming the adapter in the request. You need a vLLM-format LoRA adapter trained on the base, its temperature file, and a GPU server.
Start the server with the adapter, then name it in the request:
pip install "decisio[serve]==0.60.0"python -m decisio.serve.vllm_engine --adapter my-adapter=/models/my-adapter \ --adapter-temperatures my-adapter=decisio_adapter.json --images onNeeds Linux with one NVIDIA card and a LoRA adapter.
curl -s http://127.0.0.1:8000/v1/systemone -H 'Content-Type: application/json' -d '{ "state": "I was charged twice for the same order.", "adapter": "my-adapter", "questions": {"refund": {"type": "noul", "instructions": "Does the customer want a refund?"}}}' -D - -o answer.json | grep -i '^x-decisio-adapter'Needs a server with an adapter loaded, on one NVIDIA card.
What does the start do?
Section titled “What does the start do?”Start the server with --adapter name=path, once per adapter, and the adapter’s temperature file.
- The adapter is a vLLM-format LoRA adapter, served unmerged, on the text route, in separate mode.
- A Mac does not serve adapters.
- A request uses the adapter only when it names it; every other request is answered by the base.
- The server serves the prompt layout the adapter’s file records, and plain when it records none: no adapter was measured under the header layout. Adapters that record different layouts cannot share a server.
Give it its own temperatures
Section titled “Give it its own temperatures”- Put the file beside the adapter’s weights as
decisio_adapter.json, or give it with--adapter-temperatures name=filewhen the adapter’s folder is not yours to change. temperatureshas one per type:choice,noulfor yes/no, andscore. A type the file does not list keeps the base’s temperature.choice_bandsis optional: keyslo-hi, within 2 to 255 and not overlapping. A choice question is served at its band’s temperature; a count in no band is served attemperatures.choice, then at the base’s.- Yes/no and score questions are not banded.
- An adapter with no file is served at the base’s temperatures, and the server says so when it starts.
The file is checked before the engine is built, and an unusable one stops the start. This writes decisio’s example file and has decisio check it, on any machine:
cat > decisio_adapter.json <<'EOF'{"schema": "decisio.adapter/1", "temperatures": {"choice": 2.141, "noul": 3.075, "score": 4.185}, "choice_bands": {"2-10": 1.9, "11-26": 2.6, "27-255": 3.1}}EOFuv run python -m decisio.serve.adapter_temperatures check decisio_adapter.json{
"temperatures": {
"choice": 2.141,
"noul": 3.075,
"score": 4.185
},
"choice_bands": {
"2-10": 1.9,
"11-26": 2.6,
"27-255": 3.1
},
"think_temperatures": {},
"layout": null,
"fit": null,
"file": "decisio_adapter.json"
}Fit a temperature file when you need to create one
Use labelled readouts from the adapter under the layout you will serve:
python -m decisio.serve.adapter_temperatures fit --reads reads.jsonl \ --out decisio_adapter.json \ --data "what the items are"Needs your adapter's readouts on your labelled items.
Fit on items that are not a benchmark’s: a temperature holds for the kind of items it was fitted on.
Fit on readouts taken under the layout you serve, and give --layout to the fit so the file records it.
What comes back
Section titled “What comes back”The request above names the adapter in its adapter field.
- The answer carries
"adapter"and thex-decisio-adapterheader when the adapter answered. - An unknown name is answered 404, with the adapters that are loaded.
Check that it took
Section titled “Check that it took”curl -s http://127.0.0.1:8000/health \ | python3 -c 'import json, sys; h = json.load(sys.stdin); print(json.dumps({k: h.get(k) for k in ("adapter_temperatures", "adapter_identity")}, indent=1))'Needs a server with an adapter loaded, on one NVIDIA card.
/health shows each adapter’s temperatures in adapter_temperatures, and the hash of its weights and configuration in adapter_identity.
Answer requests that name no adapter
Section titled “Answer requests that name no adapter”--default-adapter NAME makes a loaded adapter answer every request that names none, for a client that cannot send an adapter field.
- A request with no
adapterfield is answered by the default adapter at its own temperatures, and the response’sadapterfield says so. - A request that names another loaded adapter gets that one, and
"adapter": "none"gets the base model. - Tasks still read the base model: ask a registered task’s questions with
"adapter": "none". - The default is part of what a certificate covers:
/healthshows it, and a certificate made under another default is suspended.
What does an adapter do to certificates?
Section titled “What does an adapter do to certificates?”Requests answered by an adapter are never certified. A request combining an adapter with a question matched by a registered task is refused; use the base model for that task.
Loaded adapter settings are part of the serving setup recorded by a base task’s certificate. After loading, retraining or changing an adapter, certify affected base tasks again on the resulting setup.
What next
Section titled “What next”- Server flags:
--adapterand--adapter-temperaturesin full. - The HTTP API: the
adapterfield and its errors. - Certify answers: certify a task again on the new setup.