Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ct/hindsight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ function update_script() {
msg_info "Updating Python Environment"
cd /opt/hindsight
$STD uv sync --locked --package hindsight-api-slim --extra local-ml
HOME=/opt/hindsight_data $STD /opt/hindsight/.venv/bin/python -c "from sentence_transformers import SentenceTransformer, CrossEncoder; from hindsight_api.config import DEFAULT_EMBEDDINGS_LOCAL_MODEL as E, DEFAULT_RERANKER_LOCAL_MODEL as R; SentenceTransformer(E); CrossEncoder(R)"
if ! grep -q '^HF_HUB_OFFLINE=' /opt/hindsight.env; then
cat <<EOF >>/opt/hindsight.env
HF_HUB_OFFLINE=1
EOF
fi
msg_ok "Updated Python Environment"

msg_info "Starting Hindsight"
Expand Down
6 changes: 4 additions & 2 deletions install/hindsight-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ msg_ok "Set up Python Environment"

msg_info "Downloading Embedding and Reranker Models"
mkdir -p /opt/hindsight_data
HOME=/opt/hindsight_data $STD /opt/hindsight/.venv/bin/python -c "from sentence_transformers import SentenceTransformer, CrossEncoder; SentenceTransformer('BAAI/bge-small-en-v1.5'); CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')"
HOME=/opt/hindsight_data $STD /opt/hindsight/.venv/bin/python -c "from sentence_transformers import SentenceTransformer, CrossEncoder; from hindsight_api.config import DEFAULT_EMBEDDINGS_LOCAL_MODEL as E, DEFAULT_RERANKER_LOCAL_MODEL as R; SentenceTransformer(E); CrossEncoder(R)"
msg_ok "Downloaded Embedding and Reranker Models"

msg_info "Configuring Hindsight"
Expand All @@ -43,6 +43,8 @@ HINDSIGHT_API_LLM_BASE_URL=${var_llm_base_url:-}
TRANSFORMERS_VERBOSITY=error
HF_HUB_VERBOSITY=error
TOKENIZERS_PARALLELISM=false
# models are cached at install; online, startup stalls on a slow huggingface.co (vectorize-io/hindsight#6494)
HF_HUB_OFFLINE=1
EOF
sed -i '/=$/d' /opt/hindsight.env
chmod 600 /opt/hindsight.env
Expand Down Expand Up @@ -78,7 +80,7 @@ EOF
systemctl enable -q --now hindsight
msg_ok "Created Service"

if [[ -z "${var_llm_provider:-}" ]]; then
if [[ "${var_llm_provider:-none}" == "none" ]]; then
msg_warn "No LLM configured: Hindsight stores plain chunks only. Set HINDSIGHT_API_LLM_PROVIDER and its key in /opt/hindsight.env, then run systemctl restart hindsight"
fi

Expand Down
3 changes: 2 additions & 1 deletion json/hindsight.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"name": "var_llm_provider",
"label": "LLM Provider",
"type": "text",
"help": "Empty for none: memories are stored as plain chunks, without fact extraction or reflect. Otherwise openai, anthropic, gemini, groq, ollama, lmstudio and others; see https://hindsight.vectorize.io/developer/models"
"default": "none",
"help": "none: memories are stored as plain chunks, without fact extraction or reflect. Otherwise openai, anthropic, gemini, groq, ollama, lmstudio and others; see https://hindsight.vectorize.io/developer/models"
},
{
"name": "var_llm_api_key",
Expand Down
Loading