-
Notifications
You must be signed in to change notification settings - Fork 1
API Reference
Version: 1.5.0-dev
Last Updated: 2026-04-06
Complete REST API reference for the LoRA (Low-Rank Adaptation) framework in ThemisDB.
Default base URL:
http://localhost:8080
π Port Reference: ThemisDB uses different ports depending on deployment platform. See docs/de/deployment/PORT_REFERENCE.md for complete mapping.
Default Ports:
-
8080- HTTP/REST API (this documentation) -
18765- Binary Wire Protocol/gRPC -
4318- OpenTelemetry/Prometheus metrics
- Authentication
- Model Management
- Adapter Management
- Adapter Lifecycle
- Inference
- Monitoring
- Error Handling
- Rate Limiting
All API endpoints require JWT Bearer Token authentication.
Authorization: Bearer <your-jwt-token>
Content-Type: application/jsonContact your ThemisDB administrator to obtain a JWT token. Tokens include user information and permissions.
Register a new LLM model in the system.
Endpoint: POST /api/v1/llm/models
Request:
{
"model_id": "llama-2-7b",
"architecture": "llama",
"parameter_count": 7000000000,
"quantization": "Q4_K_M",
"gguf_path": "/models/llama-2-7b-Q4.gguf",
"description": "Llama 2 7B model with Q4 quantization",
"metadata": {
"context_length": 4096,
"vocab_size": 32000
}
}Response: 201 Created
{
"model_id": "llama-2-7b",
"status": "registered",
"timestamp": "2026-01-11T14:00:00Z"
}cURL Example:
curl -X POST http://localhost:8080/api/v1/llm/models \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model_id": "llama-2-7b",
"architecture": "llama",
"parameter_count": 7000000000,
"quantization": "Q4_K_M",
"gguf_path": "/models/llama-2-7b-Q4.gguf"
}'Retrieve details about a specific model.
Endpoint: GET /api/v1/llm/models/{model_id}
Response: 200 OK
{
"model_id": "llama-2-7b",
"architecture": "llama",
"parameter_count": 7000000000,
"created_at": "2026-01-11T14:00:00Z",
"metadata": {}
}cURL Example:
curl -X GET http://localhost:8080/api/v1/llm/models/llama-2-7b \
-H "Authorization: Bearer $TOKEN"List all registered models with optional filters.
Endpoint: GET /api/v1/llm/models
Query Parameters:
-
architecture(optional): Filter by architecture -
limit(optional, default: 10): Maximum results -
offset(optional, default: 0): Pagination offset
Response: 200 OK
{
"models": [
{
"model_id": "llama-2-7b",
"architecture": "llama",
"parameter_count": 7000000000
}
],
"total": 42,
"limit": 10,
"offset": 0
}cURL Example:
curl -X GET "http://localhost:8080/api/v1/llm/models?architecture=llama&limit=10" \
-H "Authorization: Bearer $TOKEN"Delete a model from the registry.
Endpoint: DELETE /api/v1/llm/models/{model_id}
Response: 204 No Content
cURL Example:
curl -X DELETE http://localhost:8080/api/v1/llm/models/llama-2-7b \
-H "Authorization: Bearer $TOKEN"Create a new LoRA adapter through training.
Endpoint: POST /api/v1/llm/lora/adapters
Request:
{
"adapter_id": "themis_help_lora",
"base_model": "llama-2-7b",
"task": "documentation_qa",
"rank": 8,
"alpha": 16,
"training_data": {
"dataset_id": "docs_v1",
"samples": 10000
},
"description": "Documentation Q&A adapter"
}Response: 201 Created
{
"adapter_id": "themis_help_lora",
"version": "v1.0",
"status": "training",
"job_id": "job_123"
}cURL Example:
curl -X POST http://localhost:8080/api/v1/llm/lora/adapters \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"adapter_id": "themis_help_lora",
"base_model": "llama-2-7b",
"task": "documentation_qa",
"rank": 8,
"alpha": 16,
"training_data": {
"dataset_id": "docs_v1",
"samples": 10000
}
}'Retrieve details about a specific adapter.
Endpoint: GET /api/v1/llm/lora/adapters/{adapter_id}
Response: 200 OK
{
"adapter_id": "themis_help_lora",
"base_model": "llama-2-7b",
"version": "v1.0",
"status": "ready",
"metrics": {
"validation_accuracy": 0.92,
"training_loss": 0.15
},
"created_at": "2026-01-11T14:30:00Z"
}cURL Example:
curl -X GET http://localhost:8080/api/v1/llm/lora/adapters/themis_help_lora \
-H "Authorization: Bearer $TOKEN"Update an adapter with additional training data.
Endpoint: PUT /api/v1/llm/lora/adapters/{adapter_id}
Request:
{
"additional_training_data": {
"dataset_id": "feedback_v1",
"samples": 500
}
}Response: 200 OK
{
"adapter_id": "themis_help_lora",
"version": "v1.1",
"status": "training",
"job_id": "job_124"
}cURL Example:
curl -X PUT http://localhost:8080/api/v1/llm/lora/adapters/themis_help_lora \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"additional_training_data": {
"dataset_id": "feedback_v1",
"samples": 500
}
}'Delete an adapter and optionally all its versions.
Endpoint: DELETE /api/v1/llm/lora/adapters/{adapter_id}
Query Parameters:
-
version(optional): Specific version to delete (omit to delete all)
Response: 204 No Content
cURL Example:
# Delete specific version
curl -X DELETE "http://localhost:8080/api/v1/llm/lora/adapters/themis_help_lora?version=v1.0" \
-H "Authorization: Bearer $TOKEN"
# Delete all versions
curl -X DELETE http://localhost:8080/api/v1/llm/lora/adapters/themis_help_lora \
-H "Authorization: Bearer $TOKEN"List all adapters with optional filters.
Endpoint: GET /api/v1/llm/lora/adapters
Query Parameters:
-
base_model(optional): Filter by base model -
status(optional): Filter by status (ready, stored, training) -
limit(optional, default: 10): Maximum results -
offset(optional, default: 0): Pagination offset
Response: 200 OK
{
"adapters": [
{
"adapter_id": "themis_help_lora",
"base_model": "llama-2-7b",
"status": "ready",
"is_loaded": true
}
],
"total": 15,
"limit": 10,
"offset": 0
}cURL Example:
curl -X GET "http://localhost:8080/api/v1/llm/lora/adapters?base_model=llama-2-7b&status=ready" \
-H "Authorization: Bearer $TOKEN"Load an adapter into memory for use.
Endpoint: POST /api/v1/llm/lora/adapters/{adapter_id}/load
Response: 200 OK
{
"adapter_id": "themis_help_lora",
"status": "loaded",
"load_time_ms": 45
}cURL Example:
curl -X POST http://localhost:8080/api/v1/llm/lora/adapters/themis_help_lora/load \
-H "Authorization: Bearer $TOKEN"Unload an adapter from memory.
Endpoint: POST /api/v1/llm/lora/adapters/{adapter_id}/unload
Response: 200 OK
{
"adapter_id": "themis_help_lora",
"status": "unloaded"
}cURL Example:
curl -X POST http://localhost:8080/api/v1/llm/lora/adapters/themis_help_lora/unload \
-H "Authorization: Bearer $TOKEN"Get the current status of an adapter.
Endpoint: GET /api/v1/llm/lora/adapters/{adapter_id}/status
Response: 200 OK
{
"adapter_id": "themis_help_lora",
"is_loaded": true,
"memory_usage_mb": 32,
"last_used": "2026-01-11T15:00:00Z"
}cURL Example:
curl -X GET http://localhost:8080/api/v1/llm/lora/adapters/themis_help_lora/status \
-H "Authorization: Bearer $TOKEN"Execute inference using a LoRA adapter.
Endpoint: POST /api/v1/llm/lora/query
Request:
{
"model_id": "llama-2-7b",
"adapter_id": "themis_help_lora",
"prompt": "How do I enable sharding in ThemisDB?",
"max_tokens": 500,
"temperature": 0.7,
"user_id": "user_42"
}Response: 200 OK
{
"response": "To enable sharding in ThemisDB...",
"model_id": "llama-2-7b",
"adapter_id": "themis_help_lora",
"tokens_used": 145,
"inference_time_ms": 850,
"audit_id": "audit_789"
}cURL Example:
curl -X POST http://localhost:8080/api/v1/llm/lora/query \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model_id": "llama-2-7b",
"adapter_id": "themis_help_lora",
"prompt": "How do I enable sharding in ThemisDB?",
"max_tokens": 500,
"temperature": 0.7
}'Get statistics about the LoRA framework.
Endpoint: GET /api/v1/llm/lora/stats
Response: 200 OK
{
"total_adapters": 15,
"loaded_adapters": 3,
"cache_hit_rate": 0.842,
"total_inferences": 1234567,
"avg_load_time_ms": 450,
"uptime_seconds": 864000
}cURL Example:
curl -X GET http://localhost:8080/api/v1/llm/lora/stats \
-H "Authorization: Bearer $TOKEN"Check the health of the LoRA framework.
Endpoint: GET /api/v1/llm/lora/health
Response: 200 OK
{
"status": "healthy",
"storage": "ok",
"manager": "ok",
"training": "ok",
"checks_passed": 3,
"checks_failed": 0
}cURL Example:
curl -X GET http://localhost:8080/api/v1/llm/lora/health \
-H "Authorization: Bearer $TOKEN"All errors follow RFC 7807 Problem Details for HTTP APIs.
{
"error": "Error message",
"details": "Detailed error information",
"status": 400
}| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing token |
| 404 | Not Found - Resource doesn't exist |
| 500 | Internal Server Error |
| 503 | Service Unavailable - Health check failed |
401 Unauthorized:
{
"error": "Unauthorized",
"details": "Valid Bearer Token required. Include 'Authorization: Bearer <token>' header.",
"status": 401
}404 Not Found:
{
"error": "Adapter not found",
"details": "Unknown adapter_id: invalid_adapter",
"status": 404
}400 Bad Request:
{
"error": "Invalid JSON body",
"status": 400
}Rate limiting is applied per API key/JWT token to ensure fair usage.
Rate limit information is included in response headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1641945600When rate limit is exceeded:
{
"error": "Rate limit exceeded",
"details": "Maximum 1000 requests per hour exceeded",
"status": 429
}Retry-After Header:
Retry-After: 3600List endpoints support pagination via query parameters.
-
limit: Maximum number of results (default: 10, max: 100) -
offset: Number of results to skip (default: 0)
{
"items": [...],
"total": 100,
"limit": 10,
"offset": 0
}# Get first page (items 0-9)
curl "http://localhost:8080/api/v1/llm/lora/adapters?limit=10&offset=0"
# Get second page (items 10-19)
curl "http://localhost:8080/api/v1/llm/lora/adapters?limit=10&offset=10"API uses URL path versioning: /api/v1/...
Future versions will maintain backward compatibility. Deprecated endpoints will include warnings in response headers:
Deprecated: true
Sunset: Sat, 31 Dec 2027 23:59:59 GMT- Always authenticate: Include Bearer token in all requests
- Handle errors: Check status codes and handle errors appropriately
- Use pagination: Don't fetch all results at once
- Cache responses: Use adapter status endpoints to avoid unnecessary loads
- Monitor rate limits: Check rate limit headers and implement backoff
- Async operations: Use job IDs for long-running operations like training
-
Audit logging: Include
user_idin inference requests for audit trails
For issues or questions:
- GitHub Issues: https://github.com/makr-code/ThemisDB/issues
- Documentation: https://github.com/makr-code/ThemisDB/blob/main/README.md
- OpenAPI Spec (Source of Truth):
/docs/openapi.yaml - Generator Config:
openapitools.json
ThemisDB 1.9.0-beta Β· Home Β· Module-Index Β· GitHub Β· Issues
ThemisDB 1.9.0-beta Β· Home Β· Wiki-Index Β· Module-Index Β· FAQ Β· Quick-Reference Β· GitHub Β· Issues Β· Discussions Β· License
- Batch Operations
- Best Practices
- CRUD Tutorial
- Custom Document Ingestion
- Getting Started Tutorial
- Interactive Examples
- Schema Design
- Video Tutorials
- AQL Reference
- AQL Examples
- AQL Overview
- AQL Feature Roadmap
- AQL Geospatial Guide
- AQL LLM Migration Guide
- AQL API
- AQL Grammar (EBNF)
- AQL Root Overview
- AQL Examples (root)
- API Reference
- API Module README
- OpenAPI Overview
- Client SDK Overview
- SDK Overview
- Operations
- Operations Overview
- Operations Runbook
- Operations Handbook
- ThemisCtl Admin Guide
- Pipeline E2E SOPs
- Deploy Overview
- Docker Overview
- Docker Hub README
- Helm Overview
- Packaging Overview
- Operator Overview
- Security Policy
- Production Hardening Checklist
- Security Hardening Guide
- Encryption Key Management
- Access Control Framework
- Zero Trust Policy
- API Authentication & Authorization
- HSM Production Setup
- PKCS11 Integration
- DSGVO / SOC2 Checklist
- Access Model Runbooks
- Access Model Dashboard
- Maturity Automation Runbook
- Access Review Automation
- Access Model Dashboard
- Access Model Runbooks
- Rights Revocation
- Dr Checklists
- Dr Testing
- Incident Response Playbook
- Incident Response Testing
- GPU Oom Recovery
- Grammar Debugging
- Metrics Scrape Troubleshooting
- Model Swap Procedure
- Quota Tuning
- Subagent Deployment
- Logging Configuration
- Content Model
- Crypto & Keys
- Feature Flags Reference
- Modular Architecture Roadmap
- Modularization Guide
- Module Architecture Index
- PostgreSQL Wire Protocol
- Query Scheduling
- Raft Consensus Design
- Resource Pooling
- Source Directory Guide
- Unified Access Model
- E1 001 Layered Retrieval Design
- E1 002 Ann Abstraction Strategy
- E1 003 Tensor Summary Types
- E1 004 Lora Package Distinction
- E1 005 Model Switch Compatibility
- E1 006 Federated Tensor Summaries
- E2 001 Evaluation Framework Design
- E2 002 Hardware Profile Strategy
- E2 003 Query Planner Routing Model
- E2 004 Approximation Governance Rules
- E2 005 Cross Layer Fallback Confidence Policy
- E3 001 Distributed Tensor Design
- E3 002 Manifest Coordination Strategy
- E3 003 Recovery And Erasure Choice
- E3 004 Tensor Fabric Infrastructure
- Contributing
- Contributing (root)
- Code of Conduct
- Support
- Maintainers
- CTest Guide
- Build Quick Reference
- Developer Wiki Index
- Build / Test / CI
- Module Index
- Branching Strategy
- Disabled Stub Policy
- Docs PR Policy
- GA Promotion Sign Off
- Github Milestones Setup
- Maturity Claim Verification Checklist
- Maturity Evidence Registry
- Merge Gate Bot Config
- Merge Gate Status Live
- Phase 1 Closure Report
- Phase Closure Policy
- Phase Dependency Graph
- Phase3 Enforcement Runbook
- Plugin Submodule Rollback
- PR Version Targeting
- PR Version Targeting Backfill
- Production Ready 2026 Delivery Plan
- Query Module Status
- Readme
- Release Promotion Gate Policy
- Release Validation Checklist
- Security Module 5671 Evidence Summary
- Sharding P6 Residual Risk Acceptance
- Sourcecode Compliance Governance
- Updates Development Status Sign Off
- Wave C Implementation Complete
- Blob Storage
- Cuda
- Ethics Ai
- Exporters
- Huggingface
- Image Analysis
- Importers
- RPC
- Scraper
- Themisdb Ai Watermark Detector
- User Storage Encrypted
- Chimera Architecture
- Chimera Future
- Chimera Readme
- Chimera Roadmap
- Covina Fastapi Ingestion Architecture
- Covina Fastapi Ingestion Future
- Covina Fastapi Ingestion Roadmap
- Vcc Base Architecture
- Vcc Base Future
- Vcc Base Roadmap
- Vcc Clara Ingestion Architecture
- Vcc Clara Ingestion Future
- Vcc Clara Ingestion Roadmap
- Vcc Veritas Architecture
- Vcc Veritas Future
- Vcc Veritas Roadmap
- 01 Hello World
- 02 Todo App
- 03 Contact Manager
- 04 Inventory System
- 05 Time Series Monitor
- 06 Graph Social Network
- 07 Vector Search Documents
- 08 Dms Erp System
- 09 Iot Sensor Network
- 10 Drone Image Analysis
- 11 Blog Wiki
- 12 Expense Tracker
- 13 Recipe Manager
- 14 Ecommerce Catalog
- 15 Event Management
- 16 Kanban Board
- 17 Crm
- 18 Realtime Chat
- 19 Recommendation Engine
- 20 Smart Home
- 21 Coding Platform
- 22 AQL Diagram Tool
- 23 Traveling Salesman
- 24 Moral Philosophy Debates
- API Versioning
- Distributed Sharding
- Feedback Plugins
- Geo
- Gnn
- Image Analysis
- Legal Lora Training
- LLM
- Lora Sync
- Migration
- Nlp
- Performance
- Railway
- Replication
- Rope Visualization
- Sample Product Config
- Security
- Client SDK Overview
- Quickstart
- Sdk Enhancements
- Sdk Implementation Summary
- Test Suite Readme
- Go
- Java
- Javascript
- Php
- Python
- Ruby
- Rust
- Typescript
- 01 Grundlegende Operationen
- 02 AQL Queries
- 03 Graph Daten
- 04 Multimodell Anwendung
- 01 Quickstart Guide
- 02 AQL Referenz Kurzuebersicht
- 03 Datenmodellierung Guide
- 04 Uebungsaufgaben
- 05 Best Practices Guide
- Training Documents
- Training Overview
- 01 Einfuehrung Und Uebersicht
- 02 Datenmodelle Und Architektur
- 03 AQL Abfragesprache
- 04 Installation Und Setup
- 05 Anwendungsbeispiele
- Training Presentations
- Dependencies Readme
- Processmonitor Readme
- Themis.admintools.shared Readme
- Themis.aqlquerybuilder Readme
- Themis.aqlquerybuilder Roadmap
- Themis.auditlogviewer Readme
- Themis.auditlogviewer Roadmap
- Themis.classificationdashboard Readme
- Themis.classificationdashboard Roadmap
- Themis.compliancereports Readme
- Themis.compliancereports Roadmap
- Themis.gisviewer.controlpanel Readme
- Themis.gisviewer.controlpanel Roadmap
- Themis.impactanalysisviewer Readme
- Themis.impactanalysisviewer Roadmap
- Themis.ingestiontool Readme
- Themis.ingestiontool Roadmap
- Themis.keyrotationdashboard Readme
- Themis.keyrotationdashboard Roadmap
- Themis.piimanager Readme
- Themis.piimanager Roadmap
- Themis.retentionmanager Readme
- Themis.retentionmanager Roadmap
- Themis.sagaverifier Readme
- Themis.sagaverifier Roadmap
- Themis.usbadmintool Readme
- Themis.usbadmintool Roadmap
- CI Readme
- CI Roadmap
- Compiler Diagnostics Readme
- Compiler Diagnostics Roadmap
- Completion Readme
- Copilot Ollama Router Readme
- Copilot Ollama Router Roadmap
- Gnn Readme
- Gnn Roadmap
- Rope Visualizer Readme
- Rope Visualizer Roadmap
- Tco Calculator Readme
- Tco Calculator Roadmap
- Tests Readme
- Tests Roadmap
- Themis Config Wx Readme
- Themis Docs Builder Readme
- Wikipedia Ingestion Readme