Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to python 3.11, remove poetry for uv, move to lazy loading in app.py #85

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
4d23861
Upgrade to python 3.11, remove poetry for uv, move to lazy loading in…
morganmcg1 Dec 26, 2024
ed0b3d9
ruff fixes
morganmcg1 Dec 26, 2024
284ad1d
run black
morganmcg1 Dec 26, 2024
94adeca
update to weave.op
morganmcg1 Dec 26, 2024
324164e
Update pyproject.toml
morganmcg1 Dec 26, 2024
6cbabe3
remove poetry.lock
morganmcg1 Dec 26, 2024
960c2a4
add disk-usage route
morganmcg1 Dec 26, 2024
f9bceb2
fix disk usage
morganmcg1 Dec 26, 2024
25941a9
add no-user to installs
morganmcg1 Dec 26, 2024
47bc78b
simple, newer .replit file
morganmcg1 Dec 26, 2024
143a06c
Update README
morganmcg1 Dec 26, 2024
182c667
add clear pip cache
morganmcg1 Dec 26, 2024
8eae613
add disk usage increment logging
morganmcg1 Dec 26, 2024
5d40093
Add dotenv for better devX
morganmcg1 Dec 26, 2024
a520738
add bulid.sh debug disk usage logging
morganmcg1 Dec 26, 2024
380527d
add top 20 disk usage logging
morganmcg1 Dec 26, 2024
8d81f01
tidy up
morganmcg1 Dec 26, 2024
555d433
add wandb cache cleanup
morganmcg1 Dec 26, 2024
eaeedc5
readme
morganmcg1 Dec 26, 2024
825741e
Update readme
morganmcg1 Dec 27, 2024
a8cefd7
Add args and configs to eval script, update reqs, update readme
morganmcg1 Dec 27, 2024
eea41f0
update env var, rename main.py to eval
morganmcg1 Dec 27, 2024
e06ab67
Remove langchain-cohere
morganmcg1 Dec 27, 2024
230e0bf
disable feedback logging for now
morganmcg1 Dec 27, 2024
41f2bfb
Readme
morganmcg1 Dec 27, 2024
822ff1a
remove feedback
morganmcg1 Dec 31, 2024
a58d27a
remove poetry lock and eval deps
morganmcg1 Dec 31, 2024
b0893be
add eval_requiremnts.txt
morganmcg1 Dec 31, 2024
bf65a39
OpenHands: Add native chromadb implementation with optimized MMR search
openhands-agent Jan 1, 2025
8f47776
OpenHands: Switch to native chromadb with numpy 2.2.0 support
openhands-agent Jan 1, 2025
03fb31b
OpenHands: Update chromadb to 0.6.0 for numpy 2.2.0 compatibility
openhands-agent Jan 1, 2025
a3a1fdd
python 3.12, add retries for evals
morganmcg1 Jan 1, 2025
8567ba1
Merge branch 'make_wandbot_great_again' of https://github.com/wandb/w…
morganmcg1 Jan 1, 2025
17df3fb
update eval naming and logging
morganmcg1 Jan 2, 2025
dcdb23d
Add validation error retry to query enhancer chain
morganmcg1 Jan 2, 2025
914a1e9
update default index artifact, add config logging to evals
morganmcg1 Jan 2, 2025
6dc42da
remove emojis from disk usage message
morganmcg1 Jan 3, 2025
7c2d779
formatting
morganmcg1 Jan 3, 2025
b43c2d6
update readme
morganmcg1 Jan 3, 2025
cf8a633
modify similarity search in retrieval
morganmcg1 Jan 3, 2025
e0a54f4
Replace langchain-chroma with native ChromaDB implementation
openhands-agent Jan 4, 2025
6ace947
remove mistaken openhands chroma commit
morganmcg1 Jan 5, 2025
8c0ea03
rename chroma wrapper
morganmcg1 Jan 5, 2025
e91d81b
Fix native ChromaDB implementation to match langchain-chroma behavior
openhands-agent Jan 5, 2025
0ce71f5
remove langchain embeddings, add native embeddings models
morganmcg1 Jan 5, 2025
8b5b856
make EmbeddingsModel callable
morganmcg1 Jan 5, 2025
60c66f3
Centralise all configs
morganmcg1 Jan 6, 2025
4ad024c
fix configs
morganmcg1 Jan 6, 2025
66313fc
prompt updates
morganmcg1 Jan 6, 2025
61ddd45
update readme
morganmcg1 Jan 6, 2025
f6e4f7b
increase retries for query handler
morganmcg1 Jan 6, 2025
255cd3f
Add e2b dockerfile
morganmcg1 Jan 8, 2025
80278d4
update docker file
morganmcg1 Jan 8, 2025
0da7bdc
docker fixes
morganmcg1 Jan 8, 2025
b6fd1d6
Update readme and dockerfile
morganmcg1 Jan 9, 2025
d52c23d
add docker temp dir clearnup
morganmcg1 Jan 9, 2025
c002c88
Use code interpreter with python 3.12
jakubno Jan 9, 2025
67a7005
Merge pull request #87 from jakubno/make_wandbot_great_again
morganmcg1 Jan 9, 2025
a3d0714
fix retry in query handler
morganmcg1 Jan 9, 2025
51afeb4
tidy up configs app routes, tidy up web search
morganmcg1 Jan 9, 2025
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
17 changes: 13 additions & 4 deletions .replit
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
run = "bash run.sh"
entrypoint = "main.py"
modules = ["python-3.10:v18-20230807-322e88b"]

