* feat: per-feature and workspace-level AI model settings Baserow could only point every AI feature at one instance-wide model. An administrator can now register provider models, declare which AI features each model may serve, and pick the default model per feature; a workspace admin can inherit that choice, override it, or disable the feature locally. The assistant resolves its model once per logical request and threads that snapshot through its nested agents and tools, so a single run can no longer re-read settings repeatedly or pick a model other than the one it validated. The scoped provider state is memoized for the duration of a request, keeping workspace serialization from loading it once per workspace. Also: - add Google and Groq provider types, and keep these database-only providers out of the legacy workspace settings they cannot round-trip through; - prune orphaned feature selections so an unloaded feature type's RESTRICT FK no longer blocks provider and model deletion; - record whether a configured model answers text and tool-calling probes, and invalidate that result when its credentials or identifier change; - broadcast provider and availability changes over the existing realtime channel so open clients update without reloading; - read the assistant model from the shared configmap, so frontend pods no longer miss it on Helm installs. Manual test instructions live in docs/testing/kuma-model-settings-test-plan.md. * fix: address AI provider settings review feedback
6.7 KiB
Feature flags
Baserow uses basic feature flags currently to allow unfinished features to be merged and/or released.
Available Feature Flags
Add/remove features flags to the list below:
ai-providers— AI provider management for the instance admin area and for workspace settings.button-field: enables the button field type (#1722).
Preparing the ai-providers feature
There are two sources of legacy configuration and both must be imported: AI provider
environment variables become instance-level providers, and each workspace's legacy
generative_ai_models_settings JSON becomes workspace-owned providers. Run the whole
sequence with the flag still disabled, because until a workspace's legacy JSON is
imported the new UI reports no workspace provider while that JSON is still what
resolves at runtime.
- Before deploying the release, keep
ai-providersdisabled. If the installation usesFEATURE_FLAGS=*, first make a separate configuration-only rollout of the currently installed release with an explicit list of the other required flags; there is no negative override for one flag. Wait for every wildcard-configured web and worker process to drain before deploying the new image. Do not combine this configuration change with a rolling image update: old processes would still enableai-providers. If the platform cannot roll out configuration separately, stop the old processes before starting the new release with the explicit list. - Deploy the release and let the old web and worker processes drain. Pause changes to instance and workspace AI provider settings until the import is complete and the flag has been enabled; otherwise a workspace can change its legacy JSON after the command has read it. The new Google and Groq provider types have no environment variables and are configured in the admin UI only. Older frontend bundles do not have those provider types in their registry and cannot safely render a workspace payload containing them, so add either provider only after every old frontend process has drained. Draining frontend processes does not replace JavaScript already loaded in a browser tab: before adding either provider, require active users to reload Baserow (or close and reopen it) onto the new frontend assets. Keep the settings-write pause in place until that client cutover is complete.
- Preview both scopes. The command writes nothing without
--apply:
just b manage migrate_ai_provider_settings --scope instance
just b manage migrate_ai_provider_settings --scope workspace
- Review every warning. Repair or explicitly accept each incomplete legacy setting and each difference from an existing database provider before proceeding. The importer preserves the database provider in a conflict, and an incomplete workspace override can inherit the instance provider after the flag is enabled. Then apply each scope atomically, instance first:
just b manage migrate_ai_provider_settings --scope instance --apply
just b manage migrate_ai_provider_settings --scope workspace --apply
- Redeploy or restart every web, backend, and worker process with
ai-providersenabled, then wait for every feature-disabled process to drain before ending the settings-write pause. This prevents one generation from resolving legacy settings while another resolves the imported database settings. Wildcard installations can now restoreFEATURE_FLAGS=*. - Republish any Application Builder site or Automation workflow that uses an AI integration without its own provider override. Publications created before the switch contain a snapshot of the inherited legacy workspace settings; republishing replaces that snapshot with live database-backed workspace inheritance. Explicit per-integration provider overrides remain self-contained and do not need this step.
The command never prints credentials and preserves provider types already configured at the selected scope, so both imports are safe to run again — only missing provider types are imported.
The command does not import Kuma's legacy model or provider-native credentials. Kuma continues to use that legacy configuration when its database selection is unconfigured or invalid. An explicit instance or workspace disable remains authoritative and does not fall back. An administrator can clear an instance database selection with Use legacy environment model, which displays the configured model, before or after the feature gate is retired.
When retiring ai-providers, make the database-backed paths unconditional in both
the backend and frontend; a missing flag must not route clients back to legacy-only
payloads. Remove only the feature gates in that release and retain the legacy provider
and Kuma resolution fallbacks: self-hosted installations can skip the manual import
sequence, and some legacy Kuma providers cannot yet be represented by database-backed
providers. Retiring those fallbacks requires a separate migration which covers every
supported provider and credential source.
Enabling feature flags
To enable specific feature flags set the environment variable
FEATURE_FLAGS=feature1,feature2,feature3. Using just this would look like:
FEATURE_FLAGS=feature1,feature2,feature3 just dc-dev up -d
You could also add the variable to your .env.docker-dev file (for Docker development)
or .env.local file (for local development).
Enabling all feature flags
Use the * feature flag to enable every single feature flag without having to specify
each one.
FEATURE_FLAGS=* just dc-dev up -d
Naming convention
Feature flags should be:
- Alphanumeric with dashes.
- Not start or end with spaces (flags from the env variable will be trimmed for ease of use).
- Unique per feature.
Creating a feature flag
In the Backend
# Add variable with feature flag to baserow.core.feature_flag in format
# FF_<FEATURE_NAME> = "feature_name"
# i.e.
FF_FEATURE1 = "feature1"
# In your feature file import flag you need and feature flag function
from baserow.core.feature_flag import FF_FEATURE1, feature_flag_is_enabled
# Use to check if feature is enabled
if feature_flag_is_enabled(FF_FEATURE1):
# do the feature
# or if you want to raise exception if the feature is not enabled
feature_flag_is_enabled(FF_FEATURE1, raise_if_disabled=True)
In the Web-frontend
// add feature flag variable in @core/plugins/featureFlags.js in format
// FF_<FEATURE_NAME> = "feature_name"
// i.e.
export const FF_FEATURE1 = "feature1";
methods: {
someComponentMethod();
{
if (this.$featureFlagIsEnabled(FF_FEATURE1)) {
// do the feature
}
}
}