Skip to content

Python: docs: add OpenAI-compatible control plane example#14054

Open
cerebrixos wants to merge 1 commit into
microsoft:mainfrom
cerebrixos:tuning-engines-openai-compatible-client
Open

Python: docs: add OpenAI-compatible control plane example#14054
cerebrixos wants to merge 1 commit into
microsoft:mainfrom
cerebrixos:tuning-engines-openai-compatible-client

Conversation

@cerebrixos
Copy link
Copy Markdown

This adds a small manual-configuration example showing how to pass a custom AsyncOpenAI client to OpenAIChatCompletion for an OpenAI-compatible gateway or control plane.\n\nWhy this may be useful:\n- Semantic Kernel already supports custom OpenAI clients through the async_client parameter.\n- Production teams often route model traffic through centralized controls for model access, policy, audit trails, quotas, routing, and cost reporting.\n- The example keeps Semantic Kernel responsible for orchestration, functions, plugins, memory, and agents while the external control plane handles organization-wide governance.\n\nThe change is docs-only and uses placeholder environment variables.

Copilot AI review requested due to automatic review settings June 4, 2026 15:57
@cerebrixos cerebrixos requested a review from a team as a code owner June 4, 2026 15:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds guidance to the Python “Configuring the Kernel” doc for using a custom OpenAI-compatible client (e.g., when routing through a gateway/control plane), and cleans up the Microsoft Entra authentication link formatting.

Changes:

  • Document passing a custom OpenAI-compatible AsyncOpenAI client into OpenAIChatCompletion.
  • Add an example using Tuning Engines’ OpenAI-compatible endpoint.
  • Fix formatting of the Microsoft Entra authentication guide link.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +65 to +67
You can also pass a custom OpenAI-compatible client to `OpenAIChatCompletion` when your organization routes model calls through a gateway or control plane for centralized model access, policy, audit trails, quota enforcement, or cost reporting.

For example, [Tuning Engines](https://www.tuningengines.com/) exposes an OpenAI-compatible endpoint:
Comment on lines +72 to +73
from openai import AsyncOpenAI
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
@moonbox3 moonbox3 added python Pull requests for the Python Semantic Kernel documentation labels Jun 4, 2026
@github-actions github-actions Bot changed the title docs: add OpenAI-compatible control plane example Python: docs: add OpenAI-compatible control plane example Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation needs-maintainer-triage python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants