Skip to content

Deploy & call

A fine-tune from turion train is private and not deployed. Deploying it makes it answer on POST https://api.turion.ai/v1/chat/completions as model: "<handle>/<name>", with OpenAI request and response shapes.

Terminal window
turion deploy acme/support-v3
# deployed acme/support-v3@v1
# replicas 0-1 (scales to zero when idle)
# keep-alive 300s
#
# try it: turion chat acme/support-v3 "hello"
# OpenAI: base_url=https://api.turion.ai/v1 model=acme/support-v3

In the workspace: turion.ai/members/models lists your models. A fine-tune’s page deploys and undeploys it, sets its replicas and keep-alive, and has a chat playground, code to call it and its recent calls.

OptionFirst deployMeaning
--min-replicas0replicas kept warm even when idle. 0 is scale to zero
--max-replicas1the most replicas the model scales to, up to 100. Stored as given; your account’s replica quota caps it while the model runs
--keep-alive300seconds an idle replica stays warm after its last call, 0–86,400

Running turion deploy again on a deployed model changes only the options you pass; the others keep their values, and there is no separate update command. The options apply to the model’s newest version. --min and --max still work as short names.

The replica quota is applied when the model scales, not when you deploy, so when your quota goes up the model can use it without being deployed again; deploy tells you when the quota currently caps --max-replicas.

Only fine-tuned LLMs, decision models and extract models deploy this way; anything else is refused with 422 not_deployable. A decision model answers on POST /v1/systemone (turion decide) instead of the chat endpoint, and an extract model on POST /v1/extract (turion extract). A directory that contains a cog.yaml is handed to turion cog deploy.

Terminal window
turion undeploy acme/support-v3
# undeployed acme/support-v3 — `turion deploy acme/support-v3` brings it back

Undeploying keeps the model and its weights. Calls answer 409 model_not_deployed until you deploy it again, and a replica that is still warm shuts down when its keep-alive runs out.

From Python, client.models.deploy("acme/support-v3", min_replicas=1) (only the arguments you pass change) or job.deploy() on a finished TrainingJob. Over REST, POST /v1/models/{slug}/deploy with any of {"min_replicas", "max_replicas", "keep_alive_s"}; see REST API → Deploy.

A base from turion bases can be served as it is, with no training run. It becomes a model of yours, <handle>/<name>, deployed like a fine-tune: the same endpoint, scale to zero, replicas and keep-alive.

Terminal window
turion deploy --base gemma-4-e4b
# deployed acme/gemma-4-e4b@v1
# replicas 0-1 (scales to zero when idle)
# keep-alive 300s
#
# try it: turion chat acme/gemma-4-e4b "hello"
# OpenAI: base_url=https://api.turion.ai/v1 model=acme/gemma-4-e4b
OptionDefaultMeaning
--namethe base idthe model’s name; dots become dashes, so qwen3.8-27b is acme/qwen3-8-27b
--fleetturiona fleet you own to run it on instead of the shared pool
--min-replicas, --max-replicas, --keep-alive0, 1, 300as for a fine-tune, above

What to expect:

  • The model serves the base’s weights at the Hugging Face commit that was current when you first deployed it. Deploying again does not move it to newer weights; deploy under another --name for that.
  • Running turion deploy --base again with the same name redeploys that model and changes only the options you pass. turion deploy acme/gemma-4-e4b and turion undeploy work on it as on any fine-tune.
  • A name that any other model uses (a fine-tune, an image model, a deploy of another base) is refused with 409 name_taken.
  • The context window and tool calls are those of a fine-tune of the same base: up to 32,768 tokens, and parsed tool_calls for every base in the catalog.
  • Only bases with a serving size in the catalog deploy. The teachers used for distillation are refused with 422 base_not_deployable.
  • An extract base (turion-extract-alpha) becomes an extract model, which answers on POST /v1/extract instead of the chat endpoint, and serves the commit the catalog pins; see Extract models.
  • The decision base (turion-jev-31b) becomes a decision model, which answers on POST /v1/systemone (turion decide), serves the commit the catalog pins in FP8 with prompts up to 16,320 tokens on 52 GB, and takes one request at a time; see Turion Jev 31B. Its fine-tunes from turion train are chat models, as for any base.
  • If the API answers 503 not_configured, deploying bases is not enabled on that deployment yet.

