Skip to content

Commit 6e94c2d

Browse files
committed
OPENAI_BASE_URL
1 parent a23c2a4 commit 6e94c2d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

llm/client-openai-completions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/usr/bin/python3
22

3+
# Prerequisite:
4+
# export OPENAI_BASE_URL=$LLAMA_STACK_CLIENT_BASE_URL/v1
5+
36
import os
47

58
from openai import OpenAI
69

7-
c = OpenAI(base_url="http://localhost:8321/v1/", api_key="none")
10+
c = OpenAI()
811

912
completion = c.chat.completions.create(
1013
model=os.getenv("INFERENCE_MODEL", "ollama/llama3.2:3b"),

llm/client-openai-responses.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/python3
22

3+
# Prerequisite:
4+
# export OPENAI_BASE_URL=$LLAMA_STACK_CLIENT_BASE_URL/v1
5+
36
import os
47
from openai import OpenAI
58

6-
c = OpenAI(base_url="http://localhost:8321/v1/", api_key="none")
9+
c = OpenAI()
710

811
resp = c.responses.create(
912
model=os.getenv("INFERENCE_MODEL", "ollama/llama3.2:3b"),

0 commit comments

Comments
 (0)