{"id":23789,"library":"generative-ai-hub-sdk","title":"Generative AI Hub SDK (Deprecated)","description":"DEPRECATED. The generative AI hub SDK provides a Python interface to interact with SAP AI Core's generative AI hub and foundation models. Version 4.12.4 final release. No longer maintained; superseded by the AI Core SDK.","status":"deprecated","version":"4.12.4","language":"python","source_language":"en","source_url":"https://github.com/SAP-samples/generative-ai-hub-sdk","tags":["deprecated","sap","ai-core","gen-ai-hub","llm"],"install":[{"cmd":"pip install generative-ai-hub-sdk","lang":"bash","label":"Latest version"}],"dependencies":[],"imports":[{"note":"Old imports from the top-level package 'generative_ai_hub' are incorrect; use 'gen_ai_hub'.","wrong":"from generative_ai_hub import ...","symbol":"ai_core","correct":"from gen_ai_hub import gen_ai_hub"},{"note":"","wrong":null,"symbol":"FoundationModelDeployment","correct":"from gen_ai_hub.models import FoundationModelDeployment"}],"quickstart":{"code":"from gen_ai_hub import gen_ai_hub\n# Replace with your actual AI Core service key values or environment variables\nai_core_client = gen_ai_hub.AICoreClient(\n    base_url=os.environ.get('AICORE_BASE_URL', ''),\n    auth_url=os.environ.get('AICORE_AUTH_URL', ''),\n    client_id=os.environ.get('AICORE_CLIENT_ID', ''),\n    client_secret=os.environ.get('AICORE_CLIENT_SECRET', '')\n)\nprint(ai_core_client.get_deployments()[:1])","lang":"python","description":"Initialize the AI Core client and fetch first deployment."},"warnings":[{"fix":"Uninstall generative-ai-hub-sdk and replace with ai-core-sdk. See migration guide at https://help.sap.com/docs/AI_CORE.","message":"This library is deprecated. SAP officially recommends migrating to the AI Core SDK (ai-core-sdk). No new features or security patches will be released.","severity":"deprecated","affected_versions":"all"},{"fix":"Use 'from gen_ai_hub import gen_ai_hub' or 'from gen_ai_hub.models import ...'.","message":"The correct import module is 'gen_ai_hub', not 'generative_ai_hub' or 'gen_ai_hub_sdk'. Many users mistakenly use the PyPI package name.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Change imports to 'from gen_ai_hub import gen_ai_hub'.","message":"Breaking change in v4.0.0: The 'ai_core' module was renamed to 'gen_ai_hub'. Old code using 'from generative_ai_hub import ai_core' will break.","severity":"breaking","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use correct import: 'from gen_ai_hub import gen_ai_hub'.","cause":"The package installs as 'gen_ai_hub' module, not 'generative_ai_hub'.","error":"ModuleNotFoundError: No module named 'generative_ai_hub'"},{"fix":"Use: 'from gen_ai_hub import gen_ai_hub; client = gen_ai_hub.AICoreClient(...)'","cause":"AICoreClient is under gen_ai_hub.gen_ai_hub, not directly in gen_ai_hub.","error":"ImportError: cannot import name 'AICoreClient' from 'gen_ai_hub'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}