The model’s page in the workspace says “Base model, deployed without training” and links the base. In the workspace, Models → New → Deploy a base model opens the same deploy, and so does Deploy next to a base on Base models.

From Python, client.bases.deploy("gemma-4-e4b", name="support") returns the same Deployment as client.models.deploy. Over REST, POST /v1/bases/{base}/deploy; see REST API → Deploy a base model.

With --min-replicas 0 nothing runs while the model is idle and nothing is billed for it. The first call after an idle period starts a replica, which then stays warm for --keep-alive seconds after the last call. When requests keep queueing, Turion adds replicas up to --max-replicas; scaling follows sustained queue depth, not single spikes. See Autoscaling replicas.

Each replica of a fine-tune runs at most 16 requests at once (its concurrency_limit), so two warm replicas take 32. Further requests wait in the queue until one finishes, and a queue that stays long adds replicas up to --max-replicas. turion model set acme/support-v3 --concurrency 32 raises the limit, and --cold-start-target holds a replica warm while measured cold starts are slower than the target (Cold starts).

A replica starting from zero has to:

  1. pull the serving image (vLLM) on the node,
  2. download the base model’s weights, or reuse them from the node’s cache,
  3. download your adapter (a few MB for LoRA, GBs for a full fine-tune; none for a base deployed as is), also cached per node,
  4. load everything into vLLM.

On a node that has served the base before, that is mostly step 4. On a fresh node and a large base it can take several minutes. What the caller sees:

  • A non-streaming call gets no bytes until its answer, and the proxy in front of api.turion.ai stops waiting after 100 to 120 seconds: a cold start that takes longer ends the call with 524. The API’s own wait is 180 seconds; when it runs out first, the call gets 504 garden_timeout. Either way the replica keeps starting, and a call once it is ready succeeds. A 504 carries x-should-retry: false, so the OpenAI SDKs do not retry it; a 524 has no such header, so they resend it (twice by default), and each resend waits again.
  • A streaming call (stream: true) waits up to 10 minutes. Until the first token, the stream sends an SSE comment line, : keep-alive, every 15 seconds, so a proxy’s idle timeout does not cut it. The OpenAI SDKs skip comment lines; if you read the stream yourself, ignore lines that start with :.

Closing the connection cancels the call, streamed or not, and its trace records it as cancelled.

turion model logs acme/support-v3 --follow prints the replica’s cold-start phases and its container output, and keeps polling until the replica is ready. The Logs card on the model’s page in the workspace shows the same.

If you cannot tolerate the first-call delay, keep a replica warm with turion deploy MODEL --min-replicas 1, and pay for it as warm capacity (below). Before a batch of non-streaming calls from your own code, wake a scaled-to-zero model with one streamed call (turion chat MODEL "ping") so the batch does not run into the proxy’s limit while the replica loads. turion eval sends the first case alone and asks again on 504 garden_timeout while the model starts, but a 524 fails that case, so wake the model before an eval too.

The endpoint takes your Turion tk_ key as a bearer token, like every other API call. The body is an OpenAI chat-completions request and is passed to the model as sent, so temperature, max_tokens, tools, response_format and the rest work as far as vLLM supports them.

Terminal window
curl https://api.turion.ai/v1/chat/completions \
-H "Authorization: Bearer $TURION_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "acme/support-v3",
"messages": [{"role": "user", "content": "How do I rotate an API key?"}],
"max_tokens": 200
}'

The answer is a chat.completion object (choices[0].message, usage). Every traced response carries an X-Turion-Trace-Id header naming its trace.

A fine-tune serves a context window of up to 32,768 tokens, or the base model’s own limit if that is smaller.

The same model field also reaches provider models with your own key (openai/gpt-6.1-sol) and the model garden; Providers & traces explains how a model name is resolved.

A fine-tune returns tool calls the OpenAI way, in choices[0].message.tool_calls with finish_reason: "tool_calls": its serving parses the tool-call syntax of its base’s chat template. Every trainable base in the catalog has a parser (Gemma 4, Qwen, Ministral, Nemotron and Muse Glimmer), and GET /v1/bases shows it as tool_calls: true. A fine-tune of an hf: base that is not in the catalog has none, and a request that sends it tools gets a 400 from the model server. The parser is set when the training job registers the fine-tune, so a fine-tune trained before its base had one keeps serving without it; train it again to get parsed tool calls.

