Skip to content

Commit 248ab85

Browse files
committed
docs: adjust setting names
1 parent 5c3631b commit 248ab85

File tree

5 files changed

+105
-90
lines changed

5 files changed

+105
-90
lines changed

Writerside/m.tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<toc-element topic="index.md"/>
1010
<toc-element toc-title="Configuration">
1111
<toc-element topic="Configuration_Overview.md"/>
12-
<toc-element topic="Supported-Providers.md"/>
12+
<toc-element topic="Supported-Services.md"/>
1313
</toc-element>
1414
<toc-element topic="Usage.md"/>
1515
<toc-element topic="Cost.md"/>

Writerside/topics/Configuration_Overview.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Overview
22

3-
Use the [Supported Providers](Supported-Providers.md) section to set up your response provider's credentials.
3+
Use the [Supported Services](Supported-Services.md) section to set up your response AI service's credentials.
4+
5+
## Models
6+
When defining model name you want to use, you have to enter it in following format: `service_name/model_name`, so for example `gpt-4o-mini` would become `openai/gpt-4o-mini`, `gemini-2.0-flash` would be `google/gemini-2.0-flash` etc.
47

58
## Generative Fields {id=generative_fields}
69

@@ -49,45 +52,42 @@ modai.global.text.model
4952

5053
The `setting` for text or textarea inputs can contain several options below which will override the default settings from the `global` area:
5154

52-
- **model** – for text or textarea, modAI defaults to use `gpt-4o`
55+
- **model** – for text or textarea, modAI defaults to use `openai/gpt-4o-mini`
5356
- **temperature** – defaults to `0.7`, increase this to 1 for more “creative” results or 0 for highly predictable ones
5457
- **max_tokens** – defaults to `2048`
5558

5659
Image and Image+ fields do not prepend their prompts with the base prompt. Image/Image+ setting defaults in the `image` area include:
5760

58-
- **model** – defaults to `dall-e-3`
61+
- **model** – defaults to `openai/dall-e-3`
5962
- **quality** – defaults to `standard`
6063
- **size** – defaults to `1792x1024`
6164
- **style** – defaults to `vivid`
6265

6366
Image+ fields can use Vision models to describe an image for the alt content found in the `vision` area:
6467

65-
- **vision.model** – defaults to `gpt-4o-mini`
68+
- **vision.model** – defaults to `openai/gpt-4o-mini`
6669

6770
### Custom Options
68-
If needed, cutom options can be supplied to the AI service by either using the `global` variant of the setting for specific type, for example `modai.global.text.custom_options` and setting it to a JSON object with desired properties, or by using a setting for a specific field like `modai.res.content.text.custom_options`.
71+
If needed, custom options can be supplied to the AI service by either using the `global` variant of the setting for specific type, for example `modai.global.text.custom_options` and setting it to a JSON object with desired properties, or by using a setting for a specific field like `modai.res.content.text.custom_options`.
6972

7073
### Overriding Global Defaults
7174

7275
Each field that you attach modAI to can have settings overrides. This means that you can mix and match which models are used for specific fields, allowing you to optimize for cost or quality depending on your application. For example to use Claude Haiku to generate a (very) creative summary for the `[[*introtext]]` field, you would update/create the following settings:
7376

74-
- `modai.api.claude.key``{your API key}`
75-
- `modai.res.introtext.text.model``claude-3-5-haiku-20241022`
77+
- `modai.api.anthropic.key``{your API key}`
78+
- `modai.res.introtext.text.model``anthropic/claude-3-5-haiku-20241022`
7679
- `modai.res.introtext.text.temperature``0.9`
7780

7881
## Streaming
7982

8083
If you'd like to stream the AI response into the UI (see the incrementally generated response), you can do so by enabling `modai.global.text.stream` and/or `modai.global.vision.stream` (as always, you can enable this also for only specific fields).
8184

8285
<warning id="warn-streaming">
83-
Currently streaming only works when the request is executed on client ("modai.api.execute_on_server" is set to "false").
86+
If you are executing requests on the server ("modai.api.execute_on_server" is set to "true"), make sure you configured your server to support streaming (disabled buffering etc.), you can make these changes only for the "/assets/components/modai/api.php" path.
8487
</warning>
8588

86-
87-
88-
8989
<seealso>
9090
<category ref="related">
91-
<a href="Supported-Providers.md" />
91+
<a href="Supported-Services.md" />
9292
</category>
9393
</seealso>

