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

add seed params support from vllm_worker #3370

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BuxianChen
Copy link

Add seed parameter support for openai api protocol.

I tested vllm_worker:

python3 -m fastchat.serve.controller
CUDA_VISIBLE_DEVICES=0 python3 -m fastchat.serve.vllm_worker --model-path facebook/opt-125m --model-names opt-125m --controller http://localhost:21001 --port 31001 --worker-address http://localhost:31001
python3 -m fastchat.serve.openai_api_server --host 0.0.0.0 --controller-address http://127.0.0.1:21001 --port 8000

The following code will produce same output

from openai import OpenAI
client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="token-abc123",
)
completion = client.chat.completions.create(
        model="opt-125m",
        messages=[
            {"role": "user", "content": "Hello!"}
        ],
        seed=1,
        max_tokens=200,
    )
print(completion.choices[0].message.content)

Note that other types of worker may not reproduce same output.

Maybe related to these issues: issue 3215, issue 3216

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.

1 participant