Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
c572e27
Draft ollama test
Vasilije1990 Feb 19, 2025
2de364b
Ollama test end to end
Vasilije1990 Feb 20, 2025
8ebd9a7
Ollama test end to end
Vasilije1990 Feb 20, 2025
9d0d96e
Fix ollama
Vasilije1990 Feb 21, 2025
b4088be
Fix ollama
Vasilije1990 Feb 21, 2025
b670697
Fix ollama
Vasilije1990 Feb 21, 2025
bfe039d
Fix ollama
Vasilije1990 Feb 21, 2025
6bc4f6a
Fix ollama
Vasilije1990 Feb 21, 2025
96adcfb
Fix ollama
Vasilije1990 Feb 21, 2025
c06c28d
Fix ollama
Vasilije1990 Feb 21, 2025
edd681f
Fix ollama
Vasilije1990 Feb 21, 2025
02b0109
Fix ollama
Vasilije1990 Feb 21, 2025
a91e83e
Fix ollama
Vasilije1990 Feb 21, 2025
326c418
Fix ollama
Vasilije1990 Feb 21, 2025
92602aa
Fix ollama
Vasilije1990 Feb 22, 2025
f2d0909
Fix ollama
Vasilije1990 Feb 22, 2025
97465f1
Fix ollama
Vasilije1990 Feb 22, 2025
73662b8
Fix ollama
Vasilije1990 Feb 22, 2025
90d96aa
Fix ollama
Vasilije1990 Feb 22, 2025
3a88b94
Fix ollama
Vasilije1990 Feb 22, 2025
11442df
Fix ollama
Vasilije1990 Feb 22, 2025
1dfb0dd
Fix ollama
Vasilije1990 Feb 22, 2025
4c4723b
Fix ollama
Vasilije1990 Feb 22, 2025
846c45e
Fix ollama
Vasilije1990 Feb 22, 2025
2c0bfc8
Fix ollama
Vasilije1990 Feb 22, 2025
91512cd
Merge branch 'dev' into COG-1368
Vasilije1990 Feb 22, 2025
5c7b4a5
Ruff it.
soobrosa Feb 25, 2025
7a85e71
Merge branch 'dev' into COG-1368
soobrosa Feb 25, 2025
0bba1f8
Response model fun.
soobrosa Feb 25, 2025
061fbbd
OpenAI mode.
soobrosa Feb 25, 2025
0ed6aa6
Typo.
soobrosa Feb 25, 2025
3090333
Add a call, homogenous localhost.
soobrosa Feb 25, 2025
80ccf55
Should conform more.
soobrosa Feb 25, 2025
ce8c2da
Unset, my friend, unset.
soobrosa Feb 25, 2025
65927b3
Update test_ollama.yml
Vasilije1990 Feb 25, 2025
6463c2e
Update test_ollama.yml
Vasilije1990 Feb 25, 2025
70f9b5f
Update test_ollama.yml
Vasilije1990 Feb 25, 2025
468268c
Docker Composish way.
soobrosa Feb 26, 2025
c72b12d
Let's be Pydantic.
soobrosa Feb 26, 2025
c224556
Launch Docker manually.
soobrosa Feb 26, 2025
ec9bbca
Cosmetics.
soobrosa Feb 26, 2025
cabbfd6
Maybe we could fly without the Hugger.
soobrosa Feb 26, 2025
c329cef
OHMY.
soobrosa Feb 26, 2025
44f02df
Async it.
soobrosa Feb 26, 2025
6b49078
Response model.
soobrosa Feb 26, 2025
fe7da60
Will graph fly.
soobrosa Feb 26, 2025
a77655a
Oops, putting back create transcript.
soobrosa Feb 26, 2025
cfc93e3
Clean up adapter.
soobrosa Feb 26, 2025
647d872
Phi4 can respond reasonably.
soobrosa Feb 27, 2025
01bb8cb
Beefy runner.
soobrosa Feb 28, 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
124 changes: 124 additions & 0 deletions .github/workflows/test_ollama.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: test | ollama

on:
workflow_dispatch:
pull_request:
types: [ labeled, synchronize ]

jobs:
setup-ollama:
runs-on: ubuntu-latest
services:
ollama:
image: ollama/ollama
ports:
- 11434:11434

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update the Python setup action version.
The actions/setup-python@v4 action used in the setup-ollama job is outdated. It is advisable to update this to a newer version (for example, actions/setup-python@v5) to ensure better compatibility and take advantage of recent improvements.

-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
🧰 Tools
🪛 actionlint (1.7.4)

22-22: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ollama-python requests

- name: Wait for Ollama to be ready
run: |
for i in {1..30}; do
if curl -s http://localhost:11434/api/tags > /dev/null; then
echo "Ollama is ready"
exit 0
fi
echo "Waiting for Ollama... attempt $i"
sleep 2
done
echo "Ollama failed to start"
exit 1

- name: Pull Models
run: |
curl -X POST http://localhost:11434/api/pull -d '{"name": "ollama/llama3.2"}'
curl -X POST http://localhost:11434/api/pull -d '{"name": "avr/sfr-embedding-mistral:latest"}'

run_simple_example_test:
needs: setup-ollama
runs-on: ubuntu-latest
services:
ollama:
image: ollama/ollama
ports:
- 11434:11434

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.x'

- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: |
poetry install --no-interaction --all-extras

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ollama-python requests

- name: Wait for Ollama to be ready
run: |
for i in {1..30}; do
if curl -s http://localhost:11434/api/tags > /dev/null; then
echo "Ollama is ready"
exit 0
fi
echo "Waiting for Ollama... attempt $i"
sleep 2
done
echo "Ollama failed to start"
exit 1

- name: Dump Docker logs
run: |
docker ps
docker logs $(docker ps --filter "ancestor=ollama/ollama" --format "{{.ID}}")


- name: Run example test
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GRAPHISTRY_USERNAME: ${{ secrets.GRAPHISTRY_USERNAME }}
GRAPHISTRY_PASSWORD: ${{ secrets.GRAPHISTRY_PASSWORD }}
LLM_API_KEY: "ollama"
LLM_PROVIDER: "ollama"
LLM_ENDPOINT: "http://localhost:11434"
LLM_MODEL: "ollama/llama3.2"
EMBEDDING_PROVIDER: "ollama"
EMBEDDING_MODEL: "avr/sfr-embedding-mistral:latest"
EMBEDDING_ENDPOINT: "http://localhost:11434/api/embeddings"
EMBEDDING_DIMENSIONS: "4096"
HUGGINGFACE_TOKENIZER: "Salesforce/SFR-Embedding-Mistral"
run: poetry run python ./examples/python/simple_example.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix File Formatting: Append a Newline at File End
YAML standards require a newline at the end of the file. Adding this will prevent linting issues and ensure compatibility with various tools.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 84-84: no new line character at the end of file

(new-line-at-end-of-file)

23 changes: 22 additions & 1 deletion .github/workflows/upgrade_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,29 @@ name: Update Poetry Dependencies

on:
schedule:
- cron: '0 3 * * 0'
- cron: '0 3 * * 0' # Runs at 3 AM every Sunday
push:
paths:
- 'poetry.lock'
- 'pyproject.toml'
branches:
- main
- dev
pull_request:
paths:
- 'poetry.lock'
- 'pyproject.toml'
types: [opened, synchronize, reopened]
branches:
- main
- dev
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the update with debug logging'
required: false
default: false

jobs:
update-dependencies:
Expand Down
Loading