Register an LLM
POST/llms
Registers a connection to a model server that exposes an OpenAI-compatible API. The endpoint must be an http or https URL with a host and without credentials. Private endpoints are accepted by default; when the API server configuration sets app.allow_private_endpoints to false, the host must resolve to public addresses only. Foundation4 does not contact the model server during registration, so an incorrect endpoint path, model name or API key appears only when the LLM is first used. The API key is optional. Foundation4 encrypts the API key before storage, and no response returns the key.
Permissions. Write on the LLM object type (llms). The key that registers the LLM receives read, write and execute permission on the new LLM.
LLMs describes the fields of a registration and the requirements on the model server.
Request
Responses
- 201
- 400
- 401
- 403
- 409
- 422
The LLM was registered. The body is the new LLM registration, without the API key.
The request is invalid (Invalid parameter), and details.error names the cause: an empty api_key (api_key cannot be empty; leave it out or send null for no key), or an endpoint that is not permitted: a URL that cannot be parsed (Invalid endpoint URL: <reason>), a scheme other than http or https (Endpoint must use the http or https scheme), a URL with credentials (Endpoint must not contain credentials) or, when app.allow_private_endpoints is false, a private, loopback or link-local address (Endpoint host '<host>' is not a public address; ...) or a host that does not resolve (Endpoint host could not be resolved: <reason>). The same status reports a body that is not valid JSON.
The authentication headers are missing or invalid, or the API key is inactive or expired. Errors lists the messages.
The key lacks write permission on the llms object type (Unauthorized: write access to LLM required), the license is not valid (Invalid license: <reason>) or the license limit for LLMs is reached (License limits exceeded for LLM).
Another LLM already has this name (Conflict unique error).
The body does not match the request schema, for example a missing endpoint or an unknown field.