Recipes AI Prompt

AI Prompt (Multi-Provider)

Full Screen Demo

A single prompt endpoint that talks to OpenAI, Anthropic, Google or Perplexity by changing one string.

The trick: ReqLLM.generate_text/3 accepts a provider:model spec like openai:gpt-4o-mini or anthropic:claude-haiku-4-5-20251001. Swap providers without rewriting the call site.

The demo below is rude on purpose. Channel your inner 10 year old, then read the code.

//res.cloudinary.com/wickedsites/image/upload/c_fill,g_face,h_64,w_64/petal_marketing/prod/avatars/23015 //res.cloudinary.com/wickedsites/image/upload/c_fill,g_face,h_64,w_64/petal_marketing/prod/avatars/23703 //res.cloudinary.com/wickedsites/image/upload/c_fill,g_face,h_64,w_64/petal_marketing/prod/avatars/24364 //res.cloudinary.com/wickedsites/image/upload/c_fill,g_face,h_64,w_64/petal_marketing/prod/avatars/21074 //res.cloudinary.com/wickedsites/image/upload/c_fill,g_face,h_64,w_64/petal_marketing/prod/avatars/21946

5 developers have viewed this recipe

Why this matters

  • One call site. Any LLM. Swap openai:gpt-4o-mini for anthropic:claude-haiku-4-5-20251001 without touching the call.
  • A/B test models in production by toggling a config value — useful when a provider has an outage.
  • Wraps cleanly into a Jido.Action if you want tool calling — see the tool calling recipe.