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 SSL Cert Functionality #224

Merged
merged 6 commits into from
Mar 3, 2024
Merged

Add SSL Cert Functionality #224

merged 6 commits into from
Mar 3, 2024

Conversation

nivibilla
Copy link
Contributor

Adds a verify parameter to the RuntimeEndpoint and modifies utils.py.

can be used like

runtime = sgl.RuntimeEndpoint(url, verify='./ca_bundle.crt')

This doesn't modify any of the openai python interactions since we can just do this instead

import httpx
import openai
client = openai.Client(
    base_url=url + "/v1",
    http_client = httpx.Client(verify='./ca_bundle.crt'),
    api_key='none'
    )

# Chat completion
response = client.chat.completions.create(
    model="default",
    messages=[
        {"role": "system", "content": "You are a helpful AI assistant"},
        {"role": "user", "content": "List 3 countries and their capitals."},
    ],
    temperature=0,
    max_tokens=64,
)
print(response)

@nivibilla nivibilla mentioned this pull request Feb 23, 2024
@hnyls2002 hnyls2002 merged commit 01b07ea into sgl-project:main Mar 3, 2024
hnyls2002 pushed a commit that referenced this pull request Mar 10, 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.

None yet

2 participants