Model Configuration¶
Mozaiks OSS defaults to Google gemini-3.8-flash for workflow execution and the shipped refinement profiles. The base package includes the Google SDK; mozaiks[gemini] remains a supported installation alias. Existing operator configuration and stored model records remain authoritative; upgrading does not rewrite them.
Local OSS setup¶
Install Mozaiks and configure the workspace .env:
Create a key in Google AI Studio. GOOGLE_API_KEY is also supported. Keep credential values out of tracked files.
As verified on November 10, 2026, Google's stable gemini-3.8-flash model supports structured outputs and function calling, with no announced shutdown date. Its Developer API offers free input/output quota; a key on a paid project uses that project's billing terms. Free quota is not an unlimited service: request and token limits depend on the project and are shown in AI Studio. See Google's model reference, pricing, lifecycle, and rate limits.
Google may use unpaid-service inputs and outputs to improve its products, including human review. Use non-sensitive examples with the free tier. Google's terms require paid services for API clients made available to users in the EEA, Switzerland, or UK. Check the current API terms before sending private source code or user data. A free tier in an app's own subscription plans does not make its provider API requests free.
Workflow and general assistant requests¶
The environment selects the runtime provider and model with LLM_PRIMARY_API_TYPE and LLM_PRIMARY_MODEL. The latter takes precedence over the DEFAULT_LLM_MODEL model override. App-specific model records in MongoDB can override the environment. The llm.provider and llm.model fields written to app/config/ai.json by onboard are display metadata, not runtime model selectors.
For Gemini workflow requests, LLM_GEMINI_THINKING_LEVEL optionally selects low, medium, or high. When unset, the provider's default applies. A stored provider entry's thinking_level takes precedence over the environment setting. The selected Gemini model must support the requested level; for example, Gemini 3.8 Flash supports all three. This option does not change LLM_MAX_TOKENS, which limits the provider's generated output, including thinking tokens.
OpenAI remains available with LLM_PRIMARY_API_TYPE=openai, an explicit LLM_PRIMARY_MODEL, and OPENAI_API_KEY. Supported OpenAI models can opt into LLM_USE_RESPONSES_API=true and LLM_REASONING_EFFORT=low; these settings are provider-specific and should be omitted for Google. For Anthropic, install mozaiks[anthropic], select anthropic, and set ANTHROPIC_API_KEY with an explicit model. Provider/model capabilities must match the workflow's tools and structured-output requirements.
Choosing a model in a workflow chat¶
Open AI model in the workflow composer to select a model for subsequent replies. Reopening the conversation restores the selection. Choose Workflow default to use the runtime default again. The full chat page, WorkflowChat, and the inline or floating MozaiksEmbed widget use the same control.
Change models before the workflow starts or when it is waiting for your next message. If a tool interaction is open, finish it first. If the host removes a saved model, choose another available model or Workflow default and resend your message. If a provider is removed while saved agent work is unfinished, the host operator can restore that provider so the turn can finish. Switching models preserves the chat history and its artifacts.
A workflow embedded with WorkflowChat can opt into chooseRunModel. In this mode, the composer displays the workspace's allowed and configured Studio models before starting the conversation. Gemini is the built-in default when available. The authenticated start request carries the chosen model ID, and the runtime binds it to the new workflow run before any agents execute. Refreshing or reconnecting displays that model in the composer. Starting a new conversation allows a new selection. Restore the configured provider if it becomes unavailable during an active run.
The options come from the runtime's configured providers. For an environment using OpenAI, for example, LLM_PRIMARY_MODEL=gpt-4o-mini and LLM_FALLBACK_MODELS=gpt-4.1-mini make two models available with the configured OpenAI credential. The primary model remains the default. A runtime that loads its provider list from MongoDB uses those entries instead.
The choice applies to the agents answering in that workflow. Background jobs with their own model configuration continue to use it. Factory builds and refinements retain the model bound to their run. See the Studio model settings.
Refinement requests¶
app/config/refinement_policy.yaml owns named llm_profiles. The shipped classifier, impact_analyzer, architecture, and codegen profiles use api_type: google and model: gemini-3.8-flash. To change refinement models, edit these profiles as well as the workflow environment. Existing workspace profiles are preserved by onboarding.
An explicit provider/model profile owns its request settings. Set a native output limit such as max_output_tokens in that profile when needed; the workflow environment's LLM_MAX_TOKENS is not inherited by a complete profile.
Classification, impact planning, and structured patch generation use these profiles. The architecture profile is advisory workflow context; the workflow runner still selects its model through the workflow runtime configuration. ACP coding adapters run a separate coding agent with separate configuration; the shipped ACP provider remains disabled. Choosing a model does not install or enable Codex or Claude Code.