Google Gen AI SDK

Google's official TypeScript/JavaScript SDK for building applications with the Gemini API and Vertex AI.

SDK
npm
v2.17.1
1,665stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
89/100Excellent
Development Activity100
Maintenance100
Community72
Maturity44
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
84/100Excellent
Architecture87
Code Quality84
Innovation86
Learning Curve78

@google/genai is Google’s official TypeScript and JavaScript SDK for building applications powered by Gemini models. It provides a single, unified client that works with both the Gemini Developer API (using an API key from Google AI Studio) and the Gemini Enterprise Agent Platform (formerly Vertex AI), so teams can prototype against the consumer API and later move to enterprise infrastructure without rewriting application code.

The SDK wraps content generation, streaming, function calling, file uploads, context caching, live bidirectional sessions, batch jobs, and fine-tuning behind a consistent, well-typed API surface, and ships isomorphic builds that run in both Node.js and the browser.

What You Get

  • A single GoogleGenAI client that switches between the Gemini Developer API (API key) and Vertex AI / Gemini Enterprise (Cloud project credentials) without changing application code
  • First-class support for text, image, audio, and video generation, plus streaming responses via generateContentStream
  • Built-in function calling with JSON-schema tool declarations, automatic function calling, and native Model Context Protocol (MCP) tool support
  • Context caching (ai.caches), file uploads (ai.files), batch jobs (ai.batches), fine-tuning (ai.tunings), and low-latency bidirectional Live sessions (ai.live) for audio/video
  • Isomorphic builds for Node.js (CommonJS + ESM) and the browser, plus a bundled SentencePiece tokenizer for local token counting

Common Use Cases

  • Building chatbots and multi-turn conversational agents with the ai.chats module
  • Adding multimodal generation (text, image, audio) to web and Node.js applications
  • Implementing tool-using/agentic workflows via function calling and MCP tool integration
  • Building real-time voice/video assistants using the Live API’s bidirectional streaming sessions
  • Migrating between prototyping with a Gemini API key and production deployment on Vertex AI without rewriting client code

Under The Hood

Architecture - Isomorphic design split across src/node, src/web, and src/cross directories behind a shared public API in client.ts/index.ts; a single GoogleGenAI entry point composes focused submodules (Models, Chats, Caches, Files, Live, Tokens, Tunings, Batches, Operations, FileSearchStores) each in its own file, with an internal ApiClient (_api_client.ts) abstracting HTTP/auth differences between the Gemini Developer API and the Gemini Enterprise Agent Platform (Vertex AI) so the same application code can target either backend.

Tech Stack - Pure TypeScript compiled with Rollup into dual ESM/CJS bundles for Node and web, using google-auth-library for Vertex/enterprise auth, ws for the Live streaming/WebSocket API, protobufjs for the bundled SentencePiece tokenizer, and Microsoft’s api-extractor to generate and diff public API reports on every build; tests run on Jasmine with recorded system/integration suites.

Code Quality - Consistently documented with TSDoc comments on nearly every public type and method (types.ts alone is roughly 8,600 lines of typed request/response models), enforced via ESLint/Prettier and strict TypeScript; the public surface is intentionally kept small behind underscore-prefixed internal modules (_api_client, _transformers, _afc), though the sheer size of the generated types file is a maintenance-heavy artifact.

API Design - A single new GoogleGenAI({...}) client exposes cleanly namespaced submodules (ai.models, ai.chats, ai.caches, ai.files, ai.live), supports both one-shot and streaming generateContent calls, declarative function calling with JSON-schema tool definitions (including automatic function calling and native MCP tool support), and works identically whether authenticated via a simple API key or full enterprise credentials — a deliberately low-friction entry point for a very large capability surface.

Used by 24 apps in this directory

TypeScript
99%
Other

Activepieces

Automation · AI Assistants

23,887

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

32,102

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated today
TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,872

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
95
Repo Health
82
Technical
66
Dependency
Built with
TypeScript100%
Updated yesterday
TypeScript
99%
Other

byterover-cli

AI Agents · AI Code Assistants

4,941

A portable memory layer for AI coding agents — curate structured project knowledge into a version-controlled context tree that syncs across tools, machines, and teammates.

View details
77
Repo Health
83
Technical
71
Dependency
Built with
TypeScript99%
Updated 1 months ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
TypeScript
72%
MIT

Claude Context

AI Code Assistants

12,417

An MCP server and VS Code extension by Zilliz that turns your entire codebase into semantically searchable context for Claude Code, Cursor, and Gemini CLI, using vector embeddings and Merkle-tree change detection.

View details
55
Repo Health
71
Technical
72
Dependency
Built with
TypeScript72%
Python13%
JavaScript11%
Updated 1 months ago
TypeScript
97%
Apache 2.0

Cline

AI Code Assistants

66,453

An open-source AI coding agent that lives in your editor and terminal — reads and edits your codebase, runs commands, browses the web, and requires human approval for every action by default.

View details
90
Repo Health
74
Technical
67
Dependency
Built with
TypeScript97%
Updated today
TypeScript
84%
Apache 2.0

Continue

Developer Tools · AI Development · AI Code Assistants

35,532

Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.

View details
87
Repo Health
88
Technical
65
Dependency
Built with
TypeScript84%
Updated today
JavaScript
88%
GPL 3.0

Glass by Pickle

AI Assistants

7,577

A privacy-first desktop AI assistant that sees your screen, hears your meetings, and turns live context into structured summaries—without sending a single byte to the cloud.

View details
46
Repo Health
76
Technical
68
Dependency
Built with
JavaScript88%
TypeScript12%
Updated 9 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search