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

added support for vLLM server and docs for local models #93

Closed
wants to merge 18 commits into from

Conversation

arnavsinghvi11
Copy link
Collaborator

@arnavsinghvi11 arnavsinghvi11 commented Aug 23, 2023

-updated DSPy init with vLLM support
-added vLLM to hf_client
-added docs for local model testing with HFModel, TGI, vLLM, and MLC
-added model initialization validation for HFClientTGI within latest changes

@andreapiso
Copy link

Any news on the state of this PR? Support for vLLM would be super.

@meditans
Copy link
Contributor

I think this is especially misleading because VLLM support is already in the documentation, but the relevant HFClientVLLM class is only defined in this unmerged PR

@okhat
Copy link
Collaborator

okhat commented Nov 24, 2023

This can now be closed but we'll need a new PR with just these bits:

        self._verify_model_with_server()
        self.kwargs = {
            "temperature": 0.1,
            "max_tokens": 75,
	@@ -42,6 +42,17 @@ def __init__(self, model, port, url="http://future-hgx-1", **kwargs):
            **kwargs,
        }

    def _verify_model_with_server(self):
        try:
            response = requests.get(f"{self.url}/info")
            response_json = response.json()
            server_model = response_json.get('model_id', '')
            if server_model != self.model:
                raise ValueError(f"Model mismatch. Client model: {self.model}, Server model: {server_model}")
        except Exception as e:
            print(f"Failed to verify model with server: {e}")
            raise

cc: @arnavsinghvi11

@chris-aeviator
Copy link

I'm happily using vllm via

import dspy
lm = dspy.HFClientVLLM(model="mistralai/Mistral-7B-Instruct-v0.2", port=8000, url="http://192.168.88.192")
dspy.settings.configure(lm=lm)

@okhat okhat closed this Jan 14, 2024
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.

6 participants