Skip to content

Conversation

pamelafox
Copy link
Collaborator

@pamelafox pamelafox commented Sep 26, 2024

Purpose

This PR makes it easier for developers who want to use local models in development, either for cost reasons or comparison reasons. I tested with llama3.1:8b from Ollama, which works even for the Chat tab, as well as phi3.5 which works only for the Ask tab (no function calling).

The primary change is that I enabled the use of the GPT tokenizers even for non-GPT models. This means that the token counting will be inaccurate for local models, but that isn't practically an issue unless you have very long conversations.

Does this introduce a breaking change?

When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.

[ ] Yes
[X] No

Does this require changes to learn.microsoft.com docs?

This repository is referenced by this tutorial
which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial,
check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.

[ ] Yes
[X] No

Type of change

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

Code quality checklist

See CONTRIBUTING.md for more details.

  • The current tests all pass (python -m pytest).
  • I added tests that prove my fix is effective or that my feature works
  • I ran python -m pytest --cov to verify 100% coverage of added lines
  • I ran python -m mypy to check for type errors
  • I either used the pre-commit hooks or ran ruff and black manually on my code.

@pamelafox pamelafox merged commit 9722c78 into Azure-Samples:main Sep 26, 2024
12 checks passed
@pamelafox pamelafox deleted the localmodels branch September 26, 2024 23:43
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