transformerjs-breadboard-kit

Paul Kinlan

A lot of the tools that I build that interact with LLMs are built with Breadboard. I needed to be able to run a number of tasks on the device that I have the board without using an LLM in the cloud. TransformerJS is a great API for JS developers to work with a number of different models that are hosted on HuggingFace. To get this working with breadboard I needed to create a Kit.... so here we are.

You can find the code here and if you are using breadboard you can install it as npm i @paulkinlan/transformerjs-breadboard-kit

To create an Breadboard agent you can do it as follows:

import { board } from "@google-labs/breadboard";
import { sentiment } from "@paulkinlan/transformerjs-breadboard-kit"

export default await board(({ text, model }) => {
    text.isString();
    model.isString();

    const summarynode = transformersjs.summarize({
      $id: "summary",
      input: text,
      model,
    });

    return summarynode.to(base.output());
  }).serialize({
  title: "Summary board",
  description: "Runs the summarization analysis with transformer JS",
  version: "0.0.2",
});

I lead the Chrome Developer Relations team at Google.

We want people to have the best experience possible on the web without having to install a native app or produce content in a walled garden.

Our team tries to make it easier for developers to build on the web by supporting every Chrome release, creating great content to support developers on web.dev, contributing to MDN, helping to improve browser compatibility, and some of the best developer tools like Lighthouse, Workbox, Squoosh to name just a few.

I love to learn about what you are building, and how I can help with Chrome or Web development in general, so if you want to chat with me directly, please feel free to book a consultation.

I'm trialing a newsletter, you can subscribe below (thank you!)