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

Query vLLM OpenAI /models endpoint to get model name and context window #1632

Merged
merged 6 commits into from
Aug 5, 2024

Conversation

simon376
Copy link
Contributor

@simon376 simon376 commented Jul 2, 2024

Description

Similar to #755 , the OpenAI-compatible API server by vLLM exposes both the model name via id and the context length via max_model_len, which can be used to automatically setup the context length of the deployed LLM.

I'm not sure how to best check if the endpoint should be queried, e.g. by checking the API Base URL, or introducing a new apiType besides Azure, etc.

Checklist

  • [x ] The base branch of this PR is dev, rather than main it's preview as in your contributing guidelines
  • The relevant docs, if any, have been updated or created

References

Copy link

netlify bot commented Jul 2, 2024

Deploy Preview for continuedev failed.

Name Link
🔨 Latest commit ecb530e
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/669f7d4ca57f240008992099

@simon376 simon376 marked this pull request as draft July 2, 2024 09:58
@simon376
Copy link
Contributor Author

simon376 commented Jul 2, 2024

sorry I messed something up, I only intended to include my one change in the OpenAI.ts file

@simon376 simon376 marked this pull request as ready for review July 2, 2024 10:04
@sestinj
Copy link
Contributor

sestinj commented Jul 3, 2024

@simon376 I think this might be a good enough reason to make a subclass of the OpenAI class (we do this with Deepseek, Groq, and others for example). Everything can be the same except that there doesn't need to be a URL check to find out whether it is an instance of vLLM

@Patrick-Erichsen
Copy link
Collaborator

Hey @simon376 , any progress on this? Would love to get it shipped!

@simon376
Copy link
Contributor Author

@sestinj I've created a new vLLM subclass and add documentation for it. Sorry for the whitespace changes in OpenAI.ts, couldn't figure out how to get rid of them

@sestinj
Copy link
Contributor

sestinj commented Aug 5, 2024

Great, now worries on the whitespace this looks perfect

@sestinj sestinj merged commit 9e6461e into continuedev:preview Aug 5, 2024
1 of 5 checks passed
@agm-eratosth
Copy link

Hi @sestinj what version of the extension has this feature been integrated into?

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.

4 participants