- Add vault_honcho_openai_api_key (embeddings-only, Honcho-scoped)
- Inject OPENAI_API_KEY + LLM_OPENAI_API_KEY into api + deriver containers
- Flip honcho_embed_messages default to true now that embeddings have a provider
- Parameterise EMBEDDING__MODEL_CONFIG__{TRANSPORT,MODEL,BASE_URL} so we can
later swap to a local OpenAI-compatible embedder (e.g. Ollama on
astro-orbiter post-rebuild) with a single defaults change.
Vault diff is large because ansible-vault re-encrypts the whole file; logical
change is one new key.
71 lines
3.0 KiB
Django/Jinja
71 lines
3.0 KiB
Django/Jinja
# mk-labs Honcho deriver worker (background queue consumer)
|
|
# Managed by Ansible - honcho role
|
|
|
|
[Unit]
|
|
Description=Honcho deriver worker
|
|
After=network-online.target {{ honcho_postgres_container_name }}.service {{ honcho_container_name }}.service
|
|
Wants=network-online.target
|
|
Requires={{ honcho_postgres_container_name }}.service
|
|
|
|
[Container]
|
|
Image={{ honcho_image }}
|
|
ContainerName={{ honcho_deriver_container_name }}
|
|
Network={{ honcho_network_name }}
|
|
|
|
# Invoke the package's __main__.py — src/deriver/deriver.py has no
|
|
# __main__ guard and exits 0 in ~3s if invoked directly, causing systemd
|
|
# to crash-loop the unit. python -m src.deriver hits __main__.py and
|
|
# starts the real queue processor.
|
|
WorkingDir=/app
|
|
Exec=/app/.venv/bin/python -m src.deriver
|
|
|
|
# -- Database ---------------------------------------------------------------
|
|
Environment=DB_CONNECTION_URI=postgresql+psycopg://{{ honcho_db_user }}:{{ honcho_db_password }}@{{ honcho_postgres_container_name }}:5432/{{ honcho_db_name }}
|
|
|
|
# -- Auth -------------------------------------------------------------------
|
|
Environment=AUTH_USE_AUTH={{ honcho_auth_enabled | string | lower }}
|
|
Environment=AUTH_JWT_SECRET={{ honcho_jwt_secret }}
|
|
|
|
# -- LLM provider keys ------------------------------------------------------
|
|
{% if honcho_llm_transport == 'anthropic' %}
|
|
Environment=LLM_ANTHROPIC_API_KEY=*** honcho_anthropic_api_key }}
|
|
{% endif %}
|
|
{% if honcho_openai_api_key | length > 0 %}
|
|
Environment=LLM_OPENAI_API_KEY=*** honcho_openai_api_key }}
|
|
Environment=OPENAI_API_KEY=*** honcho_openai_api_key }}
|
|
{% endif %}
|
|
|
|
# -- Deriver runtime --------------------------------------------------------
|
|
Environment=DERIVER_ENABLED={{ honcho_deriver_enabled | string | lower }}
|
|
Environment=DERIVER_WORKERS={{ honcho_deriver_workers }}
|
|
Environment=DERIVER_POLLING_SLEEP_INTERVAL_SECONDS={{ honcho_deriver_polling_seconds }}
|
|
Environment=DERIVER_FLUSH_ENABLED={{ honcho_deriver_flush_enabled | string | lower }}
|
|
Environment=DERIVER_MODEL_CONFIG__TRANSPORT={{ honcho_llm_transport }}
|
|
Environment=DERIVER_MODEL_CONFIG__MODEL={{ honcho_deriver_model }}
|
|
|
|
# -- Summary subsystem ------------------------------------------------------
|
|
Environment=SUMMARY_MODEL_CONFIG__TRANSPORT={{ honcho_llm_transport }}
|
|
Environment=SUMMARY_MODEL_CONFIG__MODEL={{ honcho_summary_model }}
|
|
|
|
# -- Embeddings -------------------------------------------------------------
|
|
Environment=EMBED_MESSAGES={{ honcho_embed_messages | string | lower }}
|
|
Environment=EMBEDDING__MODEL_CONFIG__TRANSPORT={{ honcho_embedding_transport }}
|
|
Environment=EMBEDDING__MODEL_CONFIG__MODEL={{ honcho_embedding_model }}
|
|
{% if honcho_embedding_base_url | length > 0 %}
|
|
Environment=EMBEDDING__MODEL_CONFIG__BASE_URL={{ honcho_embedding_base_url }}
|
|
{% endif %}
|
|
|
|
# -- Vector store -----------------------------------------------------------
|
|
Environment=VECTOR_STORE_TYPE=pgvector
|
|
|
|
# Timezone matches host baseline
|
|
Environment=TZ=America/Chicago
|
|
Environment=LOG_LEVEL=INFO
|
|
|
|
[Service]
|
|
Restart=always
|
|
TimeoutStartSec=180
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target default.target
|