npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zhivex-ai/gemini

v0.8.3

Published

Gemini adapter for Zhivex AI SDK.

Readme

@zhivex-ai/gemini

Gemini adapter for Zhivex AI SDK.

Supports Gemini text, audio understanding, multimodal embeddings, speech, realtime sessions, grounded generation, Files API, File Search stores, URL Context, Context Caching, Batch API, Interactions, raw prediction calls, and Google generative media models exposed through Gemini API endpoints such as Gemini Image / Nano Banana, Imagen, Veo, and Lyria 3.

| Surface | Support | | --- | --- | | Text, tools, structured output, audio input | generateText() | | Multimodal embeddings | embeddingModel("gemini-embedding-2") | | Text-to-speech | speechModel() | | Live audio/text/image sessions | realtimeModel() | | Files API, File Search stores, Context Caching, Batch API, Interactions | high-level | | Google Search, URL Context, File Search, Code Execution, Computer Use | hosted tool helpers | | Image, video, music generation | high-level | | Other Gemini model endpoints | predictionModel() raw/prediction |

import {
  audioPart,
  createBatch,
  createContextCache,
  createFileSearchStore,
  createInteraction,
  embed,
  generateImage,
  generateMusic,
  generateSpeech,
  generateText,
  generateVideo,
  googleFileSearchTool,
  googleUrlContextTool,
  predictRaw,
  uploadFile
} from "@zhivex-ai/core";
import { createGemini } from "@zhivex-ai/gemini";

const gemini = createGemini({ apiKey: process.env.GEMINI_API_KEY });

await generateImage({
  model: gemini.imageGenerationModel!("gemini-3.1-flash-image"),
  prompt: "Create a product photo"
});

await generateText({
  model: gemini("gemini-3.5-flash"),
  messages: [
    {
      role: "user",
      parts: [
        { type: "text", text: "Summarize this recording." },
        audioPart({
          data: "BASE64_AUDIO",
          mediaType: "audio/wav"
        })
      ]
    }
  ]
});

await generateSpeech({
  model: gemini.speechModel!("gemini-3.1-flash-tts-preview"),
  input: "Welcome to Zhivex."
});

const live = await gemini.realtimeModel!("gemini-3.1-flash-live-preview").connect({
  inputAudioTranscription: true,
  outputAudioTranscription: true,
  outputAudioMediaType: "audio/pcm"
});
await live.close();

await embed({
  model: gemini.embeddingModel("gemini-embedding-2"),
  value: {
    uri: "gs://my-bucket/product-photo.png",
    mediaType: "image/png"
  }
});

await generateVideo({
  model: gemini.videoGenerationModel!("veo-3.1-generate-preview"),
  prompt: "Create a cinematic establishing shot"
});

await generateMusic({
  model: gemini.musicGenerationModel!("lyria-3-clip-preview"),
  prompt: "Create a short acoustic intro"
});

const file = await uploadFile({
  provider: gemini,
  data: "Gemini notes",
  mediaType: "text/plain",
  displayName: "notes.txt"
});

const store = await createFileSearchStore({ provider: gemini, displayName: "Docs" });

await generateText({
  model: gemini("gemini-3.5-flash"),
  prompt: "Use the indexed docs and URL context.",
  tools: {
    docs: googleFileSearchTool([store.name]),
    urls: googleUrlContextTool()
  }
});

await createContextCache({
  provider: gemini,
  modelId: "gemini-3.5-flash",
  contents: [{ role: "user", parts: [{ type: "file", data: file.uri ?? file.name, mediaType: "text/plain" }] }]
});

await createBatch({
  provider: gemini,
  modelId: "gemini-3.5-flash",
  requests: [{ request: { contents: [{ parts: [{ text: "Summarize this." }] }] } }]
});

await createInteraction({
  provider: gemini,
  modelId: "gemini-3.5-flash",
  input: "Run a deep research style interaction."
});

await predictRaw({
  model: gemini.predictionModel!("custom-gemini-endpoint"),
  instances: [{ prompt: "provider-specific request" }]
});

Model Garden-style coverage is intentionally raw/prediction based. The adapter does not add a dedicated wrapper for every Google model family.

Install

bun add @zhivex-ai/gemini

Repository and full documentation: