Skip to content

Instantly share code, notes, and snippets.

@carsongee
Created September 12, 2025 18:49
Show Gist options
  • Select an option

  • Save carsongee/00df6179a652d2d1d8e0cee64914b9df to your computer and use it in GitHub Desktop.

Select an option

Save carsongee/00df6179a652d2d1d8e0cee64914b9df to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
"""
Demo script for LLM Gateway Catalog SDK functionality.
This demonstrates how to use the new LLMGatewayCatalog classes to replace
manual API calls with proper SDK methods.
"""
from __future__ import annotations
from datarobot.models.genai.llm_gateway_catalog import LLMGatewayCatalog
def demo_basic_usage():
"""Demonstrate basic catalog usage."""
print("=== LLM Gateway Catalog Demo ===")
# Get all available models (active, non-deprecated by default)
print("\n1. Getting available models:")
try:
available_models = LLMGatewayCatalog.get_available_models()
print(f"Found {len(available_models)} available models:")
for model in available_models[:5]: # Show first 5
print(f" - {model}")
if len(available_models) > 5:
print(f" ... and {len(available_models) - 5} more")
except Exception as e:
print(f"Error getting available models: {e}")
# Get full catalog entries with details
print("\n2. Getting catalog entries with details:")
try:
catalog_entries = LLMGatewayCatalog.list(limit=3)
print(f"Retrieved {len(catalog_entries)} catalog entries:")
for entry in catalog_entries:
print(f" - {entry.name} ({entry.model})")
print(f" Provider: {entry.provider}")
print(f" Context Size: {entry.context_size:,} tokens")
print(f" Active: {entry.is_active}, Deprecated: {entry.is_deprecated}")
print()
except Exception as e:
print(f"Error getting catalog entries: {e}")
# Verify a specific model is available
print("\n3. Verifying model availability:")
test_models = [
"azure/gpt-4o-2024-11-20", # Example from real API
"azure-openai-gpt-4-o", # Using llmId
"non-existent-model" # This should fail
]
for model_id in test_models:
try:
model_entry = LLMGatewayCatalog.verify_model_availability(model_id)
print(f" ✓ {model_id} is available: {model_entry.name}")
except ValueError as e:
print(f" ✗ {model_id} is not available: {e}")
def demo_advanced_filtering():
"""Demonstrate advanced filtering capabilities."""
print("\n=== Advanced Filtering Demo ===")
# Get all models including deprecated ones
print("\n1. Including deprecated models:")
try:
all_entries = LLMGatewayCatalog.list(
only_active=False,
only_non_deprecated=False,
limit=10
)
active_count = sum(1 for entry in all_entries if entry.is_active)
deprecated_count = sum(1 for entry in all_entries if entry.is_deprecated)
print(f"Found {len(all_entries)} total entries:")
print(f" - Active: {active_count}")
print(f" - Deprecated: {deprecated_count}")
# Show deprecated models with replacement info
deprecated_models = [e for e in all_entries if e.is_deprecated]
if deprecated_models:
print("\nDeprecated models with replacements:")
for entry in deprecated_models[:3]:
print(f" - {entry.model}")
if entry.retirement_date:
print(f" Retirement Date: {entry.retirement_date}")
if entry.suggested_replacement:
print(f" Suggested Replacement: {entry.suggested_replacement}")
print()
except Exception as e:
print(f"Error getting all entries: {e}")
def demo_replacement_pattern():
"""Demonstrate how this replaces the original manual API pattern."""
print("\n=== Replacement Pattern Demo ===")
print("OLD WAY (manual API call):")
print(" response = dr_client.get('genai/llmgw/catalog/')")
print(" models = [item['model'] for item in response.json()['data']]")
print(" # Manual filtering and validation...")
print("\nNEW WAY (using SDK):")
print(" from datarobot.models.genai.llm_gateway_catalog import LLMGatewayCatalog")
print(" models = LLMGatewayCatalog.get_available_models()")
print(" entry = LLMGatewayCatalog.verify_model_availability('model-id')")
print("\nBenefits:")
print(" ✓ Proper error handling")
print(" ✓ Built-in filtering (active, non-deprecated)")
print(" ✓ Rich object model with typed fields")
print(" ✓ Convenience methods for common patterns")
print(" ✓ Consistent with other DataRobot SDK patterns")
if __name__ == "__main__":
print("LLM Gateway Catalog SDK Demo")
print("Note: This requires valid DataRobot credentials and API access")
print()
try:
demo_basic_usage()
demo_advanced_filtering()
demo_replacement_pattern()
print("\n=== Demo Complete ===")
print("The LLM Gateway Catalog SDK is ready for use!")
except Exception as e:
print(f"\nDemo failed with error: {e}")
print("Make sure you have valid DataRobot credentials configured.")
@carsongee
Copy link
Author

