Import from a provider
Register many models at once, from the catalog of any OpenAI-compatible server or from an obleth-models file.
3 min readUpdated for v2.4.0Edit on GitHub
GET /models, or an exported models fileImport from a provider
- 1
Connect
Enter the provider's API base URL and an optional API key, then Fetch models. obleth reads
GET {base}/modelsfrom the gateway, so the key never reaches your browser. A 404 usually means the base should gain or drop its/v1. - 2
Select
Every model the provider serves is listed. New ones are selected; ones you already have are hidden behind Show N already imported and can't be picked. Set the defaults for every model (type, context window, input and output cost per token), then change each row's name or type where you need to.
- 3
Review
Review import shows each model as it would be created, with any problem for every model at once, such as an alias already taken. Confirm to create them.
Imported models point at the provider's base URL and ID and carry the key you gave. Like a model added by hand, each is created switched off and turns on when its first health check passes; the result says which came on and why the others stayed off. Run the import again later and only new models are offered.
Names and formats
Each provider ID becomes a suggested name: lowercase, with anything outside a-z 0-9 . - turned into dashes. A trailing format token (fp8, bf16, fp16, mxfp4, nvfp4, int8, int4, awq, gptq, gguf) moves into the model's quantization, and the full name becomes an alias, so callers of the provider's spelling keep working:
| Provider ID | Name | Quantization | Alias |
|---|---|---|---|
Qwen3-8B-FP8 | qwen3-8b | fp8 | qwen3-8b-fp8 |
Qwen/Qwen3-8B-FP8 | qwen-qwen3-8b | fp8 | qwen-qwen3-8b-fp8 |
fp8 | fp8 | unknown | none |
The model's upstream model is the provider's ID, unchanged. Two selected models that end up with the same name are refused until you rename one.
A provider model counts as already imported when one of your models has its name (with or without the format suffix), or has the same base URL and upstream ID. That second check keeps a model you renamed after importing it from being offered again.
What the catalog request accepts
- The base URL must be
httporhttps. A host that resolves to a link-local or cloud-metadata address is refused. - The key is sent as a bearer token. A 401 or 403 is reported as a rejected key.
- The request times out after 5 seconds and doesn't follow redirects; enter the final URL instead.
- The answer can be the OpenAI
{"object": "list", "data": [...]}shape or a bare array. Entries without anidare skipped, and the rest are deduplicated and sorted.
Import a file
Import or export on Models writes models to an obleth-models manifest and reads one back, on the same gateway or another. Use it to keep models in a repository or copy them between gateways. Import a file shows what would be created and changed before anything is written. A manifest is not a backup: for a whole-gateway copy, see Backup and restore.
curl -s http://localhost:9180/api/v1/models/export \
-H "Authorization: Bearer $TOKEN" > obleth-models.json
# Preview without writing, then apply
curl -s -X POST "http://localhost:9180/api/v1/models/import?dry_run=true" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
--data @obleth-models.json
curl -s -X POST http://localhost:9180/api/v1/models/import \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
--data @obleth-models.json
format: obleth-models
version: 1
models:
- model_name: glm-5-3
aliases: [glm-5-3-mxfp4]
upstream_model: zai-org/GLM-5.3-MXFP4
api_base: https://inference.example.com/v1
quantization: mxfp4
context_window: 131072
tags: [coding, "reasoning:3"]
endpoints:
- name: primary
api_base: https://inference.example.com/v1
priority: 100
weight: 100
# A sparse entry changes only what it names.
- model_name: qwen3-embedding-8b
tags: [general]
Models are matched by model_name: an existing name is updated and a new one created. Every other field is optional, and a field left out is left unchanged. Import never deletes a model or an endpoint; endpoints are matched by name. Unlike a provider import, a model the file adds takes the on or off state the file gives it (on when the file doesn't say).
Manifest rules
- Secrets. Export writes
has_api_keyandupstream_header_names, never the key or header values, so a manifest is safe to commit. Both are ignored on import. An import may setapi_keyandupstream_headers; an emptyapi_keyclears the key. - Validation. The whole file is checked first, and every problem is reported in one answer; any error rejects the file. Rejected: an unknown type, quantization, capacity mode or endpoint selection; a negative cost or routing bias; an endpoint without an API base; a model or endpoint listed twice; an alias another model holds; a URL the outbound URL policy blocks. Unknown tags and boons are dropped with a warning.
- Not in the file. Health settings and runtime state.
max_in_flight,request_timeout_secs,per_replica_max_in_flightand an endpoint'smax_in_flightcan't be cleared from a manifest; clear them on the model's page. - Formats. The API takes JSON with
format: obleth-modelsandversion: 1. The dashboard also takes YAML and a baremodels:list. Export and import are recorded in the audit log.
