Model preferences for selecting an AI model based on performance and cost requirements.
This allows Plot to match those preferences with user preferences (such as preferred or
disallowed providers), as well as availability of newer and better models.
Example
// Fast and cheap - uses Workers AI models like Llama 3.2 1B constresponse = awaitai.prompt({ model: { speed:"fast", cost:"low" }, prompt:"Summarize this in one sentence: ..." });
// Balanced performance - uses GPT-5 Mini or Gemini 2.5 Flash constresponse = awaitai.prompt({ model: { speed:"balanced", cost:"medium" }, prompt:"Analyze this data..." });
// Most capable - uses Claude Sonnet 4.5 or Opus 4.1 constresponse = awaitai.prompt({ model: { speed:"capable", cost:"high" }, prompt:"Solve this complex reasoning problem..." });
// Request a specific model with a hint constresponse = awaitai.prompt({ model: { speed:"balanced", cost:"medium", hint:AIModel.CLAUDE_SONNET_45 }, prompt:"..." });
Model preferences for selecting an AI model based on performance and cost requirements. This allows Plot to match those preferences with user preferences (such as preferred or disallowed providers), as well as availability of newer and better models.
Example