from openai import OpenAI
WANDB_API_KEY = "your-wandb-api-key"
ENTITY = "my-entity"
PROJECT = "my-project"
client = OpenAI(
base_url="https://api.training.wandb.ai/v1",
api_key=WANDB_API_KEY
)
response = client.chat.completions.create(
model=f"wandb-artifact://{ENTITY}/{PROJECT}/my-model:step100",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Summarize our training run."},
],
temperature=0.7,
top_p=0.95,
)
print(response.choices[0].message.content)