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

gemini-nano-prompt

v1.0.5

Published

A lightweight wrapper for the Gemini Nano package, designed to simplify interactions and streamline the integration process. This wrapper enhances usability by providing a more intuitive interface for utilizing Gemini Nano's features.

Readme

Gemini Nano Wrapper - A client-side built-in AI Model for the web browser [Chrome] Read Google docs

A lightweight wrapper for the Gemini Nano package, designed to simplify interactions and streamline the integration process. This wrapper enhances usability by providing a more intuitive interface for utilizing Gemini Nano's features.

This Wrapper is built on top of the browser's in-built Gemini nano which is window.ai just plug it and start using prompts.

image

Table of Contents

Installation

Since this is an experimental feature, for the initial setup please Refer the documentation, Please make sure the code is running in your local browser this setup is not for the server.

To install the Gemini Nano Wrapper, use npm:

npm install gemini-nano-prompt

Usage

Let's start, It's simple to use:

import GeminiNano from "gemini-nano-prompt";

let geminiNano = new GeminiNano(); // by default topK : 3 and temperature : 0.8

let response = await geminiNano.prompt("Hi What is Gemini Nano");

console.log("This is a Gemini response :", response);

for Fine tuning

import GeminiNano from "gemini-nano-prompt";

let geminiNano = new GeminiNano( { topK : 8 , temperature : 0. 9 } );

let response = await geminiNano.prompt("Hi What is Gemini Nano");

console.log("This is a Gemini response :", response);

API

The following are the API Interface:

constructor

interface CustomCapabilities {
   topK : Number,
   temperature : Number
}

constructor(customCapabilities?: CustomCapabilities )

Methods

Checks environment for required specification and Create a session for prompting( pass assistant) or summarize(pass summarizer) returns session created sucessfully or not

public async createSession(sessionType: "assistant" | "summarizer" = "assistant"): Promise<boolean>

closes a session : please close session every time for better browser performace

public closeSession(): void 

use this for prompting this will automatically checks browser requirement and checks the eligibilty for gemini nano and creates and closes a session for every prompt call

public async prompt(query: string): Promise<{ response: any } | void>

use this for getting summury this will automatically checks browser requirement and checks the eligibilty for gemini nano and creates and closes a session for every prompt call

public async summarizer(query: string): Promise<{ response: any } | void>

Examples

import GeminiNano from "gemini-nano-prompt";

class Prompt {
   constructor() {}
   async getFAQs(listOfTopics, question) {
    let geminiNano = new GeminiNano()
    let prompt = `Answer the Questions Only related topics which is : ${listOfTopics} The Question is : ${question} if is not relavent topics: ${listOfTopics} Rspond with a Apology note`;
    console.log(prompt);

    let result = await geminiNano.prompt(prompt)
    return result;
   }
}

const prompt = new Prompt();
export default prompt

image

Contributing

Thank you for considering contributing to My Project! We appreciate your help in making this project better. Here are some guidelines to help you get started.

How to Contribute

1. Fork the Repository

  1. Click the "Fork" button at the top right of this page.
  2. This will create a copy of the repository in your GitHub account.

2. Clone the Forked Repository

Clone your forked repository to your local machine using the following command:

git clone [https://github.com/your-username/my-project.git](https://github.com/Rajath2000/gemini-nano-web.git)

3. Install dependency

npm install

4.Make changes, commit, create a pull request.

License

This project is licensed under the ISC License.

ISC License

ISC License

Copyright (c) [2024] [Rajath M R]

Permission to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, is hereby granted, free of charge, subject to the following conditions:

THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.