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

Allow custom OpenAI ENDPOINT & Model Names - e.g. Sambanova API Cloud #63

Open
soufianechami opened this issue Feb 10, 2025 · 1 comment

Comments

@soufianechami
Copy link

I am trying to use Sambanova API which is compatible with OpenAI SDK. Would love to see how fast inference can benefit here and also use open source LLMs.

Below is an example of Sambanova API call:

import os
import openai

client = openai.OpenAI(
    api_key=os.environ.get("SAMBANOVA_API_KEY"),
    base_url="https://api.sambanova.ai/v1",
)

response = client.chat.completions.create(
    model="Meta-Llama-3.1-8B-Instruct",
    messages=[{"role":"system","content":"You are a helpful assistant"},{"role":"user","content":"Hello"}],
    temperature=0.1,
    top_p=0.1
)

print(response.choices[0].message.content)
@Chenglong-MS
Copy link
Collaborator

Chenglong-MS commented Feb 22, 2025

@soufianechami This should be supported now, using

provider="openai"
api_key="xxxxxxx"
api_base="https://api.sambanova.ai/v1"
model="Meta-Llama-3.1-8B-Instruct"

Thanks!

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

No branches or pull requests

2 participants