mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-06-07 02:56:28 +00:00
Fixed the Qdrant edge dependency (#790)
This commit is contained in:
parent
5b5b6e0b28
commit
f47dd5fdc2
2239
runtime/Cargo.lock
generated
2239
runtime/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -48,7 +48,10 @@ tempfile = "3.27.0"
|
||||
strum_macros = "0.28.0"
|
||||
sysinfo = "0.39.3"
|
||||
bytes = "1.11.1"
|
||||
qdrant-edge = "0.6.1"
|
||||
qdrant-edge = "0.7.2"
|
||||
|
||||
[patch.crates-io]
|
||||
qdrant-edge = { git = "https://github.com/SommerEngineering/qdrant.git", rev = "462c84d82ced126e4a2b7914544bfde16a509eb1" }
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
windows-registry = "0.6.1"
|
||||
|
||||
82
runtime/patches/README.md
Normal file
82
runtime/patches/README.md
Normal file
@ -0,0 +1,82 @@
|
||||
# Runtime Patches
|
||||
|
||||
This directory documents temporary patches for third-party Rust dependencies.
|
||||
|
||||
## Qdrant Edge
|
||||
|
||||
AI Studio temporarily uses a pinned commit from `SommerEngineering/qdrant` for `qdrant-edge`.
|
||||
The fork commit exposes Qdrant's internal `lib/edge` crate as `qdrant-edge` and applies the
|
||||
trait-solver fix from Qdrant PR #9312.
|
||||
|
||||
When updating to a newer Qdrant Edge version, replace the placeholder values first:
|
||||
|
||||
```bash
|
||||
export QDRANT_EDGE_VERSION="0.7.2"
|
||||
export QDRANT_BRANCH="ai-studio-qdrant-edge-${QDRANT_EDGE_VERSION}"
|
||||
export AISTUDIO_REPO="xxx/mindwork-ai-studio"
|
||||
export QDRANT_REPO="xxx/qdrant"
|
||||
```
|
||||
|
||||
1. Sync the Qdrant fork with upstream:
|
||||
|
||||
```bash
|
||||
cd "$QDRANT_REPO"
|
||||
git remote add upstream https://github.com/qdrant/qdrant.git 2>/dev/null || true
|
||||
git fetch upstream
|
||||
git fetch origin
|
||||
git switch master
|
||||
git merge --ff-only upstream/master
|
||||
git push origin master
|
||||
```
|
||||
|
||||
2. Create a fresh AI Studio branch in the Qdrant fork:
|
||||
|
||||
```bash
|
||||
cd "$QDRANT_REPO"
|
||||
git switch -c "$QDRANT_BRANCH" master
|
||||
```
|
||||
|
||||
3. Apply the AI Studio patch if upstream has not released the fix yet:
|
||||
|
||||
```bash
|
||||
cd "$QDRANT_REPO"
|
||||
git apply "$AISTUDIO_REPO/runtime/patches/qdrant-edge-ai-studio.patch"
|
||||
```
|
||||
|
||||
4. Update the exposed `qdrant-edge` version in the fork:
|
||||
|
||||
```bash
|
||||
cd "$QDRANT_REPO"
|
||||
perl -0pi -e "s/name = \"qdrant-edge\"\\nversion = \"[^\"]+\"/name = \"qdrant-edge\"\\nversion = \"$ENV{QDRANT_EDGE_VERSION}\"/" lib/edge/Cargo.toml
|
||||
```
|
||||
|
||||
5. Commit and push the fork branch:
|
||||
|
||||
```bash
|
||||
cd "$QDRANT_REPO"
|
||||
git diff
|
||||
git add lib/edge/Cargo.toml lib/segment/src/common/anonymize.rs
|
||||
git commit -m "Expose qdrant-edge ${QDRANT_EDGE_VERSION} package for AI Studio"
|
||||
git push origin "$QDRANT_BRANCH"
|
||||
export QDRANT_EDGE_COMMIT="$(git rev-parse HEAD)"
|
||||
echo "$QDRANT_EDGE_COMMIT"
|
||||
```
|
||||
|
||||
6. Update AI Studio to use the new Qdrant Edge version and fork commit:
|
||||
|
||||
```bash
|
||||
cd "$AISTUDIO_REPO"
|
||||
perl -0pi -e "s/qdrant-edge = \"[^\"]+\"/qdrant-edge = \"$ENV{QDRANT_EDGE_VERSION}\"/" runtime/Cargo.toml
|
||||
perl -0pi -e "s/rev = \"[0-9a-f]+\"/rev = \"$ENV{QDRANT_EDGE_COMMIT}\"/" runtime/Cargo.toml
|
||||
```
|
||||
|
||||
7. Refresh the AI Studio lock file and verify the Rust runtime:
|
||||
|
||||
```bash
|
||||
cd "$AISTUDIO_REPO/runtime"
|
||||
cargo update -p qdrant-edge
|
||||
cargo check
|
||||
```
|
||||
|
||||
Remove the patch and the `[patch.crates-io]` override once Qdrant publishes a fixed `qdrant-edge`
|
||||
release on crates.io.
|
||||
26
runtime/patches/qdrant-edge-ai-studio.patch
Normal file
26
runtime/patches/qdrant-edge-ai-studio.patch
Normal file
@ -0,0 +1,26 @@
|
||||
diff --git a/lib/edge/Cargo.toml b/lib/edge/Cargo.toml
|
||||
index 7c2cf6037..d21e3c053 100644
|
||||
--- a/lib/edge/Cargo.toml
|
||||
+++ b/lib/edge/Cargo.toml
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
-name = "edge"
|
||||
-version = "0.1.0"
|
||||
+name = "qdrant-edge"
|
||||
+version = "0.7.2"
|
||||
authors = ["Qdrant Team <info@qdrant.tech>"]
|
||||
license = "Apache-2.0"
|
||||
edition = "2024"
|
||||
diff --git a/lib/segment/src/common/anonymize.rs b/lib/segment/src/common/anonymize.rs
|
||||
index 6b5d19b12..c73d24433 100644
|
||||
--- a/lib/segment/src/common/anonymize.rs
|
||||
+++ b/lib/segment/src/common/anonymize.rs
|
||||
@@ -105,7 +105,7 @@ where
|
||||
{
|
||||
collection_opt
|
||||
.as_ref()
|
||||
- .map(|c| anonymize_collection_values(c))
|
||||
+ .map(|c| anonymize_collection_values::<C, K, V>(c))
|
||||
}
|
||||
|
||||
impl Anonymize for String {
|
||||
@ -401,7 +401,7 @@ fn remove_obsolete_qdrant_sidecar_files<R: tauri::Runtime>(app_handle: &tauri::A
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(any(target_os = "windows", target_os = "macos"))]{
|
||||
if let Ok(current_exe) = std::env::current_exe() && let Some(exe_dir) = current_exe.parent() {
|
||||
if (exe_dir.to_string_lossy().contains("MindWork AI Studio")) {
|
||||
if exe_dir.to_string_lossy().contains("MindWork AI Studio") {
|
||||
paths.push(exe_dir.join("target").join("databases").join("qdrant"));
|
||||
paths.push(exe_dir.join("qdrant.exe"));
|
||||
paths.push(exe_dir.join("qdrant"));
|
||||
@ -452,6 +452,7 @@ fn edge_config(vector_size: usize) -> EdgeConfig {
|
||||
hnsw_config: hnsw_config(),
|
||||
quantization_config: None,
|
||||
optimizers: edge_optimizers_config(),
|
||||
wal_options: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user