One plugin for endless model choices

One plugin for endless model choices

Simplify your LLM development by using one Genkit plugin to access models like Claude, Mistral, Gemini, and Llama from Vertex AI's Model Garden. Learn how to switch between large language models without the hassle of rotating API keys or tracking multiple quotas.

Being able to swap models and try out different models has a lot of appeal. Being able to bounce between Claude, Mistral, Gemini, and Llama without having to worry about rotating your API keys, having an API key leak accidentally, or from trying to track your different quotas from different consoles is a boon as well. In this article we are going to take a look at a Genkit plugin that allows you to switch models all through one plugin and provider.

Model Garden from Vertex AI

Model Garden is a collection of AI and ML models that allows you to run some partner models in a serverless environment. If the serverless deployment is not available, you also have the option to host the model through Vertex AI and it handles a lot of the configuration for you. The serverless models available at the time of this writing come from Anthropic (Claude), Meta (Llama), and Mistral AI (Mistral). All you need to do is go into model garden, select your model, and then enable it.

How to get the model into Genkit?

To get the model into Genkit you must have the Vertex AI plugin for Genkit installed in your project and then configure the modelGarden plugin which comes within that package. Once it’s there, you call generate in one of your flows and pass in the model with the vertexModelGarden.model() method and pass in the model name which can be found at the end of the model id. In my case, since I wanted to use a mistral model, I can look at the model id on the publisher page which is publishers/mistralai/models/mistral-medium-3 and then get the mistral-medium-3 model from there.

import { genkit, z } from "genkit";
import { vertexModelGarden } from "@genkit-ai/vertexai/modelgarden";

export const ai = genkit({
    plugins: [
        vertexModelGarden({
            projectId: "YOUR_PROJECT_ID",
            location: "DATA_CENTER_LOCATION",
        }),
    ],
});

export const generateSeaShantyFlow = ai.defineFlow(
    {
        name: "generateSeaShantyFlow",
        inputSchema: z.string().describe("Topic for the sea shanty"),
        outputSchema: z.string().describe("The generated sea shanty"),
    },
    async (topic) => {
        const response = await ai.generate({
            model: vertexModelGarden.model("mistral-medium-3"),
            prompt: `Write a lively sea shanty about ${topic}.`,
            config: { temperature: 0.8 },
        });
        return response.text;
    }
);

Conclusion

With one plugin, you have now enabled a wide variety of different models without needing to remember or require a key for each model. Since these models run on Google infrastructure you get the same value and protections offered by Vertex AI and can use different models as you see fit.

Give model garden a try and let the Genkit team know what you think!

Learn more by visiting the documentation at genkit.dev!

Related Content

ai • Feb 4, 2026

Talking about Skills, Optimizing Prompts and building MCP servers in apps

We’re diving deep into the latest paradigms in AI development, starting with the difference between traditional context files (Gemini.md) and the new "Agent Skills" dynamic. We also share a story about using the Vertex AI Prompt Optimizer to automate our YouTube descriptions. It took 5 hours and nearly 100 million tokens, but the results were surprisingly consistent. Finally, we geek out on the Model Context Protocol (MCP), experimenting with exposing Flutter application state as local tools using Unix sockets.

Watch on YouTube
ai • Feb 25, 2026

Get LIVE Feedback from AI: Building a Presentation Coach

Tired of generic chatbots? Discover how Firebase AI Logic lets you build unique, streamed conversational AI experiences with Gemini's native audio models! From practicing presentations with AI feedback to building custom voice assistants, the possibilities are endless. This video dives deep into Firebase AI Logic, showcasing how you can create immersive audio interactions within your apps. Learn how to leverage Gemini's native audio models to provide a unique vocal experience, keeping your API keys secure while offering features like custom personas, real-time feedback via tool calls, and diverse voice selections. We'll walk through a practical demo of building an AI assistant that helps practice public speaking, complete with live metrics and a distinct AI personality.

Watch on YouTube