Skip to content

feat: add OpenAI Python SDK example with Archestra proxy#7

Open
Kabi10 wants to merge 2 commits into
archestra-ai:mainfrom
Kabi10:feat/openai-python-example
Open

feat: add OpenAI Python SDK example with Archestra proxy#7
Kabi10 wants to merge 2 commits into
archestra-ai:mainfrom
Kabi10:feat/openai-python-example

Conversation

@Kabi10
Copy link
Copy Markdown

@Kabi10 Kabi10 commented Apr 17, 2026

Summary

Adds a minimal Python example showing how to route OpenAI SDK requests through the Archestra LLM proxy — the Python counterpart to the existing ai-sdk-express (Node.js) example.

What's included:

  • main.py — interactive CLI chat using openai Python package, with base_url pointed at the Archestra proxy
  • .env.example — template for OPENAI_API_KEY and ARCHESTRA_PROXY_URL
  • requirements.txtopenai>=1.0.0 and python-dotenv
  • README.md — setup instructions, config table, model-switching guide

Key design: The only change from standard OpenAI Python usage is base_url=proxy_url in the OpenAI() constructor. Everything else (models, messages, streaming) stays identical — Archestra is transparent.

Testing

cp openai-python/.env.example openai-python/.env
# fill in OPENAI_API_KEY and ARCHESTRA_PROXY_URL
pip install -r openai-python/requirements.txt
python openai-python/main.py

Kabi10 added 2 commits April 16, 2026 18:28
Shows how to route OpenAI requests through the Archestra LLM Proxy
with a single base_url change. Includes interactive CLI chat, env
template, and setup README.

Complements the existing ai-sdk-express (Node.js) example with a
Python equivalent using the official openai package.
Adds token-by-token streaming as the default mode (matching the
ai-sdk-express example which also uses streamText). Pass --no-stream
to use the blocking completion API instead.
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