{"id":17527100,"url":"https://github.com/Anush008/fastembed-js","last_synced_at":"2025-03-06T06:31:36.938Z","repository":{"id":195260894,"uuid":"692656035","full_name":"Anush008/fastembed-js","owner":"Anush008","description":"Library to generate vector embeddings in NodeJS","archived":false,"fork":false,"pushed_at":"2024-11-17T17:27:48.000Z","size":1141,"stargazers_count":105,"open_issues_count":4,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-26T05:54:46.324Z","etag":null,"topics":["embeddings","rag","retrieval","retrieval-augmented-generation","vector-search"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fastembed/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anush008.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-17T07:00:31.000Z","updated_at":"2025-02-24T20:20:51.000Z","dependencies_parsed_at":"2023-09-17T07:34:41.825Z","dependency_job_id":"a3092b5e-bc13-49f0-9aa0-903ac5d05f8a","html_url":"https://github.com/Anush008/fastembed-js","commit_stats":{"total_commits":66,"total_committers":1,"mean_commits":66.0,"dds":0.0,"last_synced_commit":"06e425d1440df04ce3ac09b77e08ca6db57fb59d"},"previous_names":["anush008/fastembed"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anush008%2Ffastembed-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anush008%2Ffastembed-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anush008%2Ffastembed-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anush008%2Ffastembed-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anush008","download_url":"https://codeload.github.com/Anush008/fastembed-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242161782,"owners_count":20081941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embeddings","rag","retrieval","retrieval-augmented-generation","vector-search"],"created_at":"2024-10-20T15:03:09.763Z","updated_at":"2025-03-06T06:31:36.684Z","avatar_url":"https://github.com/Anush008.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003ca href=\"https://www.npmjs.com/package/fastembed\"\u003eFastEmbed-js ⚡️\u003c/a\u003e\u003c/h1\u003e\n  \u003ch3\u003eTypescript/NodeJS implementation of \u003ca href=\"https://github.com/qdrant/fastembed\" target=\"_blank\"\u003e@Qdrant/fastembed\u003c/a\u003e\u003c/h3\u003e\n  \u003ca href=\"https://www.npmjs.com/package/fastembed\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/fastembed.svg\" alt=\"Crates.io\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Anush008/fastembed-js/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-mit-blue.svg\" alt=\"MIT Licensed\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Anush008/fastembed-js/actions/workflows/release.yml\"\u003e\u003cimg src=\"https://github.com/Anush008/fastembed-js/actions/workflows/release.yml/badge.svg?branch=main\" alt=\"Semantic release\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## 🍕 Features\n* Supports CommonJS and ESM.\n* Uses [@anush008/tokenizers](https://github.com/Anush008/tokenizers) multi-arch native bindings for [@huggingface/tokenizers](https://github.com/huggingface/tokenizers).\n* Supports batch embedddings with generators.\n\nThe default model is Flag Embedding, which is top of the [MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard.\n\n## 🔍 Not looking for Javascript?\n\n- Python 🐍: [fastembed](https://github.com/qdrant/fastembed)\n- Rust 🦀: [fastembed-rs](https://github.com/Anush008/fastembed-rs)\n- Go 🐳: [fastembed-go](https://github.com/Anush008/fastembed-go)\n\n## 🤖 Models\n\n- [**BAAI/bge-base-en**](https://huggingface.co/BAAI/bge-base-en)\n- [**BAAI/bge-base-en-v1.5**](https://huggingface.co/BAAI/bge-base-en-v1.5)\n- [**BAAI/bge-small-en**](https://huggingface.co/BAAI/bge-small-en)\n- [**BAAI/bge-small-en-v1.5**](https://huggingface.co/BAAI/bge-small-en-v1.5) - Default\n- [**BAAI/bge-base-zh-v1.5**](https://huggingface.co/BAAI/bge-base-zh-v1.5)\n- [**sentence-transformers/all-MiniLM-L6-v2**](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)\n- [**intfloat/multilingual-e5-large**](https://huggingface.co/intfloat/multilingual-e5-large)\n\n\n## 🚀 Installation\n\nTo install the FastEmbed library, npm works: \n\n```bash\nnpm install fastembed\n```\n\n## 📖 Usage\n\n```js\nimport { EmbeddingModel, FlagEmbedding } from \"fastembed\";\n// For CommonJS\n// const { EmbeddingModel, FlagEmbedding } = require(\"fastembed)\n\nconst embeddingModel = await FlagEmbedding.init({\n    model: EmbeddingModel.BGEBaseEN\n});\n\nlet documents = [\n    \"passage: Hello, World!\",\n    \"query: Hello, World!\",\n    \"passage: This is an example passage.\",\n    // You can leave out the prefix but it's recommended\n    \"fastembed-js is licensed under MIT\" \n];\n\nconst embeddings = embeddingModel.embed(documents, 2); //Optional batch size. Defaults to 256\n\nfor await (const batch of embeddings) {\n    // batch is list of Float32 embeddings(number[][]) with length 2\n    console.log(batch);\n}\n\n```\n\n#### Supports passage and query embeddings for more accurate results\n```ts\nconst embeddings = embeddingModel.passageEmbed(listOfLongTexts, 10); //Optional batch size. Defaults to 256\n\nfor await (const batch of embeddings) {\n    // batch is list of Float32 passage embeddings(number[][]) with length 10\n    console.log(batch);\n}\n\nconst queryEmbeddings: number[] = await embeddingModel.queryEmbed(userQuery);\nconsole.log(queryEmbeddings)\n\n```\n\n## 🚒 Under the hood\n\n### Why fast?\n\nIt's important we justify the \"fast\" in FastEmbed. FastEmbed is fast because:\n\n1. Quantized model weights\n2. ONNX Runtime which allows for inference on CPU, GPU, and other dedicated runtimes\n\n### Why light?\n1. No hidden dependencies via Huggingface Transformers\n\n### Why accurate?\n1. Better than OpenAI Ada-002\n2. Top of the Embedding leaderboards e.g. [MTEB](https://huggingface.co/spaces/mteb/leaderboard)\n\n## © LICENSE\n\nMIT © [2023](https://github.com/Anush008/fastembed-js/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnush008%2Ffastembed-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAnush008%2Ffastembed-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnush008%2Ffastembed-js/lists"}