Skip to main content
Introducing packages.sweber.dev
Documentation menuCosine Pro

Cosine Pro

Plugins for Vite, Next.js, Docusaurus, VitePress and Astro, per-language models, and search insights that show what your docs are missing.

Cosine Pro adds what you need once search runs on more than one site: the index builds itself, and you see what people look for and do not find.

PackageWhat it does
@weber-development/cosine-viteBuilds the index in every Vite build (Astro, VitePress, SvelteKit, Nuxt), serves it in dev, rebuilds on change and re-embeds only the sections that changed
@weber-development/cosine-nextBuilds the index from the pages next build has prerendered and keeps the last index in .next/cache, so CI rebuilds embed only what changed
@weber-development/cosine-migrateTurns an Algolia DocSearch export and its synonyms into a Cosine index
@weber-development/cosine-insightsRecords searches without tracking people and reports queries without results, results nobody opened, the most searched topics and how they change from period to period
@weber-development/cosine-answersQuotes the sentence that answers the question above the results, with a link to the page, without an LLM
@weber-development/cosine-qualityGolden queries: write down which page must answer which search and let CI fail when a change makes search worse
@weber-development/cosine-i18nOne index per page language, each with its own model: English pages use the small model, other languages the multilingual one, and visitors download only the model of the language they read
@weber-development/cosine-docusaurusDocusaurus plugin and search bar theme: the index per locale, with cache and shards
@weber-development/cosine-vitepressVitePress config wrapper and theme that puts the search field in the nav bar
@weber-development/cosine-astroAstro integration and Starlight plugin that replaces the built-in search

Licence and plans

Plans and prices are on packages.sweber.dev/cosine. After cancelling a subscription, the versions you installed keep working; only updates and access to new versions end.

Installation

The packages are delivered through GitHub Packages. After purchase you get read access to the repository Weber-Development/cosine-pro-dist, which contains the full installation guide. In short:

.npmrc

@weber-development:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${COSINE_PRO_TOKEN}
npm i @sweberdev/cosine @huggingface/transformers @weber-development/cosine-insights
npm i -D @weber-development/cosine-vite   # or cosine-next for Next.js