Vercel Ship
26
/ AWS Workshop

Model Picker

This is optional. Use it if you want the app to let users switch which AI Gateway model answers the chat.

Add the picker

  1. Ask the agent to wire model selection through the app.

    Paste this into your agent:

    Prompt
    Add a model picker to the chat app so users can switch which AI Gateway model answers the conversation. The picker should let users choose from Claude Haiku, GPT 5.4 Mini, and Kimi K 2.7. Implement the UI in the frontend and send the selected model with each chat request to the existing FastAPI chat endpoint. Update the backend FastAPI app to read the selected model, validate it against a small allowlist containing only those three models, and pass that model to the AI SDK for Python / AI Gateway call. Keep using AI_GATEWAY_API_KEY for auth and do not add provider-specific API keys. Preserve the existing chat endpoint shape as much as possible, and keep a safe default model when the frontend does not send one.
  2. Try each model.

    Go back to your preview, choose a model, and send a message.

  3. Check the backend logs.

    Watch the vercel dev terminal and confirm the selected model is being used by the FastAPI request.

You are ready when

  • The chat UI includes a model picker.
  • Changing the picker changes the model sent to the backend.
  • The FastAPI backend validates the selected model before calling AI Gateway.
  • The app still works when no model is selected.