For the fine-tune to call your tools well, train it on examples with tools and tool_calls (Datasets → Chat).

"stream": true answers text/event-stream with OpenAI chat.completion.chunk frames and ends with data: [DONE]. Send "stream_options": {"include_usage": true} to also get a last chunk with usage and an empty choices list, as below.

data: {"id":"chatcmpl-…","object":"chat.completion.chunk","model":"acme/support-v3","choices":[{"index":0,"delta":{"role":"assistant","content":"Create"}}]}
data: {"id":"chatcmpl-…","object":"chat.completion.chunk","model":"acme/support-v3","choices":[{"index":0,"delta":{"content":" the new key first"}}]}
data: {"id":"chatcmpl-…","object":"chat.completion.chunk","model":"acme/support-v3","choices":[],"usage":{"prompt_tokens":14,"completion_tokens":21,"total_tokens":35}}
data: [DONE]

Once a stream has started the status is already 200, so a later failure arrives as a frame of the form data: {"error": {"message", "type", "code", …}}, followed by [DONE]. Treat it as the end of the reply. The OpenAI SDKs raise on it.

An OpenAI client listing models (client.models.list()) gets the OpenAI list shape: every model id you can call that Turion serves, meaning your deployed fine-tunes and the garden models. Provider models are not listed. The negotiation is automatic for the OpenAI SDKs, which send an X-Stainless-Lang header; any other client asks with ?format=openai.

Terminal window
curl "https://api.turion.ai/v1/models?format=openai" \
-H "Authorization: Bearer $TURION_API_TOKEN"
# {"object": "list", "data": [{"id": "acme/support-v3", "object": "model", "created": 1791446400, "owned_by": "acme"}, …]}

Without either, GET /v1/models returns Turion’s own model list, as turion model list uses it.

Errors on this endpoint use the OpenAI error shape, so the OpenAI SDKs raise their usual exception classes:

{"error": {"message": "The model `acme/support-v3` is not deployed. Deploy it first: `turion deploy acme/support-v3`.", "type": "invalid_request_error", "param": null, "code": "model_not_deployed", "details": {"model": "acme/support-v3", "hint": "turion deploy acme/support-v3"}}}
StatuscodeMeaning
400invalid_requestthe body is malformed: no string model, an empty or malformed messages list, or a max_tokens below 1. param names the field. Refused before a replica is started
400invalid_request, or the model server’s own codethe model server refused the request before generating, for example a prompt longer than the context window. The message is the model server’s, and details.source is "model"
400provider_key_invalida provider rejected the key you stored for it (its 401 or 403); store a working one with turion providers set PROVIDER
401unauthorizedmissing or invalid tk_ key
404model_not_foundno model by that name that you can call
409model_not_deployedyour fine-tune exists but is not deployed
413request_too_largethe body is over 10 MB; send images by URL instead of inline
429quota_exceededan account quota is used up; each call to a fine-tune counts as one of your jobs and model calls in flight (quotas)
502garden_upstreamthe model server failed on this request
503not_configuredthe platform could not serve the call; retry
504garden_timeoutno answer within the wait, and the message says how long that was; see cold starts
524none: the body is the proxy’s page, not this shapea non-streaming call got no answer for 100 to 120 seconds, usually a cold start, and the proxy in front of the API stopped waiting. The replica keeps starting; call again once it is ready (cold starts)

The garden_ prefix is a historical name: garden_upstream and garden_timeout apply to every model that runs on Turion GPUs, your fine-tunes included.

Every error response carries an X-Turion-Trace-Id header too, unless tracing is off for the call, and an x-request-id with the same value (every API response has one). When you email hello@turion.ai about a failed call, include that id: it finds the request, the response and the timings. With the OpenAI Python SDK it is on the exception:

import openai
try:
reply = client.chat.completions.create(
model="acme/support-v3",
messages=[{"role": "user", "content": "How do I rotate an API key?"}],
)
except openai.APIStatusError as e:
print(e.status_code, e.response.headers.get("x-turion-trace-id"))

Every OpenAI-compatible client works with two changes: the base URL https://api.turion.ai/v1 and your tk_ key. Turion serves the Chat Completions API only: /v1/responses, /v1/embeddings and /v1/completions answer 404 unsupported_endpoint.

