Skip to content

Commit 687393e

Browse files
SecAI-Hubclaude
andcommitted
Extract search-mediator to standalone repo (SecAI-Hub/llm-search-mediator)
Update build-services.sh to clone from the standalone llm-search-mediator repo with graceful fallback, and remove search-mediator from CI lint (it has its own CI workflow now). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8f93bc7 commit 687393e

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ jobs:
8181
python -m py_compile services/quarantine/quarantine/pipeline.py
8282
python -m py_compile services/quarantine/quarantine/watcher.py
8383
python -m py_compile services/ui/ui/app.py
84-
python -m py_compile services/search-mediator/app.py
8584
python -m py_compile services/diffusion-worker/app.py
8685
python -m py_compile services/common/audit_chain.py
8786
python -m py_compile services/common/auth.py

files/scripts/build-services.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,30 @@ mkdir -p "$DIFFUSION_DIR"
115115
cp /tmp/services/diffusion-worker/app.py "$DIFFUSION_DIR/app.py"
116116
echo " -> ${DIFFUSION_DIR}/app.py"
117117

118-
# Search mediator
119-
echo "Installing: search-mediator"
118+
# --- llm-search-mediator (standalone: privacy-preserving search bridge) ---
119+
echo "Installing: llm-search-mediator"
120120
SEARCH_DIR="/opt/secure-ai/services/search-mediator"
121121
mkdir -p "$SEARCH_DIR"
122-
cp /tmp/services/search-mediator/app.py "$SEARCH_DIR/app.py"
123-
cat > "${INSTALL_DIR}/search-mediator" <<'WRAPPER'
122+
if [ -d "/tmp/llm-search-mediator" ]; then
123+
cp -r /tmp/llm-search-mediator "${SRC_DIR}/llm-search-mediator"
124+
else
125+
git clone --depth 1 https://github.com/SecAI-Hub/llm-search-mediator.git "${SRC_DIR}/llm-search-mediator" 2>/dev/null || \
126+
echo "WARNING: llm-search-mediator clone failed — search mediator will not be available"
127+
fi
128+
if [ -d "${SRC_DIR}/llm-search-mediator" ]; then
129+
cp -r "${SRC_DIR}/llm-search-mediator/search_mediator" "$SEARCH_DIR/"
130+
pip3 install --prefix=/usr --no-cache-dir -r "${SRC_DIR}/llm-search-mediator/requirements.txt" 2>/dev/null || \
131+
pip3 install --prefix=/usr --break-system-packages --no-cache-dir -r "${SRC_DIR}/llm-search-mediator/requirements.txt"
132+
cat > "${INSTALL_DIR}/search-mediator" <<'WRAPPER'
124133
#!/usr/bin/env python3
125134
import sys
126135
sys.path.insert(0, "/opt/secure-ai/services/search-mediator")
127-
from app import main
136+
from search_mediator.app import main
128137
main()
129138
WRAPPER
130-
chmod +x "${INSTALL_DIR}/search-mediator"
131-
echo " -> ${INSTALL_DIR}/search-mediator"
139+
chmod +x "${INSTALL_DIR}/search-mediator"
140+
echo " -> ${INSTALL_DIR}/search-mediator"
141+
fi
132142

133143
# HuggingFace CLI (for model downloads)
134144
echo "Installing: huggingface-hub"

0 commit comments

Comments
 (0)