Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(machinery): allow base_url of OpenAI to be customized #11467

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

max-wittig
Copy link

Allows usage of local LLMs or other providers

Proposed changes

Adds a new field when setting up the OpenAI integration to allow the user to add a custom base_url

Checklist

  • Lint and unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation to describe my feature.
  • I have squashed my commits into logic units.
  • I have described the changes in the commit messages.

Other information

Allows usage of local LLMs or other providers
@nijel
Copy link
Member

nijel commented Apr 23, 2024

Can you please add documentation which other providers or local LLM work with the OpenAI API and how to configure these?

weblate/machinery/openai.py Outdated Show resolved Hide resolved
weblate/machinery/forms.py Outdated Show resolved Hide resolved
widget=forms.Textarea,
help_text=gettext_lazy("Base URL of the OpenAI API"),
required=False,
default=None,
Copy link
Member

@nijel nijel Apr 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeError: Field.init() got an unexpected keyword argument 'default'

See https://github.com/WeblateOrg/weblate/actions/runs/8800026958/job/24150336022?pr=11467

Seriously, has this been tested?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nijel No, I just pushed it to see the pipeline! Not ready for review! I should have marked it as a draft!

Thanks for the fast review though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend testing locally first against real custom API endpoint. The model selection will need to be changed for custom LLMs as well.

@max-wittig max-wittig marked this pull request as draft April 23, 2024 12:52
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.

None yet

2 participants