Model APIs

APIs for discovering and querying available AI models across different platforms.

GET /api/models/bedrock

Lists all available AWS Bedrock foundation models.

Response (200 OK)

{
  "success": true,
  "region": "eu-north-1",
  "models": [
    {
      "modelId": "amazon.nova-pro-v1:0",
      "providerName": "Amazon",
      "modelArn": "arn:aws:bedrock:eu-north-1::foundation-model/...",
      "inputModalities": ["TEXT", "IMAGE"],
      "outputModalities": ["TEXT"],
      "inferenceTypesSupported": ["ON_DEMAND"],
      "customization": ["FINE_TUNING"]
    },
    {
      "modelId": "anthropic.claude-3-sonnet-20240229-v1:0",
      "providerName": "Anthropic",
      "modelArn": "arn:aws:bedrock:eu-north-1::foundation-model/...",
      "inputModalities": ["TEXT"],
      "outputModalities": ["TEXT"],
      "inferenceTypesSupported": ["ON_DEMAND"],
      "customization": []
    }
  ]
}

GET /api/models/sagemaker

Lists available AWS SageMaker model packages from JumpStart or your account.

Query Parameters

ParameterTypeDescription
searchstringFilter models by name
maxnumberMaximum results (default: 20, max: 50)
sourcestring'jumpstart' | 'account' | 'all'

Response (200 OK)

{
  "success": true,
  "region": "eu-north-1",
  "source": "jumpstart",
  "models": [
    {
      "modelPackageArn": "arn:aws:sagemaker:...",
      "displayName": "Llama 2 7B",
      "creationTime": "2024-01-01T00:00:00Z",
      "modelApprovalStatus": "Approved",
      "inferenceContainers": [
        {
          "image": "763104351884.dkr.ecr.eu-north-1.amazonaws.com/...",
          "modelDataUrl": "s3://bucket/model.tar.gz",
          "framework": "PYTORCH",
          "frameworkVersion": "2.0.0"
        }
      ],
      "supportedContentTypes": ["application/json"],
      "supportedResponseMIMETypes": ["application/json"],
      "supportedRealtimeInferenceInstanceTypes": [
        "ml.g4dn.xlarge",
        "ml.g5.xlarge"
      ],
      "supportedTransformInstanceTypes": ["ml.m5.xlarge"]
    }
  ]
}

GET /api/models/nvidia

Lists available NVIDIA Hosted NIM models.

Query Parameters

ParameterTypeDescription
debugbooleanInclude raw API response (debug=1)

Response (200 OK)

{
  "success": true,
  "provider": "nvidia-nim",
  "models": [
    {
      "id": "mistralai/mistral-7b-instruct-v0.3",
      "name": "Mistral 7B Instruct",
      "provider": "nvidia-nim",
      "tags": ["instruction-following", "7b"],
      "task": "text-generation"
    },
    {
      "id": "meta/llama3-8b-instruct",
      "name": "Llama 3 8B Instruct",
      "provider": "nvidia-nim",
      "tags": ["instruction-following", "8b"],
      "task": "text-generation"
    }
  ]
}

GET /api/bedrock/model-info/[modelId]

Get detailed information about a specific Bedrock model.

Response (200 OK)

{
  "success": true,
  "modelInfo": {
    "modelId": "amazon.nova-pro-v1:0",
    "modelName": "Amazon Nova Pro",
    "providerName": "Amazon",
    "modelArn": "arn:aws:bedrock:...",
    "inputModalities": ["TEXT", "IMAGE"],
    "outputModalities": ["TEXT"],
    "responseStreamingSupported": true,
    "customizationsSupported": ["FINE_TUNING"],
    "inferenceTypesSupported": ["ON_DEMAND"],
    "modelLifecycle": {
      "status": "ACTIVE"
    },
    "pricing": {
      "inputTokens": "$0.0008 per 1K tokens",
      "outputTokens": "$0.0032 per 1K tokens"
    }
  },
  "systemPrompt": "You are a helpful AI assistant...",
  "usage": {
    "totalInvocations": 1245,
    "totalInputTokens": 123456,
    "totalOutputTokens": 234567,
    "estimatedCost": 45.67
  }
}

GET /api/nim/model-info/[modelId]

Get detailed information about a specific NVIDIA NIM model.

Response (200 OK)

{
  "success": true,
  "modelInfo": {
    "modelId": "mistralai/mistral-7b-instruct-v0.3",
    "modelName": "Mistral 7B Instruct",
    "providerName": "Mistralai",
    "modelArn": "nvidia-nim://mistralai/mistral-7b-instruct-v0.3",
    "inputModalities": ["TEXT"],
    "outputModalities": ["TEXT"],
    "responseStreamingSupported": true,
    "customizationsSupported": ["SYSTEM_PROMPT"],
    "inferenceTypesSupported": ["ON_DEMAND"],
    "modelLifecycle": {
      "status": "ACTIVE"
    },
    "pricing": {
      "inputTokens": "Token-based pricing",
      "outputTokens": "Token-based pricing"
    }
  },
  "systemPrompt": "You are a helpful AI assistant...",
  "usage": {
    "totalInvocations": 856,
    "totalInputTokens": 98765,
    "totalOutputTokens": 123456,
    "estimatedCost": 32.45
  }
}

📋 Model Selection Tips

  • Bedrock: Best for managed, pay-per-token models with no infrastructure
  • SageMaker: Best for custom models and dedicated infrastructure
  • NVIDIA NIM: Best for cost-effective, high-performance inference