@llmops/app 0.2.6 → 0.2.7-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
@@ -15601,6 +15601,22 @@ const createRequestGuardMiddleware = () => {
15601
15601
  //#endregion
15602
15602
  //#region src/server/handlers/genai/gatewayAdapter.ts
15603
15603
  /**
15604
+ * Provider ID mapping from models.dev to Portkey gateway.
15605
+ * models.dev uses different provider IDs than Portkey for some providers.
15606
+ */
15607
+ const MODELS_DEV_TO_PORTKEY_PROVIDER_MAP = {
15608
+ reka: "reka-ai",
15609
+ "azure-cognitive-services": "azure-openai",
15610
+ azure: "azure-openai"
15611
+ };
15612
+ /**
15613
+ * Get the Portkey gateway provider ID for a given provider ID.
15614
+ * Returns the original ID if no mapping exists.
15615
+ */
15616
+ function getPortkeyProviderId(providerId) {
15617
+ return MODELS_DEV_TO_PORTKEY_PROVIDER_MAP[providerId] ?? providerId;
15618
+ }
15619
+ /**
15604
15620
  * Maps LLMOps provider names to Portkey provider names
15605
15621
  */
15606
15622
  const PROVIDER_MAP = {
@@ -15678,7 +15694,7 @@ const createGatewayAdapterMiddleware = () => {
15678
15694
  envSecret: envSec
15679
15695
  }), { namespace: `config:${configId}` });
15680
15696
  const variantConfig = __llmops_core.variantJsonDataSchema.parse(typeof data.jsonData === "string" ? JSON.parse(data.jsonData) : data.jsonData);
15681
- const portkeyProvider = PROVIDER_MAP[data.provider] || data.provider;
15697
+ const portkeyProvider = getPortkeyProviderId(PROVIDER_MAP[data.provider] || data.provider);
15682
15698
  const providerConfig = await cacheService.getOrSet(`provider:${data.provider}`, () => db.getProviderConfigByProviderId({ providerId: data.provider }), { namespace: "provider-configs" });
15683
15699
  const configData = typeof providerConfig?.config === "string" ? JSON.parse(providerConfig.config) : providerConfig?.config;
15684
15700
  const apiKey = configData?.apiKey;
