Skip to content

Conversation

richiejp
Copy link
Collaborator

@richiejp richiejp commented Apr 25, 2025

Mock LLM in unit tests so that the CI for PRs can pass in a reasonable time

For testing releases I think real LLMs should be used and on a variety of hardware, but it requires time and other resources.

EDIT:

This saves time when testing on CPU which is the only sensible thing
to do on GitHub CI for PRs. For releases or once the commit is merged
we could use an external runner with GPU or just wait.

This reduces the time to <10mintues from about 40-50. Most of the time is now taken installing docker and downloading images. I don't think there is a way to reduce that time without moving off of GitHub's default runners.

@richiejp richiejp force-pushed the mock-llm branch 2 times, most recently from 7c3e46e to f601b95 Compare April 29, 2025 09:53
@richiejp richiejp marked this pull request as ready for review April 29, 2025 09:54
@richiejp richiejp changed the title mock LLM in tests chore(tests): Mock LLM in tests for PRs Apr 29, 2025
@richiejp richiejp enabled auto-merge (rebase) April 29, 2025 20:05
@mudler
Copy link
Owner

mudler commented May 6, 2025

I'm OK with this, but from one end the current test suite its very nice to give a glimpse on the model quality for agentic actions, mmmh.. maybe we can split the current test in a separate workflow which is not gating PRs?

@richiejp
Copy link
Collaborator Author

richiejp commented May 6, 2025

Yeah can try that, I'm a bit unclear on what GitHub supports in that regard.

Some other options I thought about:

  1. Use very small LLM: Will work on some feature and not others
  2. Use a remote instance of LocalAI with a decent GPU

@richiejp richiejp force-pushed the mock-llm branch 3 times, most recently from 745d35d to 828bffb Compare May 7, 2025 20:24
@richiejp
Copy link
Collaborator Author

richiejp commented May 7, 2025

OK, there are now two workflows, one is not required for PRs to pass.

@richiejp
Copy link
Collaborator Author

richiejp commented May 8, 2025

Seem to be missing env vars on the new workflow

@richiejp richiejp force-pushed the mock-llm branch 4 times, most recently from 1076227 to 24a3286 Compare May 10, 2025 05:00
@richiejp
Copy link
Collaborator Author

OK, fixed a number of bugs in the tests, so both mock and real LLM tests should work

This saves time when testing on CPU which is the only sensible thing
to do on GitHub CI for PRs. For releases or once the commit is merged
we could use an external runner with GPU or just wait.

Signed-off-by: Richard Palethorpe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants