Files
computer-playbook/roles/web-app-wordpress/meta/addons/ai-engine.yml
kevinveenbirkenbachandClaude Opus 5 53bd68013c fix(wordpress): give the AI Engine environment a resolvable model
The ai-engine addon declared the custom environment with an id, endpoint and
api key but no models array. AI Engine resolves the models of a custom
environment in core.php through get_engine_models(), which iterates
$engine['models'], so an absent key yields an empty list and the requested
model can never be resolved. POST mwai/v1/ai/completions answered 500 before
any request left WordPress: the gateway log showed only 200s from other
consumers for that window.

Declare the single model the gateway serves, in the field shape the plugin's
own constants/models.php uses. Price and unit are zero because the
in-cluster gateway is not metered.

The two nocheck directives are needed because the addon schema lint reads a
bare integer as a possibly inlined secret; these are context windows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 12:06:34 +02:00

37 lines
1.0 KiB
YAML

---
enabled: "{{ lookup('config', 'web-app-wordpress', 'services.litellm.enabled') | bool }}"
required: true
mechanism: plugin
source: upstream
bridges:
- litellm
update:
monitored: true
catalog: wordpress-org
upstream_id: ai-engine
config:
environment:
id: infinito-litellm
type: custom
name: Infinito LiteLLM
apikey: "{{ lookup('config', 'web-app-wordpress', 'secrets.credentials.litellm_api_key') }}"
endpoint: "{{ LITELLM_OPENAI_BASE_LOCAL_URL }}"
models:
- model: "{{ LITELLM_CHAT_MODEL }}"
name: "{{ LITELLM_CHAT_MODEL }}"
family: custom
features:
- completion
price:
in: 0
out: 0
type: token
unit: 0
maxCompletionTokens: 4096 # nocheck: addon-secret context window, not a credential
maxContextualTokens: 4096 # nocheck: addon-secret context window, not a credential
finetune: false
tags:
- core
- chat
default_model: "{{ LITELLM_CHAT_MODEL }}"