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

Feature Request: Support proxy URLs #387

Closed
duncangrubbs opened this issue Nov 29, 2023 · 2 comments · Fixed by #390
Closed

Feature Request: Support proxy URLs #387

duncangrubbs opened this issue Nov 29, 2023 · 2 comments · Fixed by #390
Labels
feat/model Feature: models feat/request Requests for new features

Comments

@duncangrubbs
Copy link

duncangrubbs commented Nov 29, 2023

Problem Summary

There is no easy way to configure a pipeline to hit anything besides the default service provider endpoint for LLM models. For example, the default llm_models in the registry for OpenAI hardcode the endpoints from Endpoints.

Current Solution(s)

You can, in theory, override this by creating a custom model in the registry and replacing endpoint=Endpoints.CHAT.value, when initializing OpenAI. However, since you are not changing the value of the Endpoints enum, you still get errors during validation. To get around this, you can implement a custom model class that extends REST but doesn't do any endpoint validation. However this feels like overkill for what otherwise would be such a simple change.

Although I have not gotten it to work, another approach would be to use the langchain.OpenAI.v1 model and then pass openai_api_base to the config since langchain supports proxies. However, from my testing there isn't stable langchain support for the chat completions API, and this also just feels like overkill.

Proposed Solution

I think the ideal solution would be to essentially support the openai_api_base parameter natively. Something like

[components.llm.model]
@llm_models = "spacy.GPT-4.v1"
name = "gpt-4"
endpoint = "YOUR_PROXY_URL"

The model would still default endpoint=Endpoints.CHAT.value, but would be overridden if the user passed a value. The validation step could stay, but instead of raising an exception it could just log a warning that you are sending requests to a proxy.

@rmitsch rmitsch added feat/model Feature: models feat/request Requests for new features labels Nov 30, 2023
@rmitsch
Copy link
Collaborator

rmitsch commented Nov 30, 2023

Thanks for this suggestion! We have this on our backlog, one of the next releases will include native support for custom endpoints 🙂

@duncangrubbs
Copy link
Author

@rmitsch That's great to hear! I look forward to the release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/model Feature: models feat/request Requests for new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants