By default, every Lua agent uses Google Gemini 2.5 Flash. The model property on LuaAgent lets you choose a different model or select one dynamically based on the request context.
export const agent = new LuaAgent({ name: 'my-agent', persona: '...', model: 'openai/gpt-5.4', // ← add this skills: [mySkill]});
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.
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).
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.
model: (request) => { // Use a faster/cheaper model for voice channels if (request.channel === 'voice') return 'google/gemini-2.5-flash-lite'; // Use a more capable model for complex web requests return 'openai/gpt-5.4';}
model: async (request) => { // Use a model with large context for document-heavy workflows const basketCount = await Baskets.getCount(); if (basketCount > 50) return 'openai/gpt-4.1'; // 1M context return 'openai/gpt-5.4-mini';}
If you don’t set model, 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.
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 via modelSettings.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.