AI
The apps might want to use AI for different tasks. This is probably not needed from the start, but probably might be wanted by some users quickly. The ai capability would let server Apps ask the Host for example to analyze content or generate a completion through an Instance-configured model provider. The control should remain in the hands of the users and may be restricted by the admin.
The use of AI should be implemented in a responsible way. Nextcloud Ethical AI rating is a nice base for rating AI.
Providers and access
The Instance admin configures one or more providers. A provider may be a remote API or a model running locally on the Host machine. Apps request a capability class, such as chat or analysis; they do not choose arbitrary provider URLs or supply API keys. The effective provider and model are selected through the normal capability configuration and consent layers.
The Host owns provider credentials and all provider connections. Apps never see raw keys or open provider sockets. When a request uses a remote provider, consent must make the data egress clear. Admin policy may require local-only providers or forbid any ai. The capability is the supported way for Apps to use LLM providers. The design discourages putting provider keys on http_out, but does not require a domain blocklist for every LLM service.
There are a lot of smaller, specialized models, so the Apps should be able to pick the specialization they need for a task. Some maybe can even run in the browser. How exactly specialized AI models can be addressed correctly while keeping the API consistent has to be figured out.
Possible cases that might should be considered are:
- LLM (give text to get text)
- audio transcription (in the browser?)
- reading text as audio (in the browser?) Maybe use Web Speech API instead or provide it as additional voice for that.
- generating images
- classifying images
- replace background of an image (in the browser?)
- other image manipulation
- classify text (for example find PII data) (in the browser?)
- do tool calls (in the browser?)
Requests and history
An App supplies the task prompt and structured inputs. The Host may add Instance or policy system instructions, and may include App-declared system text when allowed by consent. The Host should avoid including secrets in prompts where feasible.
History is ephemeral by default: a request is a single call, though an App may include prior turns in its input. Apps that need durable transcripts can store them in their own Datasets. Host-stored chat threads are deferred.
The initial API is text in and text out. The Host may support streaming tokens. Multimodal inputs and outputs are later work. Rate and size limits, including request and token caps, protect the Instance; exact values are illustrative and must align with App wake limits.
Boundaries and open scope
Client Wasm does not call providers. Models run on the server through the Host, whether locally on the Host machine or at a remote endpoint. The Host does not provide a full agent or tool-calling platform.