Skip to content

Commit

Permalink
Use intent model from archfc to pick prompt gateway (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
nehcgs authored Dec 20, 2024
1 parent 67b8fd6 commit ba7279b
Show file tree
Hide file tree
Showing 151 changed files with 8,650 additions and 10,940 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/e2e_archgw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: e2e archgw tests

on:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest-m
defaults:
run:
working-directory: ./tests/archgw

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: build arch docker image
run: |
cd ../../ && docker build -f arch/Dockerfile . -t katanemo/archgw
- name: start archgw
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: |
docker compose up | tee &> archgw.logs &
- name: wait for archgw to be healthy
run: |
source common.sh && wait_for_healthz http://localhost:10000/healthz
- name: install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
- name: install test dependencies
run: |
poetry install
- name: run archgw tests
run: |
poetry run pytest || tail -100 archgw.logs
- name: stop archgw docker container
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: |
docker compose down
40 changes: 40 additions & 0 deletions .github/workflows/e2e_model_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: e2e model server tests

on:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest-m
defaults:
run:
working-directory: ./tests/modelserver

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
- name: install model server and start it
run: |
cd ../../model_server/ && poetry install && poetry run archgw_modelserver start
- name: install test dependencies
run: |
poetry install
- name: run tests
run: |
poetry run pytest
47 changes: 47 additions & 0 deletions .github/workflows/e2e_test_demos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: e2e demo tests

on:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest-m

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: build arch docker image
run: |
docker build -f arch/Dockerfile . -t katanemo/archgw
- name: install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: setup python venv
run: |
python -m venv venv
- name: install model server, arch gateway and test dependencies
run: |
source venv/bin/activate
cd model_server/ && echo "installing model server" && poetry install
cd ../arch/tools && echo "installing archgw cli" && poetry install
cd ../../demos/test_runner && echo "installing test dependencies" && poetry install
- name: run demo tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: |
source venv/bin/activate
cd demos/test_runner && sh run_demo_tests.sh
5 changes: 2 additions & 3 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:

jobs:
test:
runs-on: ubuntu-latest-m
# runs-on: gh-large-150gb-ssd
runs-on: ubuntu-latest

steps:
- name: Checkout code
Expand All @@ -31,4 +30,4 @@ jobs:
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: |
python -mvenv venv
source venv/bin/activate && cd e2e_tests && bash run_e2e_tests.sh
source venv/bin/activate && cd tests/e2e && bash run_e2e_tests.sh
2 changes: 1 addition & 1 deletion .github/workflows/model-server-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
PYTHONPATH: model_server # Ensure the app's path is available
run: |
cd model_server
poetry run pytest --maxfail=5 --disable-warnings
poetry run pytest
157 changes: 132 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,142 @@
arch/qdrant_data/
/venv/
__pycache__
grafana-data
prom_data
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
*.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
qdrant_data
generated
.DS_Store
*.gguf
venv
demos/function_calling/ollama/models/
demos/function_calling/ollama/id_ed*
docs/build/
demos/function_calling/open-webui/
demos/employee_details_copilot/open-webui/
demos/employee_details_copilot_arch/open-webui/
demos/network_copilot/open-webui/
demos/employee_details_copilot/ollama/models/
demos/employee_details_copilot_arch/ollama/models/
demos/network_copilot/ollama/models/
arch_log/
arch/tools/*.egg-info
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# VSCode stuff:
.vscode/

# MacOS Metadata
*.DS_Store



# =========================================

# Arch
arch/tools/config
arch/tools/build
model_server/model_server.egg-info

# Archgw - model_server
model_server/venv_model_server
model_server/build
model_server/dist

# Archgw - Docs
docs/build/

# Archgw - Demos
demos/function_calling/ollama/models/
demos/function_calling/ollama/id_ed*
demos/function_calling/open-webui/
demos/function_calling/open-webui/
demos/shared/signoz/data

# Arch - Miscellaneous
grafana-data
prom_data
arch_log/
arch_logs/
dist/
crates/*/target/
crates/target/
build.log
demos/shared/signoz/data

archgw.log
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Arch's CLI allows you to manage and interact with the Arch gateway efficiently.
```console
$ python -m venv venv
$ source venv/bin/activate # On Windows, use: venv\Scripts\activate
$ pip install archgw==0.1.6
$ pip install archgw==0.1.7
```

### Build AI Agent with Arch Gateway
Expand Down
2 changes: 2 additions & 0 deletions arch/arch_config_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ properties:
type: string
in_path:
type: boolean
format:
type: string
additionalProperties: false
required:
- name
Expand Down
1 change: 1 addition & 0 deletions arch/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ services:
- OPENAI_API_KEY=${OPENAI_API_KEY:?error}
- MISTRAL_API_KEY=${MISTRAL_API_KEY:?error}
- OTEL_TRACING_HTTP_ENDPOINT=http://host.docker.internal:4318/v1/traces
- MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-51000}
Loading

0 comments on commit ba7279b

Please sign in to comment.