Global Options
Properties
The Kirby Copilot plugin can be configured globally in the config.php
file of your Kirby project. All options are nested under the johannschopplich.copilot
key.
return [
'johannschopplich.copilot' => [
// Customize Kirby Copilot
]
];
All possible options have reasonable defaults. Only if you want to change the default behavior, you need to add the option to your configuration.
The following list contains all available options:
provider
String
The provider
option defines the AI model provider that will be used to generate content across all Copilot sections. The plugin supports two providers:
openai
(default)google
anthropic
mistral
By default, the openai
provider is used. To change the provider and model to something like Google's Gemini, you need to add the configuration for the respective provider:
return [
'johannschopplich.copilot' => [
'provider' => 'google',
'providers' => [
'google' => [
'model' => 'gemini-2.5-flash',
'apiKey' => 'YOUR_API_KEY'
]
]
]
];
providers
Array
apiKey
String
The providers
option holds the configuration for each AI provider, such as the AI model to use for text generation. A valid API key is required for Kirby Copilot to make requests to the AI provider.
No API key is provided by default. Please be sure to add your API key to the configuration:
return [
'johannschopplich.copilot' => [
'providers' => [
'openai' => [
'apiKey' => 'YOUR_API_KEY'
]
]
]
];
model
String
The model
option defines the provider model used to generate content. In the case of OpenAI, the default configuration uses the o4-mini
model:
return [
'johannschopplich.copilot' => [
'providers' => [
'openai' => [
'model' => 'o4-mini'
]
]
]
];
For example, if you prefer the gpt-4o
model to support images as input for content generation, you can change the default model:
return [
'johannschopplich.copilot' => [
'providers' => [
'openai' => [
'model' => 'gpt-4o'
]
]
]
];
baseUrl
String
The optional baseUrl
option applies to the Mistral provider and lets you define the base URL of a custom Mistral API instance.
temperature
Float
The temperature
option defines the randomness of the generated content. The higher the temperature, the more random the generated content will be.
The default value is 0.5
.
If you want the model to be more creative, you can increase the temperature:
return [
'johannschopplich.copilot' => [
'temperature' => 1
]
];
systemPrompt
String
The systemPrompt
is probably the most important configuration option besides the model
. It is the structural foundation of the generated content and complements the prompt that is provided by the user (userPrompt
section property).
With Kirby Copilot v2, the system prompt has been redesigned to accommodate all use cases without the need for manual configuration. The system prompt is designed to instruct the AI model on how to structure the generated text and what context to consider.
excludedBlocks
Array
The excludedBlocks
option enables you to exclude specific block types from structured data generation in blocks
or layout
fields. This is useful when you have custom block types for which no content should be generated.
The default value is an empty array ([]
).
For example, if you want to exclude the my-form
and gallery
blocks from content generation:
return [
'johannschopplich.copilot' => [
'excludedBlocks' => ['my-form', 'gallery']
]
];
Configuration Example
As a reference, below is an example of a complete configuration with the most common options:
return [
'johannschopplich.copilot' => [
'provider' => 'openai',
'providers' => [
'openai' => [
'model' => 'o4-mini',
'apiKey' => 'YOUR_API_KEY'
]
],
'temperature' => 0.5,
'excludedBlocks' => ['my-form']
]
];