Files
semantic-kernel/python/samples/concepts/plugins
Tao Chen 5779b7d3be Python: Verify local models in Ollama and LM Studio are compatible with the OpenAI connector (#6973)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Related to https://github.com/microsoft/semantic-kernel/issues/6498

The use of local models presents a twofold benefit for developers:
increased flexibility and reduced costs. Ollama and LM Studio are two
well-known platforms that facilitate the hosting of models locally, both
of which offer compatibility with OpenAI endpoints. As such, it is
imperative that our OpenAI connector functions correctly when users are
operating models on these platforms.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
1. Verify that our OpenAI connector works as expected with models hosted
locally using Ollama and LM Studio.
2. Create three new samples (Ollama/chat, LM Studio/chat, LM
Studio/Embedding) under `/concepts/local_models` to show how to using
local models with the OpenAI connector.
3. Fix a bug in `test_sample_utils.py` where if a test case is retried
and input was never reset.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
2024-07-05 22:26:09 +00:00
..