Skip to content

Commit

Permalink
fix: Remove ollama workflow from CI
Browse files Browse the repository at this point in the history
It'd be great to run this in CI, however the smaller model sizes
end up very flakey on consistently using tools. But using larger model
sizes makes this take a long time. I think we can revisit this
when we get a more consistent small tool use model
  • Loading branch information
baxen committed Sep 24, 2024
1 parent 5b34bc5 commit 1bebb70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 51 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,52 +34,3 @@ jobs:
- name: Run tests
run: uv run pytest tests -m 'not integration'

# This runs integration tests of the OpenAI API, using Ollama to host models.
# This lets us test PRs from forks which can't access secrets like API keys.
ollama:
runs-on: ubuntu-latest

strategy:
matrix:
python-version:
# Only test the lastest python version.
- "3.12"
ollama-model:
# For quicker CI, use a smaller, tool-capable model than the default.
- "qwen2.5:0.5b"

steps:
- uses: actions/checkout@v4

- name: Install UV
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Source Cargo Environment
run: source $HOME/.cargo/env

- name: Set up Python
run: uv python install ${{ matrix.python-version }}

- name: Install Ollama
run: curl -fsSL https://ollama.com/install.sh | sh

- name: Start Ollama
run: |
# Run the background, in a way that survives to the next step
nohup ollama serve > ollama.log 2>&1 &
# Block using the ready endpoint
time curl --retry 5 --retry-connrefused --retry-delay 1 -sf http://localhost:11434
# Tests use OpenAI which does not have a mechanism to pull models. Run a
# simple prompt to (pull and) test the model first.
- name: Test Ollama model
run: ollama run $OLLAMA_MODEL hello || cat ollama.log
env:
OLLAMA_MODEL: ${{ matrix.ollama-model }}

- name: Run Ollama tests
run: uv run pytest tests -m integration -k ollama
env:
OLLAMA_MODEL: ${{ matrix.ollama-model }}
5 changes: 3 additions & 2 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def read_file(filename: str) -> str:
Args:
filename (str): The path to the file, which can be relative or
absolute. If it is a plain filename, it is assumed to be in the
current working directory.
absolute. If it is a plain filename, it is assumed to be in the
current working directory.
Returns:
str: The contents of the file.
Expand All @@ -60,6 +60,7 @@ def read_file(filename: str) -> str:
ex = Exchange(
provider=provider,
model=model,
moderator=ContextTruncate(model),
system="You are a helpful assistant. Expect to need to read a file using read_file.",
tools=(Tool.from_function(read_file),),
)
Expand Down

0 comments on commit 1bebb70

Please sign in to comment.