{"id":26117042,"url":"https://github.com/elchemista/ex_fastembed","last_synced_at":"2025-09-07T01:09:25.274Z","repository":{"id":281041858,"uuid":"944015714","full_name":"elchemista/ex_fastembed","owner":"elchemista","description":"ExFastembed is an Elixir wrapper around the fastembed-rs crate.","archived":false,"fork":false,"pushed_at":"2025-05-12T12:23:10.000Z","size":34224,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T12:37:08.963Z","etag":null,"topics":["elixir","embeddings","fastembed","llm-inference","rustler"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elchemista.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":"2025-03-06T16:37:39.000Z","updated_at":"2025-05-12T12:23:14.000Z","dependencies_parsed_at":"2025-03-09T03:33:48.152Z","dependency_job_id":null,"html_url":"https://github.com/elchemista/ex_fastembed","commit_stats":null,"previous_names":["elchemista/fastembed-ex","elchemista/ex_fastembed"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/elchemista/ex_fastembed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fex_fastembed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fex_fastembed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fex_fastembed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fex_fastembed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elchemista","download_url":"https://codeload.github.com/elchemista/ex_fastembed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fex_fastembed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273983477,"owners_count":25202169,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["elixir","embeddings","fastembed","llm-inference","rustler"],"created_at":"2025-03-10T10:53:46.967Z","updated_at":"2025-09-07T01:09:25.260Z","avatar_url":"https://github.com/elchemista.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExFastembed\n\nExFastembed is an Elixir wrapper around the [fastembed-rs](https://github.com/Anush008/fastembed-rs) crate. It provides a simple interface to load various text embedding models and reranker models, generate embeddings for a list of texts, and rerank documents based on a query.\n\n## Installation\n\nAdd `ex_fastembed` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_fastembed, github: \"elchemista/ex_fastembed\", branch: \"master\"}\n  ]\nend\n```\n\nHow to compile:\n\n* Install clang (e.g., `sudo apt install clang`)\n* Install Rust (e.g., `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`)\n\n```bash\nexport CC=/usr/bin/clang CXX=/usr/bin/clang++ RUSTLER_PRECOMPILATION_EXAMPLE_BUILD=1 \u0026\u0026 mix compile\n```\n\n## Usage\n\n### Loading an Embedding Model\n\nBefore generating embeddings, you must load one of the supported text embedding models. For example, to load the `BAAI/bge-small-en-v1.5` model:\n\n```elixir\niex\u003e ExFastembed.load(\"BAAI/bge-small-en-v1.5\")\n#It returns either:\n# {:ok, dimension } when the model is successfully loaded, or\n# {:error, \"Model already loaded!\" } if it has been loaded previously.\n```\n\n### Generating Embeddings\n\nAfter loading the embedding model, you can generate embeddings for a list of texts:\n\n```elixir\niex\u003e ExFastembed.embed_text([\"Hello, world!\", \"Elixir is awesome\"])\n#Expected output:\n# {:ok, [[...], [...]] }\n```\n\n### Loading a Reranker Model\n\nTo load a reranker model, use the `load_reranker/1` function. For example, to load `jinaai/jina-reranker-v1-turbo-en`:\n\n```elixir\niex\u003e ExFastembed.load_reranker(\"jinaai/jina-reranker-v1-turbo-en\")\n#It returns either:\n# {:ok, true } when the model is successfully loaded, or\n# {:error, \"Reranker already loaded!\" } if it has been loaded previously.\n```\n\n### Reranking Documents\n\nOnce the reranker model is loaded, you can rerank documents based on a query:\n\n```elixir\niex\u003e ExFastembed.rerank(\"search query\", [\"Document 1\", \"Document 2\"], true)\n#Expected output:\n# {:ok, [{0, 0.95, \"Document 1\" }, {1, 0.90, \"Document 2\" }] }\n```\n\n## Supported Models\n\n### Embedding Models\n\n- `\"BAAI/bge-small-en-v1.5\"`\n- `\"sentence-transformers/all-MiniLM-L6-v2\"`\n- `\"sentence-transformers/all-MiniLM-L12-v2\"`\n- `\"mixedbread-ai/mxbai-embed-large-v1\"`\n- `\"Qdrant/clip-ViT-B-32-text\"`\n- `\"BAAI/bge-large-en-v1.5\"`\n- `\"BAAI/bge-small-zh-v1.5\"`\n- `\"BAAI/bge-base-en-v1.5\"`\n- `\"sentence-transformers/paraphrase-MiniLM-L12-v2\"`\n- `\"sentence-transformers/paraphrase-multilingual-mpnet-base-v2\"`\n- `\"lightonai/ModernBERT-embed-large\"`\n- `\"nomic-ai/nomic-embed-text-v1\"`\n- `\"nomic-ai/nomic-embed-text-v1.5\"`\n- `\"intfloat/multilingual-e5-small\"`\n- `\"intfloat/multilingual-e5-base\"`\n- `\"intfloat/multilingual-e5-large\"`\n- `\"Alibaba-NLP/gte-base-en-v1.5\"`\n- `\"Alibaba-NLP/gte-large-en-v1.5\"`\n\n### Reranker Models\n\n- `\"BAAI/bge-reranker-base\"`\n- `\"BAAI/bge-reranker-v2-m3\"`\n- `\"jinaai/jina-reranker-v1-turbo-en\"`\n- `\"jinaai/jina-reranker-v2-base-multiligual\"`\n\n## License\n\nExFastembed is released under the Apache License 2.0. See [LICENSE](LICENSE) for details.\n\n\n## Acknowledgments\n\nExFastembed is a wrapper around [fastembed-rs](https://github.com/Anush008/fastembed-rs), a fast Rust-based text embedding library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felchemista%2Fex_fastembed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felchemista%2Fex_fastembed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felchemista%2Fex_fastembed/lists"}