-
Notifications
You must be signed in to change notification settings - Fork 14
Dev Server Guide
The backend (geniusai-server) acts as the brains of LrGeniusAI. It runs locally and handles Large Language Model (LLM) inference, image embedding generation, and vector database management. It's written in Rust (axum, ONNX Runtime, LanceDB) for low and deterministic memory use.
For configuration settings, dependency management, and architecture details, refer to server-rs/README.md in this repo.
The backend server is responsible for:
- Image Indexing: Offloading heavy ML workloads (SigLIP2/ONNX Runtime inference) away from the Lightroom UI.
- Semantic Search: Executing fast, vector-based similarity searches using LanceDB.
- Metadata Persistence: Storing tags, face matches, and other AI-generated text alongside the vectors in LanceDB tables.
- Face & Person APIs: Processing and matching facial data to build identity maps over time.
-
Model Caching: Automatically downloading and verifying local storage of the SigLIP2 and face model files to avoid redundant downloads. The
/statusendpoint exposes anis_model_cachedflag which allows the Lightroom plugin to display warning messages if required assets are missing prior to initiating a task.
The API is structured to return robust Error responses. In the event of batch processing failures, endpoints will format exact stack traces and JSON objects detailing which images failed and why (e.g. timeout, invalid model reference, API quota limits). This structured data is intercepted by the plugin to generate user-friendly GUI error reports.
If you are experiencing unexpected backend behavior:
- Try parsing the terminal output or log files written to the server's working directory.
- Refer to the Troubleshooting wiki page to debug the server connection.
Given the importance of your generated search indexes and AI metadata, the backend exposes a dedicated backup download flow:
- API endpoint:
POST /v1/db/backups(POST, not GET: taking a backup also retains a copy on the server, which a safe method may not do — aGETanswers405) - Output: A comprehensive ZIP archive containing the complete LanceDB data directory.
To create a backup via Lightroom:
Open File -> Plug-in Manager -> LrGeniusAI -> Backend Server and click Download DB backup.
When to backup: We highly recommend initiating a backup prior to running large one-time DB migrations, moving the server to a new machine, or updating backend dependencies.