Inference API

OpenAI-compatible inference under /v1. Auth is an org API key (ad_…) in the Authorization: Bearer header. The standard OpenAI SDKs work with base_url set to https://lorivo.dev/v1.

Model ids

  • qwen3-4b: the base model.
  • qwen3-4b:<adapter>: an adapter from your org. Only adapters with status LOADED resolve; anything else returns 404 Unknown model.

Adapters are namespaced by org: two orgs can each have an adapter called my-lora and each key sees its own.

GET/v1/models

Lists the base model plus your org's loaded adapters.

curl https://lorivo.dev/v1/models \
-H "Authorization: Bearer ad_…"
response
{
"object": "list",
"data": [
{ "id": "qwen3-4b", "object": "model", "owned_by": "adapters" },
{ "id": "qwen3-4b:my-lora", "object": "model", "owned_by": "acme-ai" }
]
}

POST/v1/chat/completions

OpenAI-compatible chat completions. Supports streaming (stream: true → SSE) and the usual chat parameters (messages, max_tokens, temperature, …).

curl https://lorivo.dev/v1/chat/completions \
-H "Authorization: Bearer ad_…" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-4b:my-lora",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'
response (non-streaming)
{
"id": "chatcmpl-…",
"object": "chat.completion",
"model": "qwen3-4b:my-lora",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21 }
}

POST/v1/completions

OpenAI-compatible text completions (legacy endpoint), same auth and model rules.

curl https://lorivo.dev/v1/completions \
-H "Authorization: Bearer ad_…" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-4b:my-lora",
"prompt": "Summarize the plot of Dune.",
"max_tokens": 128
}'

POST/v1/responses

OpenAI-compatible Responses API. Supports streaming; usage is reported in the closing response.completed SSE event.

curl https://lorivo.dev/v1/responses \
-H "Authorization: Bearer ad_…" \
-H "Content-Type: application/json" \
-d '{"model":"qwen3-4b:my-lora","input":"Hello!","stream":true}'

Streaming

All three completion endpoints stream server-sent events when stream: true. Use curl -N to see events as they arrive.

Usage and limits

  • Every request is logged against your org (prompt + completion tokens); it shows up on the /usage dashboard page.
  • Request bodies are capped at 16 MiB.
  • If a node restart drops a warm adapter, the first request self-heals by reloading it and retrying once.

Common errors

StatusMeaning
401Missing, invalid, or revoked API key
404Unknown model: the adapter does not exist in your org or is not LOADED
413Request body over the 16 MiB limit
502The GPU node could not serve the request