Repository navigation
Conversation
Contributor
Author
|
Below is a quick demo of the new model discovery helpers. Given that the new base version is released and reused by core package, and we initialize the base client as follows: from ai_core_sdk.ai_core_v2_client import AICoreV2Client
from ai_api_client_sdk.helpers.llm_helper import (
filter_foundation_models_by_capability,
filter_foundation_models_non_deprecated,
get_foundation_model_latest_versions,
)
client = AICoreV2Client.from_env()List all available modelsmodels = client.get_models()Filter by capabilityvision_models = filter_foundation_models_by_capability(models, "vision")Filter out deprecated versionsactive_models = filter_foundation_models_non_deprecated(models)
print(f"Models before: {len(models)}")
print(f"Models after removing deprecated: {len(active_models)}\n")Get latest versions per modellatest = get_foundation_model_latest_versions(models)
print(f"Latest versions for first 5 models:\n")
for entry in latest[:5]:
version_names = [v.name for v in entry["latest_versions"]]
print(f" {entry['model']} ({entry['executable_id']}): {version_names}")Resolve orchestration deploymentfrom ai_api_client_sdk.models.status import Status
orch_deployments = client.deployment.query(
scenario_id="orchestration",
status=Status.RUNNING,
).resourcesResolve a foundation model deploymentfm_deployments = client.deployment.query(
scenario_id="foundation-models",
status=Status.RUNNING,
).resources
if fm_deployments:
d = fm_deployments[0]
model_info = (d.details or {}).get("resources", {}).get("backend_details", {}).get("model", {})
print(f"Deployment ID: {d.id}")
print(f"Model: {model_info.get('name', 'unknown')}")
print(f"Deployment URL: {d.deployment_url}")
else:
print("No running foundation model deployment found.") |
OscarDDD
reviewed
Nov 4, 2026
OscarDDD
reviewed
Nov 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Closes SAP/ai-sdk-python-backlog#76.
What this PR does and why it is needed
This PR proposes a new utility function contributing to a more convenient model discovery using the base model client. The new function wraps the
.query(...)method and returns the list of models directly.Definition of Done