Replace Python embeddings with native Rust fastembed#325
Open
ijroth wants to merge 4 commits into
Open
Conversation
Replace the Python-based embeddings layer (via PyO3) with a pure Rust implementation using the fastembed crate. This eliminates the Python dependency for embedding generation, reducing complexity (venv management, script extraction, GIL overhead) while maintaining identical functionality. - Create src/embeddings/mod.rs with EmbeddingsService using fastembed crate - Move Model/Intent enums from python::embeddings to new embeddings module - Update read/write context structs and all consumers - Slim PythonService down to MCP-only (initialize_for_mcp) - Remove PythonLoggingLevel from AI config - Delete src/python/embeddings.rs and Python embedding scripts - Update import paths across ~30 files Python/PyO3 is retained solely for the MCP service. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove all Python/PyO3 dependencies (pyo3, serde-pyobject, include_dir), the Python MCP module, and Python setup from CI, Docker, and the binary entrypoint. The update_mcp_endpoint handler (which only uses WriteSide) is preserved in admin.rs. Replace the single-platform release workflow with a matrix strategy building for linux-x86_64, macos-arm64, macos-x86_64, and windows-x86_64 (3 binary variants each). Simplify Dockerfiles to two-stage Rust-only builds with debian:bookworm-slim runtime. Fix flaky vector search test by adding similarity thresholds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Apple has discontinued Intel Macs and the macos-13 runner is deprecated. Drop the x86_64-apple-darwin target from the release workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ci: remove macos-x86_64 from release build matrix
|
ijroth seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fastembedcraterequirements.txt,requirements-cpu.txt, pyo3 bindings, Python scripts)Changes
src/embeddings/mod.rs— New native Rust embedding module replacingsrc/python/src/python/— Entire directory removed (embeddings, MCP, scripts).github/workflows/— CI and release builds updated for cross-platform matrix strategydocker/— Dockerfiles simplified without PythonCargo.toml— Swapped pyo3 for fastembed crateTest plan
cargo buildsucceedscargo test --allpasses🤖 Generated with Claude Code