Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

headlessai

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

headlessai

An opensource framework for managing LLM knowledgebase and embeddings

  • 0.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

HeadlessAI

HeadlessAI is a powerful npm library that allows developers to train their own GPT models using custom documentation data from .mdx fies in a nextjs project. 🤖🧠🚀

If you need complete documentation, please visit headlessai.dev.

Features

  • 🔍 Ability to train your own GPT model using custom documentation data
  • 🌐 Seamless integration with Supabase cloud database service
  • 📄 Use of existing .mdx files in the Next.js pages folder as training data
  • 🧬 Ability to create and update embeddings for the training data
  • 🛣️ Upcoming updates and features outlined in the project roadmap
  • 🧠 Potential to create human-like responses for various applications and industries.

Installation

Install headlessai with npm

npm install headlessai --save-dev

Usage

Run the following command to create the headlessai.config.js file in the root of your project:

npx headlessai@latest init

This will create a headlessai.config.js file at the root of your project.

// ./headlessai.config.js
module.exports = {
  ignored: ['pages/_error.mdx', 'pages/404.mdx'],
  supabase: {
    key: 'SUPABASE_KEY',
    url: 'SUPABASE_URL',
    options: {
      auth: {
        persistSession: false,
        autoRefreshToken: false,
      },
    },
  },
  openai: {
    key: 'OPENAI_KEY',
    model: 'text-embedding-ada-002',
  },
}
  • ignoredFiles - An array of files to ignore when generating the search index. This is useful for files not meant to be indexed, such as 404 pages.
  • supabase - The Supabase configuration object. You can find your Supabase key and url in your Supabase project settings.
  • openai - The OpenAI configuration object. You can find your OpenAI key in your OpenAI dashboard.

Add package.json script

Add the following script to your package.json file:

{
  "scripts": {
    "embed": "headlessai embed"
  }
}

You can also add the script to the nextjs build script:

{
  "scripts": {
    "build": "next build && headlessai embed"
  }
}

This command would create the embeddings from your markdown files and store them in the Supabase database.

This command also saves the checksums of the markdown files in the Supabase database. This is used to check if the markdown files have changed since the last time the embeddings were created. If the markdown files have changed, the embeddings are recreated and stored in the Supabase database.

Roadmap

Here's the planned roadmap for the project. This is subject to change, but it should give you an idea of what's coming.

HeadlessAI CLI

  • 📦 Create a GitHub project to store the CLI functions wrapped in an npm package.
  • 🏃‍♂️ Add commands to the CLI, starting with init and embed as the main ones.
  • 🌐 Add supabase support to store the .mdx vector embeddings for the GPT engine.
  • 🧩 Add support for a storage adapter to allow developers to extend the CLI to support other storage adapters.
  • 🛠️ Add support for supabase migrations to initialize the pgvector extension for storing vector embeddings.
  • 🗄️ Add support for supabase migrations to create the required tables for the embeddings.

NextJS Components

The components library will be a collection of headless, unstyled components that can be used to build an AI-powered chatbot using the GPT Engine and the HeadlessAI CLI.

  • 🤝 Create an API handler to manage the requests to the GPT Engine.
  • 🎣 Create hooks to handle the requests to the GPT Engine.
  • 🔎 Create an API handler for Next.js to access the supabase vector database.

License

MIT

Keywords

FAQs

Package last updated on 17 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc