Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
An opensource framework for managing LLM knowledgebase and embeddings
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.
Supabase
cloud database service.mdx
files in the Next.js pages folder as training dataInstall headlessai with npm
npm install headlessai --save-dev
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 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.
Here's the planned roadmap for the project. This is subject to change, but it should give you an idea of what's coming.
init
and embed
as the main ones..mdx
vector embeddings for the GPT engine.pgvector
extension for storing vector embeddings.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.
FAQs
An opensource framework for managing LLM knowledgebase and embeddings
We found that headlessai demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.