Built and used in production by Google, Genkit is an open-source library with tools to help you build AI-powered experiences
Get started with just a few lines of code.
import { genkit }from'genkit';import { googleAI }from'@genkit-ai/google-genai';constai=genkit({ plugins: [googleAI()] });const {text }=await ai.generate({model: googleAI.model('gemini-2.5-flash'),prompt:'Why is Genkit awesome?'});
import { genkit }from'genkit';import { googleAI }from'@genkit-ai/google-genai';constai=genkit({ plugins: [googleAI()] });const {media }=await ai.generate({model: googleAI.model('imagen-3.0-generate-002'),prompt:'a banana riding a bicycle',});
import { genkit }from'genkit';import { openAI }from'@genkit-ai/compat-oai/openai';constai=genkit({ plugins: [openAI()] });const {text }=await ai.generate({model: openAI.model('gpt-4o'),prompt:'Why is Genkit awesome?'});
import { genkit }from'genkit';import { anthropic, claude35Sonnet }from'genkitx-anthropic';constai=genkit({ plugins: [anthropic()] });const {text }=await ai.generate({model: claude35Sonnet,prompt:'Why is Genkit awesome?'});
import { genkit }from'genkit';import { xAI }from'@genkit-ai/compat-oai/xai';constai=genkit({ plugins: [xAI()] });const {text }=await ai.generate({model: xAI.model('grok-3-mini'),prompt:'Why is Genkit awesome?',});
import { genkit }from'genkit';import { deepSeek }from'@genkit-ai/compat-oai/deepseek';constai=genkit({ plugins: [deepSeek()] });const {text }=await ai.generate({model: deepSeek.model('deepseek-chat'),prompt:'Why is Genkit awesome?',});
import { genkit }from'genkit';import { ollama }from'genkitx-ollama';constai=genkit({ plugins: [ollama()] });const {text }=await ai.generate({model: ollama.model('gemma3:latest'),prompt:'Why is Genkit awesome?',});
import ("context""log""github.com/firebase/genkit/go/ai""github.com/firebase/genkit/go/genkit""github.com/firebase/genkit/go/plugins/googlegenai")funcmain() {ctx:= context.Background()g:= genkit.Init(ctx, genkit.WithPlugins(&googlegenai.GoogleAI{}))resp, err:= genkit.Generate(ctx, g,ai.WithPrompt("Why is Genkit awesome?"),ai.WithModelName("googleai/gemini-2.5-flash"),)if err!=nil {log.Fatal(err)}log.Println(resp.Text())}
import ("context""fmt""log""github.com/firebase/genkit/go/ai""github.com/firebase/genkit/go/genkit""github.com/firebase/genkit/go/plugins/googlegenai")funcmain() {ctx:= context.Background()g:= genkit.Init(ctx, genkit.WithPlugins(&googlegenai.GoogleAI{}))resp, err:= genkit.Generate(ctx, g,ai.WithPrompt("a banana riding a bicycle"),ai.WithModelName("googleai/imagen-3.0-generate-002"),)if err!=nil {log.Fatal(err)}log.Printf("Generated image:%s", resp.Media().URL)}
import ("context""log""github.com/firebase/genkit/go/ai""github.com/firebase/genkit/go/genkit""github.com/firebase/genkit/go/plugins/compat_oai/openai")funcmain() {ctx:= context.Background()g:= genkit.Init(ctx, genkit.WithPlugins(&openai.OpenAI{}))resp, err:= genkit.Generate(ctx, g,ai.WithPrompt("Why is Genkit awesome?"),ai.WithModelName("openai/gpt-4o"),)if err!=nil {log.Fatal(err)}log.Println(resp.Text())}
import ("context""log""github.com/firebase/genkit/go/ai""github.com/firebase/genkit/go/genkit""github.com/firebase/genkit/go/plugins/compat_oai/anthropic")funcmain() {ctx:= context.Background()g:= genkit.Init(ctx, genkit.WithPlugins(&anthropic.Anthropic{}))resp, err:= genkit.Generate(ctx, g,ai.WithPrompt("Why is Genkit awesome?"),ai.WithModelName("anthropic/claude-3-7-sonnet-20250219"),)if err!=nil {log.Fatal(err)}log.Println(resp.Text())}
import ("context""log""github.com/firebase/genkit/go/ai""github.com/firebase/genkit/go/genkit""github.com/firebase/genkit/go/plugins/ollama")funcmain() {ctx:= context.Background()g:= genkit.Init(ctx, genkit.WithPlugins(&ollama.Ollama{ServerAddress:"http://localhost:11434",},}))resp, err:= genkit.Generate(ctx, g,ai.WithPrompt("Why is Genkit awesome?"),ai.WithModelName("ollama/gemma3:latest"),)if err!=nil {log.Fatal(err)}log.Println(resp.Text())}
from genkit.aiimport Genkitfrom genkit.plugins.google_genaiimport GoogleAIai= Genkit(plugins=[GoogleAI()],)response=await ai.generate(model='googleai/gemini-2.5-flash',prompt='Why is Genkit awesome?')print(response.text)
from genkit.aiimport Genkitfrom genkit.plugins.google_genaiimport GoogleAIai= Genkit(plugins=[GoogleAI()],)response=await ai.generate(model='googleai/imagen-3.0-generate-002',prompt='a banana riding a bicycle')# Access generated mediaif response.media:print(f"Generated image:{response.media.url}")
from genkit.aiimport Genkitfrom genkit.plugins.compat_oaiimport OpenAIai= Genkit(plugins=[OpenAI()],)response=await ai.generate(model='openai/gpt-4o',prompt='Why is Genkit awesome?')print(response.text)
from genkit.aiimport Genkitfrom genkit.plugins.ollamaimport Ollamafrom genkit.plugins.ollama.modelsimport ModelDefinitionai= Genkit(plugins=[Ollama(models=[ModelDefinition(name='gemma3:latest'),],)],)response=await ai.generate(model="ollama/gemma3:latest",prompt='Why is Genkit awesome?')print(response.text)
The fastest way to build, test, and deploy real AI
features into your apps.
Local dev, debugging UI, and deployment to Firebase, Cloud Run, or your stack.
Learn more →Run, debug and observe your AI workflows from the local developer UI.
Choose your SDK language and provider (e.g. GoogleAI, OpenAI).
Define prompts, flows, and tools in code.
Use the Genkit CLI and Developer UI to inspect behaviour.
Run on Firebase, Cloud Run, or your own infrastructure.
See how Genkit works with Firebase, Angular, Next.js and more in production-ready apps, with pre-built demos and code you can reuse.