Part of the GENIA Americas AI Toolkit — repo #8. Reusable prompt templates with variable substitution, used across the other tools day-to-day.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .envuvicorn app.main:app --reloadDocs at http://127.0.0.1:8000/docs
pytest tests/ -v7/7 tests pass as of last verified run.
Reads and rendering are open (GET /prompts, GET /prompts/{id}, POST /prompts/{id}/render)
— this is a shared template library other tools consult freely, and rendering is pure
compute with no database mutation. POST /prompts (creating a template) requires an
X-Admin-Key header, configured via the ADMIN_API_KEYS env var as a comma-separated
list of valid keys — otherwise any anonymous caller on the public internet could pollute
the shared library with junk or malicious templates.
POST /prompts— create a template with{variable}placeholders. RequiresX-Admin-Key.GET /prompts— list all. Open.GET /prompts/{id}— retrieve one. Open.POST /prompts/{id}/render— fill in values; any variable you didn't supply comes back inmissing_variablesand stays as{literal}text in the rendered output, rather than raising an error. Open.GET /health