Skip to content

client/python: add OpenAI-compatible REST API samples#4096

Open
retryoos wants to merge 1 commit intoopenvinotoolkit:mainfrom
retryoos:openai-api-python-samples
Open

client/python: add OpenAI-compatible REST API samples#4096
retryoos wants to merge 1 commit intoopenvinotoolkit:mainfrom
retryoos:openai-api-python-samples

Conversation

@retryoos
Copy link
Copy Markdown

@retryoos retryoos commented Mar 28, 2026

🛠 Summary

JIRA/Issue if applicable: N/A (small Python client samples addition)

This PR adds OpenAI-compatible REST API Python samples under client/python/openai-api/samples/ and links them from client/python/README.md.

Added:

  • http_list_models.py for GET /v3/models
  • http_chat_completions.py for unary POST /v3/chat/completions
  • http_chat_completions_stream.py for streaming POST /v3/chat/completions (stream: true, SSE parsing)
  • README.md with setup, usage, and examples
  • requirements.txt (stdlib-only note)

Updated:

  • client/python/README.md with a link to the new OpenAI API samples section

Notes:

  • Local validation done with python3 -m py_compile and --help checks for all scripts.
  • Runtime error path was validated without a running OVMS instance (clear connection-refused behavior).
  • End-to-end runtime test depends on OVMS startup/model load.

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.

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