disableInstallBeforeRun = true

hidden = [".pythonlibs"]
modules = ["cpp-clang14"]

[nix]
channel = "stable-23_05"
channel = "stable-24_05"
packages = [
"gcc",
"gcc.cc.lib",
"libstdcxx5",
"stdenv.cc.cc.lib"
]

[deployment]
run = ["sh", "-c", "bash run.sh"]
build = ["sh", "-c", "bash build.sh"]
deploymentTarget = "gce"

[env]
REPLIT_DISABLE_PACKAGE_LAYER = "1"

[[ports]]
localPort=8000
externalPort=80
localPort = 8000
externalPort = 80
47 changes: 44 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,45 @@
pip install fasttext && \
poetry install --without dev --all-extras && \
poetry build && \
echo "Running build.sh"
set -x # Enable command echo
set -e # Exit on error

# Find libstdc++ to use
for dir in /nix/store/*-gcc-*/lib64 /nix/store/*-stdenv-*/lib /nix/store/*-libstdc++*/lib; do
echo "Checking directory: $dir" # Add this line for debugging
if [ -f "$dir/libstdc++.so.6" ]; then
export LD_LIBRARY_PATH="$dir:$LD_LIBRARY_PATH"
echo "Found libstdc++.so.6 in $dir"
break
fi
done

# Create virtualenv & set up
rm -rf .venv
python3.11 -m venv .venv
export VIRTUAL_ENV=.venv
export PATH="$VIRTUAL_ENV/bin:$PATH"
export PYTHONPATH="$(pwd)/src:$PYTHONPATH"

# Use uv for faster installs
pip install pip --upgrade
pip install uv --upgrade --no-cache

# Clear any existing installations that might conflict
rm -rf $VIRTUAL_ENV/lib/python*/site-packages/typing_extensions*
rm -rf $VIRTUAL_ENV/lib/python*/site-packages/pydantic*
rm -rf $VIRTUAL_ENV/lib/python*/site-packages/fastapi*

# Install dependencies
uv pip install -r requirements.txt --no-cache

# Re-install problematic package
uv pip install --no-cache-dir --force-reinstall typing_extensions==4.11.0

# Install app
uv pip install -e .

mkdir -p ./data/cache

