-
Notifications
You must be signed in to change notification settings - Fork 100
Description
Description: When configuring a custom OpenAI-compatible endpoint hosted in Azure with Stakpak, there is no option to specify the required API version. Referencing the documentation https://stakpak.gitbook.io/docs/get-started/configure-stakpak#stakpak-open-source , I attempted to append the version as a query parameter to the endpoint URL, but requests fail. Without a placeholder for API version in the configuration flow, it’s unclear how to correctly set up Azure OpenAI endpoints.
Attempted endpoint: https://rsg-dummy.openai.azure.com?api-version=2024-12-01-preview/
Outcome: Requests fail with [Error] Bad Request: ApiError("error decoding response body")
Request:
Please provide guidance on how to correctly configure an Azure OpenAI-compatible endpoint in Stakpak, specifically how to set the api_version required by Azure.
If Stakpak supports Azure OpenAI, is there a configuration key (e.g., profiles.default.openai.api_version or similar) or a different endpoint format expected?
If appending api-version in the URL is unsupported, can support be added, or can you document the correct approach?
Reproduction steps (Docker):
-
Run container:
docker run -it --entrypoint stakpak ghcr.io/stakpak/agent:latest -
Select: Use my own Model/API Key
-
Select: Bring your own model
-
Enter OpenAI-compatible API endpoint:
https://rsg-dummy.openai.azure.com?api-version=2024-12-01-preview/
Note: Endpoint masked asrsg-dummy -
Enter API key:
myownapikey -
Set models:
Smart model name:o3-mini
Eco model name:o3-mini -
Configuration preview printed by Stakpak
[profiles.default]
provider="local"
smart_model="o3-mini"
eco_model="o3-mini"
[profiles.default.openai]
api_endpoint="https://rsg-dummy.openai.azure.com?api-version=2024-12-01-preview"
api_key="***"
- Make a request (e.g., “Dockerize my app”) → failure:
[Error] Bad Request: ApiError("error decoding response body")
Observed behavior:
The endpoint and credentials work in the same environment when using the Azure OpenAI SDK with explicit api_version. This suggests the failure is due to how Stakpak constructs requests or handles the api-version parameter.
Working python code
import os
from openai import AzureOpenAI
endpoint = "https://rsg-dummy.openai.azure.com/"
model_name = "o3-mini"
deployment = "o3-mini"
subscription_key = "myownapikey"
api_version = "2024-12-01-preview"
client = AzureOpenAI(
api_version=api_version,
azure_endpoint=endpoint,
api_key=subscription_key,
)
response = client.chat.completions.create(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "I am going to Paris, what should I see?"},
],
max_completion_tokens=100000,
model=deployment,
)
print(response.choices[0].message.content)