import os
from openai import OpenAI
client = OpenAI(base_url="https://api.turion.ai/v1", api_key=os.environ["TURION_API_TOKEN"])
reply = client.chat.completions.create(
model="acme/support-v3",
messages=[{"role": "user", "content": "How do I rotate an API key?"}],
)
print(reply.choices[0].message.content)
stream = client.chat.completions.create(
model="acme/support-v3",
messages=[{"role": "user", "content": "How do I rotate an API key?"}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)

Turion’s own headers go in extra_headers, for example extra_headers={"X-Turion-Run": "ticket-4417"} to group calls in your traces.

import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.turion.ai/v1",
apiKey: process.env.TURION_API_TOKEN,
});
const reply = await client.chat.completions.create({
model: "acme/support-v3",
messages: [{ role: "user", content: "How do I rotate an API key?" }],
});
console.log(reply.choices[0].message.content);

Use .chat(...): the provider’s default model call goes to the Responses API, which Turion does not serve.

import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";
const turion = createOpenAI({
baseURL: "https://api.turion.ai/v1",
apiKey: process.env.TURION_API_TOKEN,
});
const { text } = await generateText({
model: turion.chat("acme/support-v3"),
prompt: "How do I rotate an API key?",
});
import os
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="acme/support-v3",
base_url="https://api.turion.ai/v1",
api_key=os.environ["TURION_API_TOKEN"],
)
print(llm.invoke("How do I rotate an API key?").content)

The openai/ prefix tells LiteLLM to treat the endpoint as OpenAI-compatible; it sends the rest, acme/support-v3, as the model name.

import os
import litellm
reply = litellm.completion(
model="openai/acme/support-v3",
api_base="https://api.turion.ai/v1",
api_key=os.environ["TURION_API_TOKEN"],
messages=[{"role": "user", "content": "How do I rotate an API key?"}],
)
Terminal window
# streams the reply; without a prompt it opens a session
turion chat acme/support-v3 "How do I rotate an API key?"
import turion
client = turion.Client()
reply = client.chat.completions.create(
"acme/support-v3", [{"role": "user", "content": "How do I rotate an API key?"}]
)
print(reply["choices"][0]["message"]["content"])
with client.chat.completions.create("acme/support-v3", messages, stream=True) as stream:
for text in stream.text():
print(text, end="", flush=True)

The Turion SDK’s chat call returns plain dicts in the OpenAI shape. It takes agent=, run=, step= and trace=False for trace attribution, and a non-streamed reply carries the call’s trace id as reply["_turion"]["trace_id"] (stream.trace_id when streaming).

A deployed model is billed for the time its replicas are up, as slot GPU-seconds at the inference rate. Each replica counts from the moment it has loaded until it stops. The calls it answers in that time are covered and not billed again: each GPU-second is counted once.

A cold start comes before that: the seconds a replica spends loading the model are billed as run GPU-seconds on the call that started it. Pulling the image, when a node needs to, is not billed.

  • Scale to zero (--min-replicas 0, the default) costs nothing while no replica is up. A call that finds none starts one, which is billed for its loading time and then until its keep-alive runs out after the last call.
  • Warm replicas (--min-replicas 1 or more) are billed around the clock, whether or not they get calls.
  • Extra replicas the autoscaler adds under load are each billed the same way, up to --max-replicas.

A worked example, for turion deploy acme/support-v3 with the default options: scale to zero, and a keep-alive of 300 seconds.

TimeWhat happensBilled as
10:00:00a call arrives; no replica is up, so one starts loading (a cold start)run, on this call
10:01:30the replica has loaded and answers the callslot starts
10:01:30 – 10:04:0040 more calls; the last one is answered at 10:04:00slot
10:09:00300 seconds without a call: keep-alive runs out and the replica stopsslot ends

Loading took 90 seconds and the replica was then up for 450, so the bill is 540 GPU-seconds (90 run and 450 slot), $0.27 at the list rate. The other 40 calls add nothing. A call at 10:08:00 would have restarted the keep-alive and moved the stop to 10:13:00. The same model deployed with --min-replicas 1 is billed for every second: 86,400 GPU-seconds a day, $43.20.

turion usage counts a replica’s slot time while it is still up, a few seconds behind, and the monthly allowance counts it the same way. Prices and the free allowance are in Usage & billing.