# Debug information
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
ls -la $LIBSTDCXX_DIR/libstdc++.so* || true
ldd $VIRTUAL_ENV/lib/python*/site-packages/pandas/_libs/*.so || true
5,877 changes: 3,090 additions & 2,787 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/wandb/wandbot"
include = ["src/**/*", "LICENSE", "README.md"]

[tool.poetry.dependencies]
python = ">=3.10.0,<=3.12.4"
python = ">=3.10.0,<=3.13"
numpy = "^1.26.1"
pandas = "^2.1.2"
pydantic-settings = "^2.0.3"
Expand Down
37 changes: 29 additions & 8 deletions replit.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
{pkgs}: {
deps = [
pkgs.bash
pkgs.hydrus
pkgs.gitFull
pkgs.glibcLocales
pkgs.python311
{ pkgs }: {
deps = with pkgs; [
# Core system libraries
stdenv.cc.cc.lib
libstdcxx5

# Make sure gcc and its runtime are available
gcc
gcc.cc.lib

# Other dependencies
bash
hydrus
gitFull
glibcLocales
python311
];
}

env = {
APPEND_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
NIXPKGS_ALLOW_UNFREE = "1";
LD_LIBRARY_PATH = let
libraries = [
pkgs.stdenv.cc.cc.lib
pkgs.libstdcxx5
pkgs.gcc.cc.lib
];
in "${pkgs.lib.makeLibraryPath libraries}";
};
}
38 changes: 38 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
numpy>=1.26.1
pandas>=2.1.2
pydantic>=2.10.0
pydantic-settings>=2.5.1
gitpython>=3.1.40
giturlparse>=0.12.0
scikit-learn>=1.3.2
python-dotenv>=1.0.0
slack-bolt>=1.18.0
slack-sdk>=3.21.3
discord>=2.3.2
markdown>=3.5.1
fastapi>=0.115.0
tree-sitter-languages>=1.7.1
markdownify>=0.11.6
uvicorn>=0.24.0
openai>=1.58.1
weave>=0.51.25
colorlog>=6.8.0
litellm>=1.55.4
google-cloud-bigquery>=3.14.1
db-dtypes>=1.2.0
python-frontmatter>=1.1.0
pymdown-extensions>=10.5
langchain>=0.3.10
langchain-openai>=0.2.14
langchain-experimental>=0.3.3
langchain-core>=0.3.27
langchain-cohere>=0.3.3
langchain-chroma>=0.1.2
simsimd==3.7.7
nbformat>=5.10.4
nbconvert>=7.16.4
wandb[workspaces]>=0.19.0
tree-sitter==0.21.3
typing_extensions>=4.12.0
nest-asyncio==1.6.0
fasttext-wheel
31 changes: 27 additions & 4 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
(uvicorn wandbot.api.app:app --host="0.0.0.0" --port=8000) & \
(python -m wandbot.apps.slack -l en) & \
(python -m wandbot.apps.slack -l ja) & \
(python -m wandbot.apps.discord)
set -e # Exit on error

# Ensure we're using the virtual environment from build.sh
export VIRTUAL_ENV=.venv
export PATH="$VIRTUAL_ENV/bin:$PATH"
export PYTHONPATH="$(pwd)/src:$PYTHONPATH"

echo "Starting Wandbot application..."

# Function to start a service with logging to stdout
start_service() {
echo "Starting service: $*"
"$@" || {
echo "Failed to start service: $*" >&2
return 1
}
}

# Print all python prints
export PYTHONUNBUFFERED=1

# Start all services
($VIRTUAL_ENV/bin/uvicorn wandbot.api.app:app --host="0.0.0.0" --port=8000 \
--workers 1 --timeout-keep-alive 75 --loop uvloop --http httptools --log-level debug) & \
($VIRTUAL_ENV/bin/python -m wandbot.apps.slack -l en) & \
($VIRTUAL_ENV/bin/python -m wandbot.apps.slack -l ja) & \
($VIRTUAL_ENV/bin/python -m wandbot.apps.discord)
Loading
Loading