@llmops/gateway 0.2.7-beta.2 → 0.2.8-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -10375,7 +10375,7 @@ const retryRequest = async (url, options, retryCount, statusCodesToRetry, timeou
10375
10375
 
10376
10376
  //#endregion
10377
10377
  //#region package.json
10378
- var version = "0.2.7-beta.2";
10378
+ var version = "0.2.8-beta.1";
10379
10379
 
10380
10380
  //#endregion
10381
10381
  //#region src/providers/bytez/api.ts
@@ -26578,13 +26578,13 @@ const AzureAIInferenceAPI = {
26578
26578
  return "";
26579
26579
  },
26580
26580
  headers: async ({ providerOptions, fn, c }) => {
26581
- const { apiKey, azureExtraParameters, azureDeploymentName, azureAdToken, azureAuthMode, azureFoundryUrl, urlToFetch } = providerOptions;
26581
+ const { apiKey, azureExtraParameters, azureDeploymentName, deploymentId, azureAdToken, azureAuthMode, azureFoundryUrl, urlToFetch } = providerOptions;
26582
26582
  const isAnthropicModel = azureFoundryUrl?.includes("anthropic") || urlToFetch?.includes("anthropic");
26583
26583
  if (isAnthropicModel && !providerOptions.anthropicVersion) providerOptions.anthropicVersion = "2023-06-01";
26584
26584
  const headers = {
26585
26585
  ...isAnthropicModel && { "anthropic-version": providerOptions.anthropicVersion },
26586
26586
  "extra-parameters": azureExtraParameters ?? "drop",
26587
- ...azureDeploymentName && { "azureml-model-deployment": azureDeploymentName },
26587
+ ...(deploymentId || azureDeploymentName) && { "azureml-model-deployment": deploymentId || azureDeploymentName },
26588
26588
  ...[
26589
26589
  "createTranscription",
26590
26590
  "createTranslation",
@@ -26636,18 +26636,20 @@ const AzureAIInferenceAPI = {
26636
26636
  return headers;
26637
26637
  },
26638
26638
  getEndpoint: ({ providerOptions, fn, gatewayRequestURL }) => {
26639
- const { azureApiVersion, urlToFetch, azureFoundryUrl } = providerOptions;
26639
+ const { azureApiVersion, urlToFetch, azureFoundryUrl, deploymentId, azureDeploymentName } = providerOptions;
26640
26640
  const isAnthropicModel = azureFoundryUrl?.includes("anthropic") || urlToFetch?.includes("anthropic");
26641
26641
  let mappedFn = fn;
26642
26642
  const urlObj = new URL(gatewayRequestURL);
26643
26643
  const path$2 = urlObj.pathname.replace("/v1", "");
26644
26644
  const searchParams = urlObj.searchParams;
26645
26645
  if (azureApiVersion) searchParams.set("api-version", azureApiVersion);
26646
+ const deploymentName = deploymentId || azureDeploymentName;
26647
+ const deploymentPrefix = deploymentName ? `/deployments/${deploymentName}` : "";
26646
26648
  const ENDPOINT_MAPPING = {
26647
- complete: "/completions",
26648
- chatComplete: isAnthropicModel ? "/v1/messages" : "/chat/completions",
26649
+ complete: deploymentPrefix + "/completions",
26650
+ chatComplete: isAnthropicModel ? "/v1/messages" : deploymentPrefix + "/chat/completions",
26649
26651
  messages: "/v1/messages",
26650
- embed: "/embeddings",
26652
+ embed: deploymentPrefix + "/embeddings",
26651
26653
  realtime: "/realtime",
26652
26654
  imageGenerate: "/images/generations",
26653
26655
  imageEdit: "/images/edits",
@@ -31636,8 +31638,8 @@ function constructConfigFromRequestHeaders(requestHeaders) {
31636
31638
  ...fireworksConfig
31637
31639
  };
31638
31640
  if (parsedConfigJson.provider === AZURE_AI_INFERENCE) parsedConfigJson = {
31639
- ...parsedConfigJson,
31640
- ...azureAiInferenceConfig
31641
+ ...azureAiInferenceConfig,
31642
+ ...parsedConfigJson
31641
31643
  };
31642
31644
  if (parsedConfigJson.provider === ANTHROPIC) parsedConfigJson = {
31643
31645
  ...parsedConfigJson,
package/dist/index.mjs CHANGED
@@ -10348,7 +10348,7 @@ const retryRequest = async (url, options, retryCount, statusCodesToRetry, timeou
10348
10348
 
10349
10349
  //#endregion
10350
10350
  //#region package.json
10351
- var version = "0.2.7-beta.2";
10351
+ var version = "0.2.8-beta.1";
10352
10352
 
10353
10353
  //#endregion
10354
10354
  //#region src/providers/bytez/api.ts
@@ -26551,13 +26551,13 @@ const AzureAIInferenceAPI = {
26551
26551
  return "";
26552
26552
  },
26553
26553
  headers: async ({ providerOptions, fn, c }) => {
26554
- const { apiKey, azureExtraParameters, azureDeploymentName, azureAdToken, azureAuthMode, azureFoundryUrl, urlToFetch } = providerOptions;
26554
+ const { apiKey, azureExtraParameters, azureDeploymentName, deploymentId, azureAdToken, azureAuthMode, azureFoundryUrl, urlToFetch } = providerOptions;
26555
26555
  const isAnthropicModel = azureFoundryUrl?.includes("anthropic") || urlToFetch?.includes("anthropic");
26556
26556
  if (isAnthropicModel && !providerOptions.anthropicVersion) providerOptions.anthropicVersion = "2023-06-01";
26557
26557
  const headers = {
26558
26558
  ...isAnthropicModel && { "anthropic-version": providerOptions.anthropicVersion },
26559
26559
  "extra-parameters": azureExtraParameters ?? "drop",
26560
- ...azureDeploymentName && { "azureml-model-deployment": azureDeploymentName },
26560
+ ...(deploymentId || azureDeploymentName) && { "azureml-model-deployment": deploymentId || azureDeploymentName },
26561
26561
  ...[
26562
26562
  "createTranscription",
26563
26563
  "createTranslation",
@@ -26609,18 +26609,20 @@ const AzureAIInferenceAPI = {
26609
26609
  return headers;
26610
26610
  },
26611
26611
  getEndpoint: ({ providerOptions, fn, gatewayRequestURL }) => {
26612
- const { azureApiVersion, urlToFetch, azureFoundryUrl } = providerOptions;
26612
+ const { azureApiVersion, urlToFetch, azureFoundryUrl, deploymentId, azureDeploymentName } = providerOptions;
26613
26613
  const isAnthropicModel = azureFoundryUrl?.includes("anthropic") || urlToFetch?.includes("anthropic");
26614
26614
  let mappedFn = fn;
26615
26615
  const urlObj = new URL(gatewayRequestURL);
26616
26616
  const path$2 = urlObj.pathname.replace("/v1", "");
26617
26617
  const searchParams = urlObj.searchParams;
26618
26618
  if (azureApiVersion) searchParams.set("api-version", azureApiVersion);
26619
+ const deploymentName = deploymentId || azureDeploymentName;
26620
+ const deploymentPrefix = deploymentName ? `/deployments/${deploymentName}` : "";
26619
26621
  const ENDPOINT_MAPPING = {
26620
- complete: "/completions",
26621
- chatComplete: isAnthropicModel ? "/v1/messages" : "/chat/completions",
26622
+ complete: deploymentPrefix + "/completions",
26623
+ chatComplete: isAnthropicModel ? "/v1/messages" : deploymentPrefix + "/chat/completions",
26622
26624
  messages: "/v1/messages",
26623
- embed: "/embeddings",
26625
+ embed: deploymentPrefix + "/embeddings",
26624
26626
  realtime: "/realtime",
26625
26627
  imageGenerate: "/images/generations",
26626
26628
  imageEdit: "/images/edits",
@@ -31609,8 +31611,8 @@ function constructConfigFromRequestHeaders(requestHeaders) {
31609
31611
  ...fireworksConfig
31610
31612
  };
31611
31613
  if (parsedConfigJson.provider === AZURE_AI_INFERENCE) parsedConfigJson = {
31612
- ...parsedConfigJson,
31613
- ...azureAiInferenceConfig
31614
+ ...azureAiInferenceConfig,
31615
+ ...parsedConfigJson
31614
31616
  };
31615
31617
  if (parsedConfigJson.provider === ANTHROPIC) parsedConfigJson = {
31616
31618
  ...parsedConfigJson,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmops/gateway",
3
- "version": "0.2.7-beta.2",
3
+ "version": "0.2.8-beta.1",
4
4
  "description": "AI gateway for LLMOps (forked from Portkey)",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",