Overview
By default, every Lua agent uses Google Gemini 2.5 Flash. Themodel property on LuaAgent lets you choose a different model or select one dynamically based on the request context.
Lua manages the API credentials. You don’t need to configure any API keys or provider accounts — Lua handles all LLM infrastructure on your behalf.Support for user-provided API keys (Bring Your Own Key) is coming in a future release.
Available Models
Google (Vertex AI)
OpenAI
Anthropic
DeepSeek
Groq
xAI (Grok)
Alibaba (Qwen)
ZhipuAI (GLM)
Fallback routing. If a model is not in Lua’s approved list, the request is automatically routed through OpenRouter as a best-effort fallback. If that also isn’t available, the request falls back to the default model (
google/gemini-2.5-flash).Static Model
The simplest form — one model for all requests:Dynamic Model Resolver
Use a function to select the model per request. The resolver receives the full request with access to all platform APIs —User, Baskets, Products, Data, and more.
'provider/model' string synchronously or asynchronously.
Common Patterns
Premium vs free users
Channel-based selection
Content-based routing
Environment-based
Default Model
If you don’t setmodel, your agent uses google/gemini-2.5-flash. This is a fast, capable model with a 1M token context window — suitable for most use cases.
Reasoning Effort
Most reasoning-capable models above — across Claude, GPT/o-series, Gemini, Groq, DeepSeek, xAI, and Qwen — support a tunable reasoning effort: how much the model “thinks” before responding. Set a default for your agent viamodelSettings.reasoning:
effort uses one normalized scale ('off' | 'minimal' | 'low' | 'medium' | 'high' | 'max') across every provider — Lua translates it into that model’s native dialect (Claude’s thinking budget/adaptive modes, OpenAI’s reasoningEffort, Gemini’s thinkingConfig, etc.), clamping to the nearest supported tier rather than erroring. A few models have narrower ranges: GPT’s top-tier reasoning variant floors at medium, DeepSeek’s reasoning model has no tier below high, and Qwen’s reasoning is on/off only. A non-reasoning model ignores the setting entirely.
Leaving effort unset doesn’t mean “no reasoning” — Lua’s platform default is adaptive reasoning where the model supports it (Claude’s newest generations, Gemini 2.5’s dynamic thinking budget) and an explicit low effort otherwise, biasing toward lower cost and latency on turns that don’t ask for deeper thinking.
See LuaAgent → modelSettings for the full field reference, including how this interacts with a per-request override.
Related
LuaAgent API
Full constructor reference including the model param
Platform APIs
APIs available inside a model resolver function

