Skip to content

Integrates Hugging Face's Inference API into Genkit, allowing you to leverage Hugging Face models within the Genkit ecosystem.

Notifications You must be signed in to change notification settings

aciescrest/genkit-huggingface

Repository files navigation

Firebase Genkit Community Plugin

Community Plugin for Google Firebase Genkit


Built by Acies Crest ❤️

Hugging Face Genkit Plugin

This plugin integrates Hugging Face's Inference API into Genkit, allowing you to leverage Hugging Face models within the Genkit ecosystem.

Installation

To install the library, use npm:

npm install genkit-huggingface

Usage

Here is a simple example of how to use the genkit-huggingface library in your project:

import { genkit } from 'genkit';
import { huggingface } from 'genkit-huggingface';

const ai = genkit({
  plugins: [
    huggingface({
      apiKey: process.env.HUGGING_FACE_API_KEY,
      defaultModel: 'Qwen/Qwen2.5-Coder-32B-Instruct' // Or any other Hugging Face model name
    })
  ]
});

// Use the model
const response = await ai.generate({ model: 'huggingface-model', prompt: "Hello, how are you?" });
console.log(response);

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Contact

For any questions or issues, please open an issue on this repository.

About

Integrates Hugging Face's Inference API into Genkit, allowing you to leverage Hugging Face models within the Genkit ecosystem.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published