@@ -15699,8 +15715,19 @@ const createGatewayAdapterMiddleware = () => {
15699
15715
  if (configData?.awsSecretAccessKey) portkeyConfig.aws_secret_access_key = configData.awsSecretAccessKey;
15700
15716
  if (configData?.awsSessionToken) portkeyConfig.aws_session_token = configData.awsSessionToken;
15701
15717
  if (configData?.awsRegion) portkeyConfig.aws_region = configData.awsRegion;
15718
+ if (configData?.resourceName) portkeyConfig.azure_resource_name = configData.resourceName;
15719
+ if (configData?.deploymentId) {
15720
+ portkeyConfig.azure_deployment_id = configData.deploymentId;
15721
+ portkeyConfig.azure_model_name = configData.deploymentId;
15722
+ }
15723
+ if (configData?.apiVersion) portkeyConfig.azure_api_version = configData.apiVersion;
15702
15724
  if (configData?.azureAuthMode) portkeyConfig.azure_auth_mode = configData.azureAuthMode;
15703
- if (configData?.deploymentId) portkeyConfig.azure_model_name = configData.deploymentId;
15725
+ if (configData?.azureAdToken) portkeyConfig.azure_ad_token = configData.azureAdToken;
15726
+ if (configData?.azureManagedClientId) portkeyConfig.azure_managed_client_id = configData.azureManagedClientId;
15727
+ if (configData?.azureWorkloadClientId) portkeyConfig.azure_workload_client_id = configData.azureWorkloadClientId;
15728
+ if (configData?.azureEntraClientId) portkeyConfig.azure_entra_client_id = configData.azureEntraClientId;
15729
+ if (configData?.azureEntraClientSecret) portkeyConfig.azure_entra_client_secret = configData.azureEntraClientSecret;
15730
+ if (configData?.azureEntraTenantId) portkeyConfig.azure_entra_tenant_id = configData.azureEntraTenantId;
15704
15731
  if (configData?.vertexProjectId) portkeyConfig.vertex_project_id = configData.vertexProjectId;
15705
15732
  if (configData?.vertexRegion) portkeyConfig.vertex_region = configData.vertexRegion;
15706
15733
  if (configData?.vertexServiceAccountJson) try {
package/dist/index.mjs CHANGED
@@ -15575,6 +15575,22 @@ const createRequestGuardMiddleware = () => {
15575
15575
  //#endregion
15576
15576
  //#region src/server/handlers/genai/gatewayAdapter.ts
15577
15577
  /**
15578
+ * Provider ID mapping from models.dev to Portkey gateway.
15579
+ * models.dev uses different provider IDs than Portkey for some providers.
15580
+ */
15581
+ const MODELS_DEV_TO_PORTKEY_PROVIDER_MAP = {
15582
+ reka: "reka-ai",
15583
+ "azure-cognitive-services": "azure-openai",
15584
+ azure: "azure-openai"
15585
+ };
15586
+ /**
15587
+ * Get the Portkey gateway provider ID for a given provider ID.
15588
+ * Returns the original ID if no mapping exists.
15589
+ */
15590
+ function getPortkeyProviderId(providerId) {
15591
+ return MODELS_DEV_TO_PORTKEY_PROVIDER_MAP[providerId] ?? providerId;
15592
+ }
15593
+ /**
15578
15594
  * Maps LLMOps provider names to Portkey provider names
15579
15595
  */
15580
15596
  const PROVIDER_MAP = {
@@ -15652,7 +15668,7 @@ const createGatewayAdapterMiddleware = () => {
15652
15668
  envSecret: envSec
15653
15669
  }), { namespace: `config:${configId}` });
15654
15670
  const variantConfig = variantJsonDataSchema.parse(typeof data.jsonData === "string" ? JSON.parse(data.jsonData) : data.jsonData);
15655
- const portkeyProvider = PROVIDER_MAP[data.provider] || data.provider;
15671
+ const portkeyProvider = getPortkeyProviderId(PROVIDER_MAP[data.provider] || data.provider);
15656
15672
  const providerConfig = await cacheService.getOrSet(`provider:${data.provider}`, () => db.getProviderConfigByProviderId({ providerId: data.provider }), { namespace: "provider-configs" });
15657
15673
  const configData = typeof providerConfig?.config === "string" ? JSON.parse(providerConfig.config) : providerConfig?.config;
15658
15674
  const apiKey = configData?.apiKey;
@@ -15673,8 +15689,19 @@ const createGatewayAdapterMiddleware = () => {
15673
15689
  if (configData?.awsSecretAccessKey) portkeyConfig.aws_secret_access_key = configData.awsSecretAccessKey;
15674
15690
  if (configData?.awsSessionToken) portkeyConfig.aws_session_token = configData.awsSessionToken;
15675
15691
  if (configData?.awsRegion) portkeyConfig.aws_region = configData.awsRegion;
15692
+ if (configData?.resourceName) portkeyConfig.azure_resource_name = configData.resourceName;
15693
+ if (configData?.deploymentId) {
15694
+ portkeyConfig.azure_deployment_id = configData.deploymentId;
15695
+ portkeyConfig.azure_model_name = configData.deploymentId;
15696
+ }
15697
+ if (configData?.apiVersion) portkeyConfig.azure_api_version = configData.apiVersion;
15676
15698
  if (configData?.azureAuthMode) portkeyConfig.azure_auth_mode = configData.azureAuthMode;
15677
- if (configData?.deploymentId) portkeyConfig.azure_model_name = configData.deploymentId;
15699
+ if (configData?.azureAdToken) portkeyConfig.azure_ad_token = configData.azureAdToken;
15700
+ if (configData?.azureManagedClientId) portkeyConfig.azure_managed_client_id = configData.azureManagedClientId;
15701
+ if (configData?.azureWorkloadClientId) portkeyConfig.azure_workload_client_id = configData.azureWorkloadClientId;
15702
+ if (configData?.azureEntraClientId) portkeyConfig.azure_entra_client_id = configData.azureEntraClientId;
15703
+ if (configData?.azureEntraClientSecret) portkeyConfig.azure_entra_client_secret = configData.azureEntraClientSecret;
15704
+ if (configData?.azureEntraTenantId) portkeyConfig.azure_entra_tenant_id = configData.azureEntraTenantId;
15678
15705
  if (configData?.vertexProjectId) portkeyConfig.vertex_project_id = configData.vertexProjectId;
15679
15706
  if (configData?.vertexRegion) portkeyConfig.vertex_region = configData.vertexRegion;
15680
15707
  if (configData?.vertexServiceAccountJson) try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmops/app",
3
- "version": "0.2.6",
3
+ "version": "0.2.7-beta.1",
4
4
  "description": "LLMOps application with server and client",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -66,8 +66,8 @@
66
66
  "react-aria-components": "^1.13.0",
67
67
  "react-hook-form": "^7.68.0",
68
68
  "recharts": "^3.6.0",
69
- "@llmops/core": "^0.2.6",
70
- "@llmops/gateway": "^0.2.6"
69
+ "@llmops/core": "^0.2.7-beta.1",
70
+ "@llmops/gateway": "^0.2.7-beta.1"
71
71
  },
72
72
  "peerDependencies": {
73
73
  "react": "^19.2.1",