LLM Service
The LLM Service page lets administrators host their own AI models. You browse models on HuggingFace or Ollama, ask a connected model server to pull one, test it, and hand out personal keys so people and apps can call it.
Open the page
Go to Administration → LLM Service (/admin/llm). The menu item shows a small "llm-ready" badge. The page heading is LLM Models, with the subtitle "Search HuggingFace Hub · Deploy to any inference backend · Issue per-user API keys." You need the apex.admin.llm permission.
At the top you see counters such as "N server(s) online" and "N active" (models that are ready, idle or downloading).
The hardware strip
A strip that refreshes every 30 seconds shows free disk, free memory and how much is used, the memory used by the Ollama container, and free graphics memory ("CPU-only" if there is no GPU). It also lists how many models are loaded. Before the first reading: "Hardware metrics not yet collected — available after 30s".
Tabs
Model Catalog, Active (n), Servers (n) and Naming & Order.
Servers
Start here. The Servers (n) tab lists the inference servers TAO can talk to: "Pre-configured inference backends — enable the ones you're running and test connectivity."
| Control | What it does |
|---|---|
| Enable switch | Turns the server on or off |
| Health dot | Shows whether it answers |
| Name, type chip, model count | Identifies it |
| URL | Click to edit, press Enter to save |
| Test | "Healthy!" or "Unhealthy: (reason)" |
| Trash icon | Remove "(name)"? and "This backend server will be removed from the LLM service." |
Click Add custom to add one: Name (for example "My Server"), URL (for example http://ollama:11434) and an Auth header (password field, for example "Bearer …"). Add stays disabled until name and URL are filled. Message: "Server added." TAO works out the server type by itself and stores the auth header encrypted.
If the list is empty: "No servers found / Run database migrations to seed the pre-configured backends."
Model Catalog
| Server type | Model formats it accepts |
|---|---|
| Ollama, llama.cpp, LM Studio | GGUF |
| vLLM | full (safetensors), AWQ, GPTQ |
| TGI | full, AWQ |
| LocalAI | GGUF, full, AWQ |
| Generic OpenAI-compatible | all of these (the model is pre-loaded) |
Find a model
- Pull from Ollama Registry (a collapsible panel linking to ollama.com/search): type a model name such as
llama3.2:8band click Pull. - Search HuggingFace Hub… searches the HuggingFace catalogue. Typing
author/nameworks. Sort by Most downloaded, Most liked, Recently updated or Newest, and filter with the chips All, Text Gen, Embeddings, Vision-LM and Seq2Seq. - A line says which formats match your servers, for example "Showing GGUF · FULL … — matches your connected servers".
- Each card shows the name, author, format, type, downloads and age, plus a status pill if it is already deployed. Load more shows the next 24. If it fails: "Could not reach HuggingFace".
Hub source and token
- Hub source shows the address used (default
https://huggingface.co). The gear icon (Change Hub URL) lets you point to a mirror; message "HuggingFace Hub URL updated". - HF token: "✓ set — gated models (Gemma, Llama…) enabled" or "not set — public models only". The gear icon (Set HF token) opens a password box (
hf_...). Message: "HuggingFace token saved".
Deploy a model
Click a model card
A drawer opens on the right. If the model is already deployed, a green note says "Already deployed as …".
Choose the server
Under Deploy to a connected server, pick a healthy server. With none: "No healthy servers connected. Add one below, then come back to deploy."
Pick a size (Ollama and GGUF models)
Quantization lists each file as "tag — size", with "✓ recommended" on the common good choices (Q4_K_M and Q5_K_M). A Display name defaults to the repository name. A read-only box shows the pull reference.
Set advanced options (optional)
For Ollama only: context length (
num_ctx), temperature, a local name and an editable Modelfile ("(edited)", Reset to auto). Setting any of these creates a customised model instead of a plain pull.Click Deploy
Progress reads "Queued…", "Pulling…", "Downloading…", "Assembling…", "Verifying…", "Warming model…" and "Ready". Failures read "Failed: …", "Stalled — check server connection" or "Cancelled". On success: "Deployed! Go to Settings → APEX Model Keys to create per-user API keys." Click Done.
Special cases: a server that is not Ollama shows "Non-Ollama backend: model must already be loaded on the server. This registers it in APEX." Ollama with a non-GGUF model shows "Ollama only runs GGUF models." and Deploy is disabled.
The drawer also has Set up an inference server, with copy-and-paste setup commands for Ollama, vLLM, TGI, llama.cpp, LM Studio, LocalAI and the HF Inference API (tagged "GPU" or "CPU ok"). Each has + Register when it's running with Name, URL and Auth header (optional), then Connect.
Active models
Active (n) lists deployed models. A Currently loaded in memory panel shows what Ollama has loaded. Empty: "No deployed models / Browse the catalog and deploy a model to get started."
Each card shows the name, a status (ready, idle, pulling, starting, paused, stopped, error or pull failed), a fit badge (Fits, Tight, Exceeds limit, Exceeds RAM or Unknown), the server, the source, and chips for context size, parameters, quantisation and disk size.
| Button | When | What it really does |
|---|---|---|
| Test | ready or idle | Opens Live test chat: type a prompt ("Enter a test prompt…") and see OK or failure, speed and a sample. On a 404 it can suggest the server's real model name. |
| Configure | ready or idle (Ollama) | Model Configuration: Context Length (num_ctx) (more RAM, "Qwen 9B needs ~7GB for 8k"), Temperature, Custom Modelfile. "Overwriting this will replace the entire manifest in Ollama." Apply Changes shows "Model reconfigured and restarted". |
| Sync | most states | Reads the status from the server ("Status synced from backend") |
| Stop | ready or idle | Ollama: unloads the model. Other servers: only changes the status. |
| Pause and Resume | ready, idle, paused | Only change a status flag. Nothing is unloaded. |
| Play icon | stopped | "Starting". Ollama is warmed up; failures are only logged, and the status still becomes ready. |
| Retry Pull | pulling or pull failed | Tries the download again |
| Add to Providers (or Re-sync to Catalog) | ready or idle | Adds the model to the admin AI Providers list so people can pick it in their settings |
| Keys & URL | always | See below |
| Trash icon | always | Delete "(name)"? and "This hosted model will be removed and can no longer be served." Ollama also deletes the downloaded files. |
Keys & URL
Shows two addresses, each with a copy button: an external one (http://(host):(gateway port)/llm/v1/(model id)) and an internal one (http://llm-gateway:8010/llm/v1/(model id)).
To let someone use the model, type a Label (for example "Alice, Team A, App key…") and click Generate Key, then Create. The key appears once: Key "(label)" — copy now, shown once. Only a fingerprint and the last four characters are stored. The API Keys (n) list has Revoke ("Key revoked"). Empty: "No keys yet — generate one to enable access." People then use the address as the base_url under Settings → AI Credentials → Private LLMs (see AI Model Keys).
Naming & Order
A table with Model ID, Type (Custom, Private or Platform), Display name, Sort order and Actions. The banner "Custom display names & ordering" explains: "Lower numbers appear first. Org-hosted custom models default to sort=50 (above external providers)." Leave Sort order as "auto" for default, then Save ("Saved override for (id)") or Reset ("Override cleared").