llama-stack/llama_stack
Xi Yan 7c1e3daa75
[bugfix] fix meta-reference agents w/ safety multiple model loading pytest (#694)
# What does this PR do?

- Fix broken pytest for meta-reference's agents
- Safety model needs to be registered to a different provider id from
inference model in order to be recognized



## Test Plan
```
torchrun $CONDA_PREFIX/bin/pytest -v -s llama_stack/providers/tests/agents/test_agents.py -m "meta_reference" --safety-shield meta-llama/Llama-Guard-3-1B --inference-model meta-llama/Llama-3.1-8B-Instruct
```
**Before**
<img width="845" alt="image"
src="https://github.com/user-attachments/assets/83818fe1-2179-4e9c-a753-bf1472a2f01d"
/>



**After**
<img width="851" alt="image"
src="https://github.com/user-attachments/assets/1cf8124b-14e2-47bf-80fd-ef8b4b3f6fd9"
/>


**Other test not broken**
```
pytest -v -s llama_stack/providers/tests/agents/test_agents.py -m "together" --safety-shield meta-llama/Llama-Guard-3-8B --inference-model meta-llama/Llama-3.1-405B-Instruct-FP8
```

## 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.
2024-12-30 16:25:46 -08:00
..
apis [bugfix] fix broken vision inference, change serialization for bytes (#693) 2024-12-30 13:57:41 -08:00
cli [remove import *] clean up import *'s (#689) 2024-12-27 15:45:44 -08:00
distribution [remove import *] clean up import *'s (#689) 2024-12-27 15:45:44 -08:00
providers [bugfix] fix meta-reference agents w/ safety multiple model loading pytest (#694) 2024-12-30 16:25:46 -08:00
scripts Fix to conda env build script 2024-12-17 12:19:34 -08:00
templates [torchtune integration] post training + eval (#670) 2024-12-20 13:43:13 -08:00
__init__.py export LibraryClient 2024-12-13 12:08:00 -08:00