From 37a7e76c09c5eca842591c2c79f3a409269594b6 Mon Sep 17 00:00:00 2001 From: Jonah Sussman <42743659+JonahSussman@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:43:59 -0400 Subject: [PATCH] :ghost: Update dependencies, update default model, update documentation (#357) * Updated default model to IBM-served Llama 3 Signed-off-by: JonahSussman * Tweaked more demo stuff Signed-off-by: JonahSussman * Updated dependencies Signed-off-by: JonahSussman * Filtered more headers from VCR cassettes Signed-off-by: JonahSussman --------- Signed-off-by: JonahSussman --- README.md | 6 +++++ docs/scenarios/demo.md | 21 +++++++++++---- kai/config.toml | 3 ++- kai/service/kai_application/util.py | 14 +++++++++- pyproject.toml | 2 +- requirements.txt | 40 ++++++++++++++--------------- 6 files changed, 57 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 4dd88352..d60003e0 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,12 @@ suggestions, and apply them to your codebase. ### Launch the Kai backend with sample data +> [!IMPORTANT] +> +> Kai is in early development and is not yet ready for production use. We +> currently recommend checking out the git tag `stable` for the most stable user +> experience. + The quickest way to get running is to leverage sample data committed into the Kai repo along with the `podman compose up` workflow diff --git a/docs/scenarios/demo.md b/docs/scenarios/demo.md index f8e69569..12bd1425 100644 --- a/docs/scenarios/demo.md +++ b/docs/scenarios/demo.md @@ -49,8 +49,9 @@ Konveyor AI (Kai) can assist and expedite the modernization process. - Quarkus 3.10 - Java 17 -Additionally, you will need to have the Kai IDE plugin installed in VSCode. You -can follow the steps listed +Additionally, you will need to have the Kai IDE plugin installed in VSCode. As +of 2024-09-10, you should install **version 0.0.3**. You can follow the steps +listed [here](https://github.com/konveyor-ecosystem/kai-vscode-plugin) ## Step 1: Setup @@ -305,8 +306,14 @@ distribution. For the sake of simplicity we choose > It is assumed that minikube is installed. If not you can follow > the instructions [here](https://minikube.sigs.k8s.io/docs/start/). -Point your shell to minikube's docker daemon. Kubernetes may not be able to find -the built images if they are not in the same docker daemon as minikube. +First, start minikube with the docker driver: + +```bash +minikube start --driver=docker +``` + +Next, point your shell to minikube's docker daemon. Kubernetes may not be able +to find the built images if they are not in the same docker daemon as minikube. ```bash eval $(minikube docker-env) @@ -320,6 +327,9 @@ kubectl apply -f deploy/kubernetes/persistent-volume.yaml kubectl apply -f deploy/kubernetes/persistent-volume-claim.yaml kubectl apply -f deploy/kubernetes/postgresql-deployment.yaml kubectl apply -f deploy/kubernetes/postgresql-service.yaml + +# Wait until the postgres pod is running +watch kubectl get all ``` This should setup the database ready for connections from the coolstore app. @@ -332,7 +342,8 @@ image. mvn clean compile package -Dquarkus.kubernetes.deploy=true ``` -Once deployed, access the app via browser hitting the localhost and port. To get +Once deployed, access the app via browser hitting the localhost and port. Note +that it might take a minute when you open the website for the first time. To get this URL, run the following command: ```bash diff --git a/kai/config.toml b/kai/config.toml index 4b939e3f..22adc155 100644 --- a/kai/config.toml +++ b/kai/config.toml @@ -24,4 +24,5 @@ password = "dog8code" provider = "ChatIBMGenAI" [models.args] -model_id = "mistralai/mixtral-8x7b-instruct-v01" +model_id = "meta-llama/llama-3-70b-instruct" +parameters.max_new_tokens = 2048 diff --git a/kai/service/kai_application/util.py b/kai/service/kai_application/util.py index 1698b132..9069535a 100644 --- a/kai/service/kai_application/util.py +++ b/kai/service/kai_application/util.py @@ -114,7 +114,19 @@ def playback_if_demo_mode( "headers", ], record_on_exception=False, - filter_headers=["authorization", "cookie", "content-length"], + filter_headers=[ + "authorization", + "cookie", + "content-length", + "x-stainless-lang", + "x-stainless-async", + "x-stainless-runtime", + "x-stainless-arch", + "x-stainless-os", + "x-stainless-package-version", + "x-stainless-runtime-version", + "user-agent", + ], ) KAI_LOG.debug( f"record_mode='{record_mode}' - Using cassette {application_name}/{model_id}/{filename}.yaml", diff --git a/pyproject.toml b/pyproject.toml index 0ebe2889..ce68c9a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ "Jinja2==3.1.4", "langchain==0.2.11", "langchain-community==0.2.10", - "langchain-openai==0.1.17", + "langchain-openai==0.1.23", "langchain-google-genai==1.0.9", "langchain-experimental==0.0.64", "gunicorn==22.0.0", diff --git a/requirements.txt b/requirements.txt index 1c16c481..a8be58e1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -57,12 +57,12 @@ botocore==1.34.162 # s3transfer cachetools==5.5.0 # via google-auth -certifi==2024.7.4 +certifi==2024.8.30 # via # httpcore # httpx # requests -cffi==1.17.0 +cffi==1.17.1 # via argon2-cffi-bindings charset-normalizer==3.3.2 # via requests @@ -86,9 +86,9 @@ distro==1.9.0 # via openai execnb==0.1.6 # via nbdev -executing==2.0.1 +executing==2.1.0 # via stack-data -fastcore==1.7.1 +fastcore==1.7.5 # via # execnb # ghapi @@ -101,7 +101,7 @@ frozenlist==1.4.1 # via # aiohttp # aiosignal -ghapi==1.0.5 +ghapi==1.0.6 # via nbdev gitdb==4.0.11 # via gitpython @@ -114,7 +114,7 @@ google-api-core[grpc]==2.19.2 # google-ai-generativelanguage # google-api-python-client # google-generativeai -google-api-python-client==2.143.0 +google-api-python-client==2.145.0 # via google-generativeai google-auth==2.34.0 # via @@ -131,7 +131,7 @@ googleapis-common-protos==1.65.0 # via # google-api-core # grpcio-status -greenlet==3.0.3 +greenlet==3.1.0 # via sqlalchemy grpcio==1.66.1 # via @@ -173,7 +173,7 @@ ipykernel==6.29.5 # jupyter-console # jupyterlab # qtconsole -ipython==8.26.0 +ipython==8.27.0 # via # execnb # ipykernel @@ -270,7 +270,7 @@ langchain-community==0.2.10 # via # kai (pyproject.toml) # langchain-experimental -langchain-core==0.2.36 +langchain-core==0.2.39 # via # langchain # langchain-community @@ -282,11 +282,11 @@ langchain-experimental==0.0.64 # via kai (pyproject.toml) langchain-google-genai==1.0.9 # via kai (pyproject.toml) -langchain-openai==0.1.17 +langchain-openai==0.1.23 # via kai (pyproject.toml) -langchain-text-splitters==0.2.2 +langchain-text-splitters==0.2.4 # via langchain -langsmith==0.1.107 +langsmith==0.1.117 # via # langchain # langchain-community @@ -305,7 +305,7 @@ matplotlib-inline==0.1.7 # ipython mistune==3.0.2 # via nbconvert -multidict==6.0.5 +multidict==6.1.0 # via # aiohttp # yarl @@ -336,7 +336,7 @@ numpy==1.26.4 # via # langchain # langchain-community -openai==1.43.0 +openai==1.44.1 # via langchain-openai orjson==3.10.7 # via langsmith @@ -362,7 +362,7 @@ parso==0.8.4 # via jedi pexpect==4.9.0 # via ipython -platformdirs==4.2.2 +platformdirs==4.3.2 # via jupyter-core prometheus-client==0.20.0 # via jupyter-server @@ -564,7 +564,7 @@ tree-sitter-java==0.21.0 # via kai (pyproject.toml) typer==0.9.0 # via kai (pyproject.toml) -types-python-dateutil==2.9.0.20240821 +types-python-dateutil==2.9.0.20240906 # via arrow typing-extensions==4.12.2 # via @@ -591,7 +591,7 @@ urllib3==2.2.2 # vcrpy vcrpy @ git+https://github.com/fabianvf/vcrpy.git@httpx-async-threadpool # via kai (pyproject.toml) -watchdog==5.0.0 +watchdog==5.0.2 # via nbdev wcwidth==0.2.13 # via prompt-toolkit @@ -609,13 +609,11 @@ widgetsnbextension==4.0.13 # via ipywidgets wrapt==1.16.0 # via vcrpy -yarl==1.9.4 +yarl==1.11.1 # via # aiohttp # vcrpy # The following packages are considered to be unsafe in a requirements file: -pip==24.2 - # via ghapi -setuptools==74.0.0 +setuptools==74.1.2 # via jupyterlab