Writerside/topics/Supported-Providers.md

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Supported AI Services
2+
3+
### Executing AI requests
4+
<warning id="key-warning">
5+
By default your keys will be exposed to manager users over network requests, so it is recommended to use a site-specific key
6+
that can be easily revoked.
7+
</warning>
8+
9+
Enabling system setting `modai.api.execute_on_server` will move the execution to the server side, hiding the network traffic.
10+
11+
It can be enabled per service using `modai.api.{service}.execute_on_server}` format, for example, to enable this only for chatgpt, the setting would be: `modai.api.anthropic.execute_on_server`.
12+
13+
## OpenAI (ChatGPT)
14+
- Service name: openai
15+
- Supported modes:
16+
- **text generation**[](https://platform.openai.com/docs/guides/text-generation)
17+
- **image to text**[](https://platform.openai.com/docs/guides/vision)
18+
- **DALL-E image creation**[](https://platform.openai.com/docs/guides/images)
19+
20+
ChatGPT is the default AI service assumed. Fill out the `modai.api.openai.key` and adjust any models as desired.
21+
22+
## Google Gemini
23+
- Service name: google
24+
- Supported modes:
25+
- **text generation** - [](https://ai.google.dev/gemini-api/docs/models/gemini)
26+
- **image to text**[](https://ai.google.dev/gemini-api/docs/vision)
27+
- **image generation**[](https://ai.google.dev/gemini-api/docs/imagen)
28+
29+
Add a valide API key to the `modai.api.google.key` to use Google Gemini.
30+
31+
To change a prompt to use Google Gemini, set its corresponding model setting, e.g:
32+
33+
- `global.global.model``google/gemini-2.0-flash`
34+
35+
## Anthropic (Claude)
36+
37+
<warning id="claude-server-only">
38+
At this moment Claude can only work serverside. Setting either "modai.api.execute_on_server" or "modai.api.claude.execute_on_server" to "true".
39+
</warning>
40+
41+
- Service name: anthropic
42+
- Supported modes:
43+
- **text generation** - [](https://docs.anthropic.com/en/docs/about-claude/models)
44+
- **image to text** - [](https://docs.anthropic.com/en/docs/about-claude/models)
45+
46+
Add a valid API key to the `modai.api.anthropic.key` to use Claude.
47+
48+
To change a prompt to use Claude, set its corresponding model setting, e.g:
49+
50+
- `global.global.model``anthropic/claude-3-5-haiku-latest`
51+
52+
## OpenRouter.ai
53+
54+
- Service name: openrouter
55+
- Supported modes:
56+
- **text generation** - [](https://openrouter.ai/models?fmt=cards&output_modalities=text)
57+
- **image to text** - [](https://openrouter.ai/models?fmt=cards&input_modalities=image)
58+
59+
Add a valid API key to the `modai.api.openrouter.key` to use OpenRouter.
60+
61+
To change a prompt to use OpenRouter, set its corresponding model setting, e.g:
62+
63+
- `global.global.model``openrouter/meta-llama/llama-4-scout:free`
64+
65+
66+
## Custom Services/Models
67+
68+
- Service name: custom
69+
70+
Some services like [Open WebUI](https://docs.openwebui.com) provide a wrapper for multiple models. To use a custom model via these services you need to fill out the `modai.api.custom.url`, `modai.api.custom.key` and optionally the `modai.custom.compatibility`, which tells the model what API emulation to use (almost alway leave this as openai).
71+
72+
To use the custom service, set the following fields:
73+
74+
- `modai.api.custom.url``{your custom URL}`
75+
- `modai.api.custom.key``{your API key}`
76+
77+
Then, you for each model you want to use, set the corresponding "model" field with the prefix "custom/" followed by the model name, e.g:
78+
79+
- `modai.global.model``custom/llama3.1:8b`
80+
81+
<seealso>
82+
<category ref="external">
83+
<a href="https://platform.openai.com/docs/guides/">OpenAI Guides</a>
84+
<a href="https://ai.google.dev/gemini-api/docs/">Gemini Docs</a>
85+
<a href="https://docs.anthropic.com/en/docs/">Anthropic Docs</a>
86+
<a href="https://openrouter.ai/">OpenRouter Docs</a>
87+
<a href="https://docs.openwebui.com">Open WebUI Docs</a>
88+
</category>
89+
</seealso>

Writerside/topics/index.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,20 @@ The modAI Plugin adds a sparkle button (✦) next to fields or labels in back-en
1111
## Requirements
1212

1313
- MODX Revolution 3.x
14-
- An API Key from your [Supported Provider](Supported-Providers.md)
14+
- An API Key from your [Supported AI Services](Supported-Services.md)
1515
- Pre-paid credits for API calls for ChatGPT if using—this is different from the $20/month ChatGPT Pro subscription
1616

17-
<note>
18-
Image and vision support is currently only supported with the OpenAI and Gemini. Claude, Ollama and others only support text generation.
19-
</note>
20-
2117
MODX’s modAI Extra works with the following Extras if installed:
2218

2319
- **[image+](https://extras.modx.com/package/imageplustvinput)** – for things like Open Graph sharing previews or hero section images with robust output templating, resizing, cropping and format conversions in conjunction with pThumb
2420
- **[SEO Suite](https://extras.modx.com/package/seosuite)** – for managing and previewing SEO-related information for your sites
2521

2622
<seealso>
2723
<category ref="related">
28-
<a href="Supported-Providers.md" />
24+
<a href="Supported-Services.md" />
2925
</category>
3026
<category ref="external">
3127
<a href="https://extras.modx.com/package/imageplustvinput">Image+</a>
3228
<a href="https://extras.modx.com/package/seosuite">SEO Suite</a>
3329
</category>
34-
</seealso>
30+
</seealso>

0 commit comments

Comments
 (0)