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.