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: implement inference server by using vllm #624

Merged
merged 7 commits into from
Oct 24, 2024
Merged

Conversation

zhuangqh
Copy link
Collaborator

@zhuangqh zhuangqh commented Oct 10, 2024

Reason for Change:

Requirements

  • added unit tests and e2e tests (if applicable).

Issue Fixed:

Notes for Reviewers:

@zhuangqh
Copy link
Collaborator Author

zhuangqh commented Oct 14, 2024

testing code

from openai import OpenAI

# Modify OpenAI's API key and API base to use vLLM's API server.
openai_api_key = "EMPTY"
openai_api_base = "http://localhost:5000/v1"

client = OpenAI(
    # defaults to os.environ.get("OPENAI_API_KEY")
    api_key=openai_api_key,
    base_url=openai_api_base,
)

models = client.models.list()
model = models.data[0].id

completion = client.chat.completions.create(
    model=model,
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {
            "role": "user",
            "content": "What is kubernetes?"
        }
    ],
    n=2,
)

print(completion.choices[0].message)

@zhuangqh zhuangqh marked this pull request as ready for review October 14, 2024 22:37
@zhuangqh
Copy link
Collaborator Author

link #608

Copy link
Collaborator

@ishaansehgal99 ishaansehgal99 left a comment

Choose a reason for hiding this comment

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

sweeet

Signed-off-by: jerryzhuang <[email protected]>
Signed-off-by: jerryzhuang <[email protected]>
@Fei-Guo Fei-Guo merged commit 1d09da0 into main Oct 24, 2024
6 of 10 checks passed
@Fei-Guo Fei-Guo deleted the zhuangqh/support-vllm branch October 24, 2024 15:01
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