Sample output:

LLM Gateway Catalog SDK Demo
Note: This requires valid DataRobot credentials and API access

=== LLM Gateway Catalog Demo ===

1. Getting available models:
Found 66 available models:
  - azure/gpt-4o-2024-11-20
  - azure/gpt-4o-mini
  - azure/o4-mini
  - azure/o3
  - azure/o3-mini
  ... and 61 more

2. Getting catalog entries with details:
Retrieved 72 catalog entries:
  - Azure OpenAI GPT-4o (azure/gpt-4o-2024-11-20)
    Provider: Azure OpenAI
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Azure OpenAI GPT-4o Mini (azure/gpt-4o-mini)
    Provider: Azure OpenAI
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Azure OpenAI o4-mini (azure/o4-mini)
    Provider: Azure OpenAI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Azure OpenAI o3 (azure/o3)
    Provider: Azure OpenAI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Azure OpenAI o3-mini (azure/o3-mini)
    Provider: Azure OpenAI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Azure OpenAI o1 (azure/o1)
    Provider: Azure OpenAI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Amazon Nova Premier (bedrock/amazon.nova-premier-v1:0)
    Provider: Amazon Bedrock
    Context Size: 1,000,000 tokens
    Active: True, Deprecated: False

  - Amazon Nova Pro (bedrock/amazon.nova-pro-v1:0)
    Provider: Amazon Bedrock
    Context Size: 300,000 tokens
    Active: True, Deprecated: False

  - Amazon Nova Lite (bedrock/amazon.nova-lite-v1:0)
    Provider: Amazon Bedrock
    Context Size: 300,000 tokens
    Active: True, Deprecated: False

  - Amazon Nova Micro (bedrock/amazon.nova-micro-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Opus 4.1 (bedrock/anthropic.claude-opus-4-1-20250805-v1:0)
    Provider: Amazon Bedrock
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Opus 4 (bedrock/anthropic.claude-opus-4-20250514-v1:0)
    Provider: Amazon Bedrock
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 4 (bedrock/anthropic.claude-sonnet-4-20250514-v1:0)
    Provider: Amazon Bedrock
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 3.7 v1 (bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0)
    Provider: Amazon Bedrock
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 3.5 v2 (bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0)
    Provider: Amazon Bedrock
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 3.5 v1 (bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0)
    Provider: Amazon Bedrock
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Haiku 3.5 v1 (bedrock/anthropic.claude-3-5-haiku-20241022-v1:0)
    Provider: Amazon Bedrock
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Opus 3 (bedrock/anthropic.claude-3-opus-20240229-v1:0)
    Provider: Amazon Bedrock
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Haiku 3 (bedrock/anthropic.claude-3-haiku-20240307-v1:0)
    Provider: Amazon Bedrock
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Cohere Command R Plus (bedrock/cohere.command-r-plus-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Cohere Command R (bedrock/cohere.command-r-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - DeepSeek R1 v1 (bedrock/deepseek.r1-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 4 Maverick 17B Instruct v1 (bedrock/meta.llama4-maverick-17b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 1,000,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 4 Scout 17B Instruct v1 (bedrock/meta.llama4-scout-17b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 3,500,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 3.3 70B Instruct v1 (bedrock/meta.llama3-3-70b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 3.2 90B Instruct v1 (bedrock/meta.llama3-2-90b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 3.2 11B Instruct v1 (bedrock/meta.llama3-2-11b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 3.2 3B Instruct v1 (bedrock/meta.llama3-2-3b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 131,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 3.2 1B Instruct v1 (bedrock/meta.llama3-2-1b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 131,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 3.1 405B Instruct v1 (bedrock/meta.llama3-1-405b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 3.1 70B Instruct v1 (bedrock/meta.llama3-1-70b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 3.1 8B Instruct v1 (bedrock/meta.llama3-1-8b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Meta Llama 3 8B Instruct v1 (bedrock/meta.llama3-8b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 8,192 tokens
    Active: True, Deprecated: False

  - Meta Llama 3 70B Instruct v1 (bedrock/meta.llama3-70b-instruct-v1:0)
    Provider: Amazon Bedrock
    Context Size: 8,192 tokens
    Active: True, Deprecated: False

  - Mistral Mistral Large 2402 v1 (bedrock/mistral.mistral-large-2402-v1:0)
    Provider: Amazon Bedrock
    Context Size: 32,768 tokens
    Active: True, Deprecated: False

  - Mistral Mistral Small 2402 v1 (bedrock/mistral.mistral-small-2402-v1:0)
    Provider: Amazon Bedrock
    Context Size: 32,768 tokens
    Active: True, Deprecated: False

  - Mistral Mistral 7B Instruct v0 (bedrock/mistral.mistral-7b-instruct-v0:2)
    Provider: Amazon Bedrock
    Context Size: 32,768 tokens
    Active: True, Deprecated: False

  - Mistral Mixtral 8x7B Instruct v0 (bedrock/mistral.mixtral-8x7b-instruct-v0:1)
    Provider: Amazon Bedrock
    Context Size: 32,768 tokens
    Active: True, Deprecated: False

  - OpenAI gpt-oss-120b (bedrock/openai.gpt-oss-120b-1:0)
    Provider: Amazon Bedrock
    Context Size: 131,072 tokens
    Active: True, Deprecated: False

  - OpenAI gpt-oss-20b (bedrock/openai.gpt-oss-20b-1:0)
    Provider: Amazon Bedrock
    Context Size: 131,072 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Opus 4.1 (vertex_ai/claude-opus-4-1@20250805)
    Provider: Google Vertex AI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Opus 4 (vertex_ai/claude-opus-4@20250514)
    Provider: Google Vertex AI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 4 (vertex_ai/claude-sonnet-4@20250514)
    Provider: Google Vertex AI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 3.7 (vertex_ai/claude-3-7-sonnet@20250219)
    Provider: Google Vertex AI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 3.5 v2 (vertex_ai/claude-3-5-sonnet-v2@20241022)
    Provider: Google Vertex AI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 3.5 (vertex_ai/claude-3-5-sonnet@20240620)
    Provider: Google Vertex AI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Haiku 3.5 (vertex_ai/claude-3-5-haiku@20241022)
    Provider: Google Vertex AI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Opus 3 (vertex_ai/claude-3-opus@20240229)
    Provider: Google Vertex AI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Haiku 3 (vertex_ai/claude-3-haiku@20240307)
    Provider: Google Vertex AI
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Google Gemini 2.5 Pro (vertex_ai/gemini-2.5-pro)
    Provider: Google Vertex AI
    Context Size: 1,048,576 tokens
    Active: True, Deprecated: False

  - Google Gemini 2.5 Flash (vertex_ai/gemini-2.5-flash)
    Provider: Google Vertex AI
    Context Size: 1,048,576 tokens
    Active: True, Deprecated: False

  - Google Gemini 2.0 Flash (vertex_ai/gemini-2.0-flash-001)
    Provider: Google Vertex AI
    Context Size: 1,048,576 tokens
    Active: True, Deprecated: False

  - Google Gemini 2.0 Flash Lite (vertex_ai/gemini-2.0-flash-lite-001)
    Provider: Google Vertex AI
    Context Size: 1,048,576 tokens
    Active: True, Deprecated: False

  - Google Llama 4 Maverick 17B 128E Instruct MAAS (vertex_ai/meta/llama-4-maverick-17b-128e-instruct-maas)
    Provider: Google Vertex AI
    Context Size: 524,288 tokens
    Active: True, Deprecated: False

  - Google Llama 4 Scout 17B 16E Instruct MAAS (vertex_ai/meta/llama-4-scout-17b-16e-instruct-maas)
    Provider: Google Vertex AI
    Context Size: 1,310,720 tokens
    Active: True, Deprecated: False

  - Google Llama 3.3 70B Instruct (vertex_ai/meta/llama-3.3-70b-instruct-maas)
    Provider: Google Vertex AI
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Google Llama 3.2 90B Vision Instruct (vertex_ai/meta/llama-3.2-90b-vision-instruct-maas)
    Provider: Google Vertex AI
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Google Llama 3.1 405B Instruct MAAS (vertex_ai/meta/llama-3.1-405b-instruct-maas)
    Provider: Google Vertex AI
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Google Llama 3.1 8B Instruct MAAS (vertex_ai/meta/llama-3.1-8b-instruct-maas)
    Provider: Google Vertex AI
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Google Mistral CodeStral 2501 (vertex_ai/codestral-2501)
    Provider: Google Vertex AI
    Context Size: 32,000 tokens
    Active: True, Deprecated: False

  - Google Mistral Large 2411 (vertex_ai/mistral-large-2411)
    Provider: Google Vertex AI
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Opus 4.1 (anthropic/claude-opus-4-1-20250805)
    Provider: Anthropic
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Opus 4 (anthropic/claude-opus-4-20250514)
    Provider: Anthropic
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 4 (anthropic/claude-sonnet-4-20250514)
    Provider: Anthropic
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Sonnet 3.7 (anthropic/claude-3-7-sonnet-20250219)
    Provider: Anthropic
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Haiku 3.5 (anthropic/claude-3-5-haiku-20241022)
    Provider: Anthropic
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Opus 3 (anthropic/claude-3-opus-20240229)
    Provider: Anthropic
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Anthropic Claude Haiku 3 (anthropic/claude-3-haiku-20240307)
    Provider: Anthropic
    Context Size: 200,000 tokens
    Active: True, Deprecated: False

  - Cohere Command R Plus 08 2024 (cohere/command-r-plus-08-2024)
    Provider: Cohere
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Cohere Command R 08 2024 (cohere/command-r-08-2024)
    Provider: Cohere
    Context Size: 128,000 tokens
    Active: True, Deprecated: False

  - Cohere Command A (cohere/command-a-03-2025)
    Provider: Cohere
    Context Size: 256,000 tokens
    Active: True, Deprecated: False

  - Cohere Command R7B (cohere/command-r7b-12-2024)
    Provider: Cohere
    Context Size: 128,000 tokens
    Active: True, Deprecated: False


3. Verifying model availability:
  ✓ azure/gpt-4o-2024-11-20 is available: Azure OpenAI GPT-4o
  ✓ azure-openai-gpt-4-o is available: Azure OpenAI GPT-4o
  ✗ non-existent-model is not available: Model 'non-existent-model' not found in catalog. Available models: azure/gpt-4o-2024-11-20
.   - azure/gpt-4o-mini
.   - azure/o4-mini
.   - azure/o3
.   - azure/o3-mini
.   - azure/o1
.   - bedrock/amazon.nova-premier-v1:0
.   - bedrock/amazon.nova-pro-v1:0
.   - bedrock/amazon.nova-lite-v1:0
.   - bedrock/amazon.nova-micro-v1:0
.   - bedrock/anthropic.claude-opus-4-1-20250805-v1:0
.   - bedrock/anthropic.claude-opus-4-20250514-v1:0
.   - bedrock/anthropic.claude-sonnet-4-20250514-v1:0
.   - bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0
.   - bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0
.   - bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0
.   - bedrock/anthropic.claude-3-5-haiku-20241022-v1:0
.   - bedrock/anthropic.claude-3-opus-20240229-v1:0
.   - bedrock/anthropic.claude-3-haiku-20240307-v1:0
.   - bedrock/cohere.command-r-plus-v1:0
.   - bedrock/cohere.command-r-v1:0
.   - bedrock/deepseek.r1-v1:0
.   - bedrock/meta.llama4-maverick-17b-instruct-v1:0
.   - bedrock/meta.llama4-scout-17b-instruct-v1:0
.   - bedrock/meta.llama3-3-70b-instruct-v1:0
.   - bedrock/meta.llama3-2-90b-instruct-v1:0
.   - bedrock/meta.llama3-2-11b-instruct-v1:0
.   - bedrock/meta.llama3-2-3b-instruct-v1:0
.   - bedrock/meta.llama3-2-1b-instruct-v1:0
.   - bedrock/meta.llama3-1-405b-instruct-v1:0
.   - bedrock/meta.llama3-1-70b-instruct-v1:0
.   - bedrock/meta.llama3-1-8b-instruct-v1:0
.   - bedrock/meta.llama3-8b-instruct-v1:0
.   - bedrock/meta.llama3-70b-instruct-v1:0
.   - bedrock/mistral.mistral-large-2402-v1:0
.   - bedrock/mistral.mistral-small-2402-v1:0
.   - bedrock/mistral.mistral-7b-instruct-v0:2
.   - bedrock/mistral.mixtral-8x7b-instruct-v0:1
.   - bedrock/openai.gpt-oss-120b-1:0
.   - bedrock/openai.gpt-oss-20b-1:0
.   - vertex_ai/claude-opus-4-1@20250805
.   - vertex_ai/claude-opus-4@20250514
.   - vertex_ai/claude-sonnet-4@20250514
.   - vertex_ai/claude-3-7-sonnet@20250219
.   - vertex_ai/claude-3-5-sonnet-v2@20241022
.   - vertex_ai/claude-3-5-sonnet@20240620
.   - vertex_ai/claude-3-5-haiku@20241022
.   - vertex_ai/claude-3-opus@20240229
.   - vertex_ai/claude-3-haiku@20240307
.   - vertex_ai/gemini-2.5-pro
.   - vertex_ai/gemini-2.5-flash
.   - vertex_ai/gemini-2.0-flash-001
.   - vertex_ai/gemini-2.0-flash-lite-001
.   - vertex_ai/meta/llama-4-maverick-17b-128e-instruct-maas
.   - vertex_ai/meta/llama-4-scout-17b-16e-instruct-maas
.   - vertex_ai/meta/llama-3.3-70b-instruct-maas
.   - vertex_ai/meta/llama-3.2-90b-vision-instruct-maas
.   - vertex_ai/meta/llama-3.1-405b-instruct-maas
.   - vertex_ai/meta/llama-3.1-8b-instruct-maas
.   - vertex_ai/codestral-2501
.   - vertex_ai/mistral-large-2411
.   - anthropic/claude-opus-4-1-20250805
.   - anthropic/claude-opus-4-20250514
.   - anthropic/claude-sonnet-4-20250514
.   - anthropic/claude-3-7-sonnet-20250219
.   - anthropic/claude-3-5-haiku-20241022
.   - anthropic/claude-3-opus-20240229
.   - anthropic/claude-3-haiku-20240307
.   - cohere/command-r-plus-08-2024
.   - cohere/command-r-08-2024
.   - cohere/command-a-03-2025
.   - cohere/command-r7b-12-2024

=== Advanced Filtering Demo ===

1. Including deprecated models:
Found 86 total entries:
  - Active: 79
  - Deprecated: 14

Deprecated models with replacements:
  - azure/gpt-4-turbo
    Retirement Date: 2025-10-15

  - azure/gpt-4-32k
    Retirement Date: 2025-06-06
    Suggested Replacement: azure-openai-gpt-4-turbo

  - azure/gpt-4
    Retirement Date: 2025-06-06
    Suggested Replacement: azure-openai-gpt-4-turbo


=== Replacement Pattern Demo ===
OLD WAY (manual API call):
  response = dr_client.get('genai/llmgw/catalog/')
  models = [item['model'] for item in response.json()['data']]
  # Manual filtering and validation...

NEW WAY (using SDK):
  from datarobot.models.genai.llm_gateway_catalog import LLMGatewayCatalog
  models = LLMGatewayCatalog.get_available_models()
  entry = LLMGatewayCatalog.verify_model_availability('model-id')

Benefits:
  ✓ Proper error handling
  ✓ Built-in filtering (active, non-deprecated)
  ✓ Rich object model with typed fields
  ✓ Convenience methods for common patterns
  ✓ Consistent with other DataRobot SDK patterns

=== Demo Complete ===
The LLM Gateway Catalog SDK is ready for use!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment