Commit graph

72 commits

Author SHA1 Message Date
Yuan Tang
934de0a281
ci: Enforce concurrency to reduce CI loads (#1738)
# What does this PR do?

When multiple commits are pushed to a PR, multiple CI builds will be
triggered. This PR ensures that we only run one concurrent build for
each PR to reduce CI loads.

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
2025-03-20 22:28:47 -04:00
Botao Chen
f369871083
feat: [New Eval Benchamark] IfEval (#1708)
# What does this PR do?
In this PR, we added a new eval open benchmark IfEval based on paper
https://arxiv.org/abs/2311.07911 to measure the model capability of
instruction following.


## Test Plan
spin up a llama stack server with open-benchmark template

run `llama-stack-client --endpoint xxx eval run-benchmark
"meta-reference-ifeval" --model-id "meta-llama/Llama-3.3-70B-Instruct"
--output-dir "/home/markchen1015/" --num-examples 20` on client side and
get the eval aggregate results
2025-03-19 16:39:59 -07:00
Francisco Arceo
5418e63919
chore: Add triagers list #1561 (#1701)
# What does this PR do?
Adds triagers list

## Closes #1561

## Documentation
Was provided here: https://github.com/meta-llama/llama-stack/pull/1621

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
2025-03-19 09:59:17 -07:00
Yuan Tang
22e560351e
ci: Add scheduled workflow to update changelog (#1503)
# What does this PR do?

This is a follow up from
https://github.com/meta-llama/llama-stack/pull/1463. cc @yanxi0830

---------

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Co-authored-by: Sébastien Han <seb@redhat.com>
2025-03-18 14:39:22 -07:00
Yuan Tang
d609ffce2a
chore: Add links and badges to both unit and integration tests (#1632)
# What does this PR do?

This makes it easier to know the statuses of both and identifying failed
builds.

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
2025-03-18 14:12:17 -07:00
Sébastien Han
ffe9b3b278
ci(ollama): run more integration tests (#1636)
# What does this PR do?
Run additional tests in a matrix to accelerate the process and clearly
identify failing providers.

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-03-18 08:54:42 -07:00
Yuan Tang
2d2bb701fa
ci: Add dependabot scans for Python deps (#1618)
# What does this PR do?

This PR adds dependabot updates for Python dependencies. In addition:
* Consistent weekly schedule on a specific day
* Specific commit messages
* `open-pull-requests-limit` is intentional to avoid upgrading
dependencies that will likely cause regressions. We want to keep the
focus here on security updates only

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
2025-03-17 20:20:31 -07:00
Nathan Weinberg
3b35a39b8b
ci: limit PR testing based on modified files (#1644)
# What does this PR do?
rather than have unit and functional tests run on all PRs, we should
only have them run on PRs changing relevant files

Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
2025-03-17 15:20:29 -07:00
Sébastien Han
24fd06879e
refactor: simplify command execution and remove PTY handling (#1641)
# What does this PR do?

A PTY is unnecessary for interactive mode since `subprocess.run()`
already inherits the calling terminal’s stdin, stdout, and stderr,
allowing natural interaction. Using a PTY can introduce unwanted side
effects like buffering issues and inconsistent signal handling. Standard
input/output is sufficient for most interactive programs.

This commit simplifies the command execution by:

1. Removing PTY-based execution in favor of direct subprocess handling
2. Consolidating command execution into a single run_command function
3. Improving error handling with specific subprocess error types
4. Adding proper type hints and documentation
5. Maintaining Ctrl+C handling for graceful interruption

## Test Plan

```
llama stack run
```

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-03-17 15:03:14 -07:00
Ihar Hrachyshka
bfc79217a8
chore: Add ./scripts/unit-tests.sh (#1515)
# What does this PR do?
Useful for local development. Now you can just trigger the script and
not care about specific arguments to pass to run unit tests.

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan

```
$ . ./venv/bin/activate
$ ./scripts/run_tests.sh
$ echo $?
0
```

[//]: # (## Documentation)

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
Co-authored-by: Nathan Weinberg <31703736+nathan-weinberg@users.noreply.github.com>
2025-03-13 20:25:15 -07:00
dependabot[bot]
e101d15f12
build(deps): bump astral-sh/setup-uv from 4 to 5 (#1620) 2025-03-13 16:40:15 -04:00
Sébastien Han
28aade9a27
ci: add GitHub Action to close stale issues and PRs (#1613)
# What does this PR do?

- Issues/PRs inactive for 60 days are marked as stale
- Stale items are closed after 30 additional days of inactivity
- Adds appropriate warning and closing messages
- Sets daily schedule for stale checks

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-03-13 12:09:04 -07:00
Sébastien Han
edfcb02a0e
ci(ollama): add GitHub Actions workflow for integration tests (#1546)
# What does this PR do?

Added a GitHub Action to run inference tests for the Ollama provider.
This ensures we have coverage for Ollama integration.

---------

Signed-off-by: Sébastien Han <seb@redhat.com>
Co-authored-by: Ashwin Bharambe <ashwin.bharambe@gmail.com>
2025-03-13 12:04:53 -07:00
Sébastien Han
5e54113b19
ci: add dynamic CI job to test templates (#1230)
# What does this PR do?

Introduced a new CI job that dynamically generates a build matrix based
on available templates from `llama_stack/templates/*/build.yaml`.

This allows automated testing for all templates without manual
intervention.

The CI currently builds for venv and containers.

Signed-off-by: Sébastien Han <seb@redhat.com>

~Will pass once https://github.com/meta-llama/llama-stack/pull/1228
merges.~

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-03-13 10:14:01 -07:00
Nathan Weinberg
2baf200b63
ci: add html report to unit test artifacts (#1576)
# What does this PR do?
additional artifacts make test results more human-readable

## Test Plan
Ran locally

Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
2025-03-12 19:05:49 -07:00
Nathan Weinberg
ad939c97c3
docs: add unit test badge to README (#1591)
# What does this PR do?
This PR adds a simple unit test badge to the project README

It also modifies the workflow to run on merges to main, so that the
status reflected in the README is that of main and not pull request
branches

---------

Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
2025-03-12 15:41:35 -07:00
Nathan Weinberg
00da911167
ci: run unit tests on all supported python versions (#1575)
# What does this PR do?
python unit tests running via GitHub Actions were only running with
python 3.10

the project supports all python versions greater than or equal to 3.10

this commit adds 3.11, 3.12, and 3.13 to the test matrix for better
coverage and confidence for non-3.10 users

## Test Plan
All tests pass locally with python 3.11, 3.12, and 3.13

Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
2025-03-12 09:55:11 -07:00
Nathan Weinberg
275bab1373
test: loosen Python 3.10 version for unit tests (#1547)
# What does this PR do?
as I brought up in #1515 it shouldn't be nessessary to tie the unit test
runner to an exact z-stream of Python 3.10

updated so unit test runner always uses latest z-stream of Python 3.10

## Test Plan
```shell
$ uv run -p 3.10 --with-editable . --with-editable ".[dev]" --with-editable ".[unit]" pytest --cov=llama_stack -s -v tests/unit/ --junitxml=pytest-report.xml
```

Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
2025-03-11 11:11:32 -07:00
Courtney Pacheco
ff853ccc38
fix: Use --with-editable to capture accurate code coverage reporting (#1532)
# What does this PR do?
I created a PR earlier today, but I realized the code coverage reporting
isn't correct: #1512

Essentially, we need to use `--with-editable` to enable develop/editable
mode through `uv`. Using editable mode will create a package.egg-link
file, and that allows pytest to accurately capture code coverage.

Before, some files had "0%" or "100%" coverage, which isn't accurate:

<img width="1455" alt="Screenshot 2025-03-10 at 10 01 53 AM"
src="https://github.com/user-attachments/assets/c425515a-9ecd-4962-a2d4-18cd16d12f25"
/>

More info on `--with-editable`:
https://docs.astral.sh/uv/reference/cli/#uv-run--with-editable

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan
Tested locally

<img width="775" alt="Screenshot 2025-03-10 at 7 00 14 PM"
src="https://github.com/user-attachments/assets/31141318-5cf6-4666-8676-b5d8c8d2e719"
/>

Screenshot from CI:

<img width="1000" alt="Screenshot 2025-03-10 at 7 07 57 PM"
src="https://github.com/user-attachments/assets/47092909-ff8d-4e97-80dc-2a16d948405a"
/>

[//]: # (## Documentation)

Signed-off-by: Courtney Pacheco <6019922+courtneypacheco@users.noreply.github.com>
2025-03-10 19:30:28 -04:00
Sébastien Han
91b1b92908
build: revamp "test" dependencies from pyproject (#1468)
# What does this PR do?

The `test` section has been updated to include only the essential
dependencies needed for running integration tests, which are shared
across all providers. If a provider requires additional dependencies,
please add them to your environment separately. When using uv to
run your tests, you can specify extra dependencies with the
`--with` flag.

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-03-10 15:43:16 -07:00
Courtney Pacheco
6dbac3beed
chore: Display code coverage for unit tests in PR builds (#1512)
# What does this PR do?
This PR allows for unit test code coverage % to be reported in PR
builds. Currently, today's output tells the end user which tests passed
and which tests failed:

<img width="744" alt="Screenshot 2025-03-10 at 9 44 28 AM"
src="https://github.com/user-attachments/assets/40b1a578-951f-4b74-8a37-a39c039b1d7e"
/>

If a contributor is creating a new module within Llama Stack and starts
writing unit tests for that module, it might be difficult for Llama
Stack maintainers to immediately determine the code coverage percentage
for that new module.

To allow for code coverage reporting in the CI, we simply need to
install `pytest-cov` so we can use the `--cov` flag with the existing
`pytest` command.

Ideally, it would be nicer to have a bot report code coverage, but this
PR can be a temporary solution.

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan
I ran these changes locally:

<img width="1455" alt="Screenshot 2025-03-10 at 10 01 53 AM"
src="https://github.com/user-attachments/assets/dfd765c6-5979-42a3-b899-7713a3f202e6"
/>

PR build to confirm the expected behavior:
<img width="1326" alt="Screenshot 2025-03-10 at 12 47 36 PM"
src="https://github.com/user-attachments/assets/fe94f1e6-fbb5-4e57-9902-197502c50621"
/>


[//]: # (## Documentation)

Signed-off-by: Courtney Pacheco <6019922+courtneypacheco@users.noreply.github.com>
2025-03-10 16:27:33 -04:00
Ashwin Bharambe
ba917a9c48 fix: make sure readthedocs is triggered if pyproject.toml is updated 2025-03-08 23:05:10 -08:00
dependabot[bot]
d63e798f6d
build(deps): bump thollander/actions-comment-pull-request from 2 to 3 (#1485) 2025-03-07 17:31:53 -05:00
dependabot[bot]
9506012736
build(deps): bump actions/upload-artifact from 3 to 4 (#1486) 2025-03-07 17:31:00 -05:00
Sébastien Han
e6355bfc3b
ci: enable Dependabot for GitHub Actions (#1470)
# What does this PR do?

Add a Dependabot configuration file (.github/dependabot.yml) to enable
automated dependency updates for GitHub Actions. This ensures workflows
stay up to date with the latest versions, improving security and
reliability.

Dependabot is configured to:
- Monitor GitHub Actions dependencies.
- Check for updates in the workflow directory
- Run updates on a daily schedule.

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-03-07 12:54:56 -08:00
Ashwin Bharambe
82e94fe22f
ci: add Github workflow which runs unittests in PR (#1442) 2025-03-05 21:23:28 -05:00
Botao Chen
3fabe076cd
chore: Update CODEOWNERS (#1407)
Add SLR722 as code owner
2025-03-04 21:48:24 -08:00
Sébastien Han
33a64eb5ec
ci: improve GitHub Actions workflow for website builds (#1151)
# What does this PR do?

Refine the existing update-readthedocs.yml workflow to enhance
automation and reliability. Updates include:

- Expanding path triggers to cover all documentation files (docs/**) and
  build artifacts.
- Adding steps to set up Python (3.11), install uv, sync dependencies,
   and build HTML using make html.
- Ensuring the ReadTheDocs build trigger only runs on
   workflow_dispatch events.

These improvements help validate website builds in PRs, preventing
issues before merging.

Signed-off-by: Sébastien Han <seb@redhat.com>

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-02-20 21:37:37 -08:00
Sébastien Han
71cae67d7b
docs: remove changelog mention from PR template (#1049)
# What does this PR do?

The CHANGELOG.md was removed in

e6c9f2a485
so this mention is not relevant anymore.

Signed-off-by: Sébastien Han <seb@redhat.com>

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-02-11 13:24:53 -05:00
Sébastien Han
371f11a569
build: update uv lock to sync package versions (#1026)
# What does this PR do?
[Provide a short summary of what this PR does and why. Link to relevant
issues if applicable.]

Updated `uv.lock` to reflect the latest versions of `llama-models`,
`llama-stack`, and `llama-stack-client` (bumped to 0.1.2). This ensures
dependency consistency and avoids potential issues with outdated package
references.

Added `uv-sync` hook from `uv-pre-commit` repository to ensure
synchronization of dependencies.

Signed-off-by: Sébastien Han <seb@redhat.com>

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan
[Describe the tests you ran to verify your changes with result
summaries. *Provide clear instructions so the plan can be easily
re-executed.*]

[//]: # (## Documentation)
[//]: # (- [ ] Added a Changelog entry if the change is significant)

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-02-10 11:42:30 -05:00
Yuan Tang
c97e05f75e
test: Split inference tests to text and vision (#1008)
# What does this PR do?

This PR splits the inference tests into text and vision to make testing
on vLLM provider easier as mentioned in
https://github.com/meta-llama/llama-stack/pull/951 since serving
multiple models (e.g. Llama-3.2-11B-Vision-Instruct and
Llama-3.1-8B-Instruct) on a single port using the OpenAI API is [not
supported yet](https://docs.vllm.ai/en/v0.5.5/serving/faq.html) so it's
a bit tricky to test both at the same time.

## Test Plan

All previously passing tests related to text still pass:
`LLAMA_STACK_BASE_URL=http://localhost:5002 pytest -v
tests/client-sdk/inference/test_text_inference.py`

All vision tests passed via `LLAMA_STACK_BASE_URL=http://localhost:5002
pytest -v tests/client-sdk/inference/test_vision_inference.py`.

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
2025-02-07 09:35:49 -08:00
Ashwin Bharambe
7ec79c0297 Add Terry to CODEOWNERS 2025-02-06 16:23:23 -08:00
Ashwin Bharambe
c79cc92b37 Update PR Template to be much more succinct 2025-02-06 15:57:22 -08:00
Yuan Tang
dd1265bea7
ci: Add semantic PR title check (#979)
This adds a new workflow to check semantic PR titles to match the
[Conventional Commits spec](https://www.conventionalcommits.org/). This
will make it easier to browse commit history and enable automation in
the future.

---------

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
2025-02-06 12:22:34 -08:00
Ashwin Bharambe
21f763c4f3 Reduce noise from PR templates further 2025-02-06 11:02:53 -08:00
Ihar Hrachyshka
42c10da1c3
github: update PR template to use correct syntax to auto-close issues (#989)
Also, hiding guidance to the author under comments to avoid polluting
the description with ti.

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>

# What does this PR do?

Using `Closes #` syntax in PR template, as per:

https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests

```
In short, provide a summary of what this PR does and why. Usually, the relevant context should be present in a linked issue.
```

Hides this ^.

```
Please describe:
 - tests you ran to verify your changes with result summaries.
 - provide instructions so it can be reproduced.
```

And this ^.

```
Please link relevant resources if necessary.
```

And this ^.


## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [x] Ran pre-commit to handle lint / formatting issues.
- [x] Read the [contributor
guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md),
      Pull Request section?
- [ ] Updated relevant documentation.
- [ ] Wrote necessary unit or integration tests.

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-02-06 09:59:26 -08:00
Sébastien Han
610de1ba05
chore: update PR template to reinforce changelog (#988)
# What does this PR do?

- Added a checklist item in the PR template to ensure significant
changes are documented in the changelog.
- Updated `CHANGELOG.md` with a placeholder for version `0.2.0`.
- This is an effort to resurrect the consistent usage of the changelog
file.

Signed-off-by: Sébastien Han <seb@redhat.com>

## Test Plan

Please describe:
 - tests you ran to verify your changes with result summaries.
 - provide instructions so it can be reproduced.


## Sources

Please link relevant resources if necessary.


## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [ ] Ran pre-commit to handle lint / formatting issues.
- [ ] Read the [contributor
guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md),
      Pull Request section?
- [ ] Updated relevant documentation.
- [ ] Wrote necessary unit or integration tests.

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-02-06 09:58:30 -08:00
Nathan Weinberg
b84ab6c6b8
github: issue templates automatically apply relevant label (#956)
# What does this PR do?
the `bug` and `enhancement` labels will be automatically applied to bugs
and feature requests that are opened

## Test Plan
N/A

## Sources

https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository

## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [x] Ran pre-commit to handle lint / formatting issues.
- [x] Read the [contributor
guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md),
      Pull Request section?
- [x] Updated relevant documentation.
- [x] Wrote necessary unit or integration tests.

Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
2025-02-04 14:44:03 -08:00
Ashwin Bharambe
981bb52b59 Quote the token properly 2025-02-04 11:44:29 -08:00
Ashwin Bharambe
5005939494 Use a secret again for the workflow 2025-02-04 11:42:47 -08:00
Ashwin Bharambe
7392daddee Try a new webhook 2025-02-04 11:36:54 -08:00
Ashwin Bharambe
2987fb37c3 fixes? 2025-02-04 11:34:27 -08:00
Ashwin Bharambe
766b11f1f8 Debug workflow 2025-02-04 11:09:16 -08:00
Ashwin Bharambe
5233666143 Debug workflow 2025-02-04 11:07:04 -08:00
Ashwin Bharambe
b35930a7e5 rename 2025-02-04 11:02:45 -08:00
Ashwin Bharambe
ea538e4b32 Add a workflow to trigger readthedocs rebuild 2025-02-04 11:02:06 -08:00
Yuan Tang
e370a77752
Add issue template config with docs and Discord links (#930)
This is similar to what we are doing for other projects, e.g.
https://github.com/argoproj/argo-workflows/tree/main/.github/ISSUE_TEMPLATE

The benefits is to give people more options before submitting a bug
report or feature request on GitHub.

---------

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
2025-02-03 06:39:00 -08:00
Ashwin Bharambe
1bb74d95ad Delete CI workflows from here since they have moved to llama-stack-ops 2025-02-02 10:22:48 -08:00
Ashwin Bharambe
5b1e69e58e
Use uv pip install instead of pip install (#921)
## What does this PR do? 

See issue: #747 -- `uv` is just plain better. This PR does the bare
minimum of replacing `pip install` by `uv pip install` and ensuring `uv`
exists in the environment.

## Test Plan 

First: create new conda, `uv pip install -e .` on `llama-stack` -- all
is good.
Next: run `llama stack build --template together` followed by `llama
stack run together` -- all good
Next: run `llama stack build --template together --image-name yoyo`
followed by `llama stack run together --image-name yoyo` -- all good
Next: fresh conda and `uv pip install -e .` and `llama stack build
--template together --image-type venv` -- all good.

Docker: `llama stack build --template together --image-type container`
works!
2025-01-31 22:29:41 -08:00
ehhuang
a67324c975
Update CODEOWNERS 2025-01-31 15:35:58 -08:00