The system control endpoints manage the lifecycle of local TrinaxAI services — Ollama and the RAG API process — and provide an automated self-test for CI/CD and diagnostic workflows. All endpoints on this page are protected.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TrinaxCode/TrinaxAI/llms.txt
Use this file to discover all available pages before exploring further.
All
/system/* endpoints require authorization: either a call from localhost / private LAN (when TRINAXAI_ALLOW_LAN_SYSTEM is not disabled) or an X-Admin-Token header matching the TRINAXAI_ADMIN_TOKEN environment variable. If a token is provided but incorrect, the request is rejected with HTTP 403 regardless of the client IP.Authentication
POST /system/shutdown
Initiate a graceful shutdown of the AI backend (Ollama + RAG API server). The shutdown is delegated toservice_manager.py and runs in a new detached process so the API can return a response before it exits.
Response
Always
true when the shutdown has been initiated.Human-readable status message. Example:
"AI shutdown initiated. The PWA remains available for restart."Example
Response
POST /system/startup
Start Ollama and the RAG API. Invokesservice_manager.py start-ai synchronously (up to 60-second timeout) and returns the result.
Response
true if service_manager.py exited with code 0. false if startup failed.Combined stdout from the service manager script.
Combined stderr from the service manager script. Empty on success.
Example
Response
POST /system/stop-all
Stop all TrinaxAI services immediately — both the AI backend and any supporting processes. Equivalent to a hard stop, not a graceful drain. The request is dispatched toservice_manager.py stop-all in a detached process.
Response
Always
true when stop-all has been initiated.Status message.
Example
Response
POST /system/self-test
Run an automated health check suite covering Ollama connectivity, embedding model functionality, and RAG query execution. Useful for diagnostics from the PWA settings panel, post-deploy CI/CD validation, or troubleshooting a broken installation. The test suite performs four checks in order:- ollama — Calls
GET /api/tagson the configured Ollama instance and checks that at least one model is loaded. - embedding — Calls
get_text_embedding("TrinaxAI system test")on the active embedding model and verifies a non-empty vector is returned. - rag_indexed — Checks whether the in-memory hybrid retriever (
_fusion_retriever) is loaded. - rag_query — If both Ollama and the index are available, runs a minimal retrieval query (
"test") and checks that at least one node is returned.
Response
true only if all four checks passed.Individual check outcomes.
The active
TRINAXAI_PROFILE value (e.g. "16gb", "max", "8gb").Example
All checks passing
Partial failure (index not yet built)