Generative AI has broken out of research labs and is now transforming the way business is done. SAP is moving at full speed to embrace this trend and has launched an agent called Joule. In this blog series, Iāll provide a āsuper-fast hands-onā guide to help you quickly call default models ofĀ SAP AI Core and expand them into practical AI agents for real-world business use, so you can understand how these agents work behind the scenes.
Notice
The Japanese version is available here.
Ā
šWhat Youāll Learn in This Series
How to spin up a custom AIāÆagent on SAPāÆAIĀ Core in minutesHandsāon with LangChain, Google Search Tool, RAG, and StreamlitExposing the agent as a RESTĀ API and rebuilding the UI in SAPUI5/Fiori
Time Commitment
Each part is designed to be completed inĀ 10ā15Ā minutes
Ā
šŗļø Series Roadmap
Part 0 ProloguePart 1 Env Setup: SAP AICore & AI Launchpad [current blog]Part 2 Building a Chat Model withĀ LangChainPart 3 AgentĀ Tools: Integrating GoogleĀ SearchPart 4 RAG Basics ā : HANA Cloud VectorEngine & EmbeddingPart 5 RAG Basics ā”: Building Retriever ToolPart 6 Streamlit BasicsPart 7Ā Streamlit UI PrototypeĀ Part 8 Expose as a RESTĀ APIPart 9 Rebuild theĀ UI withĀ SAPUI5 1st HalfĀ Part 10 Rebuild theĀ UI withĀ SAPUI5 2ndĀ Half
If you enjoyed this post, please give it aĀ kudos! Your support really motivates me. Also, if thereās anything youād like to know more about, feel free to leave a comment!
Env Setup: SAP AICore & AI Launchpad
1Ā | Overview
In this chapter, weāll connect to SAP AI Launchpad using the service key created for the SAP AI Core instance. Then, weāll proceed to deploy the LLM for running a chat model.
Ā
2 | Prerequisites
BTP sub-accountSAP AI Core instanceSAP AI LaunchPad SubscriptionPython 3.13 and pipVSCode, BAS or any IDE
Ā
3Ā | Create a ServiceĀ Key
Creating a serviceĀ key gives your local scripts a secure, OAuthābased passport into SAPĀ AIĀ Core.Ā Without it, Python SDK calls have no way to authenticate or discover endpoints.
Open your AIāÆCore instance in BTP Cockpit ā Instances &āÆSubscriptions.
Go to the ServiceĀ Keys tab and click Create. Give it any name.
Download the generated JSON; youāll need it later.
NOTE ā Resource Group
When calling SAPĀ AIĀ Core from Python you must set an extra environment variable named RESOURCE_GROUP in addition to the values contained in the service key. In this tutorial weāll simply point it to the builtāin default group.
4Ā | Connect AIāÆLaunchpad
You can deploy an LLM (Large Language Model) directly to SAP AI Core using the service key you created earlier. However, in this guide, we’ll use SAP AI Launchpad to make the deployment process easier.
To begin, you’ll need to establish a secure connection route from SAP AI Launchpad to SAP AI Core.
From Subscriptions open AIāÆLaunchpad ā GoĀ toĀ Application.
Click Add (topāright) ā API Connection and upload the ServiceĀ Key JSON.
Select the default Resource Group in the side panel and save.
Ā
5Ā | Configure &Ā Deploy an LLM
On the “Configuration” screen of SAP Launchpad, you can select the type of foundation model to use. Think of this as creating a model profile that can be shared across multiple deployments.
Letās go ahead and create the configuration. In this case, weāll use the default foundation_models scenario and configure it to use gapt-4o-mini.
Navigate MLāÆOperations ā Settings and click Create.
Fill in: NameĀ =Ā <anyānameāyouālike>, ScenarioĀ =Ā foundation_models, VersionĀ =Ā 0.0.1, ExecutableĀ =Ā azure-openai.
On the parameter screen leave modelName = gpt-4o-mini, modelVersion = latest and click Next ā Create.
Youāll land on the new Setting detail pageācheck that all fields look correct; no extra edits needed.
ClickĀ CreateĀ DeploymentĀ (topāright), breeze through the wizard by clickingĀ NextĀ untilĀ Create.
Wait untilĀ Status =Ā Runningāhit the Refresh icon every few seconds. Copy theĀ DeploymentĀ ID shown in the title bar for later use.
By the way, there are various LLMs available to run on SAP AI Core. You can browse them in the Generative AI Hub > Model Library section.
The Leaderboard also allows you to compare models based on accuracy, token cost, and other metrics.
Ā
6 | NextĀ Up
Part 2 Building a Chat Model withĀ LangChain / LangChain ć§ćć£ććć¢ćć«ćę§ēÆ
Weāll finally implement the chat model!Ā Make sure your Python development environment is readyāVS Code or a similar IDE will work perfectly!
Ā
Disclaimer
All the views and opinions in the blog are my own and is made in my personal capacity and that SAP shall not be responsible or liable for any of the contents published in this blog.
Ā
āĀ Generative AI has broken out of research labs and is now transforming the way business is done. SAP is moving at full speed to embrace this trend and has launched an agent called Joule. In this blog series, Iāll provide a āsuper-fast hands-onā guide to help you quickly call default models ofĀ SAP AI Core and expand them into practical AI agents for real-world business use, so you can understand how these agents work behind the scenes.NoticeThe Japanese version is available here.Ā šWhat Youāll Learn in This SeriesHow to spin up a custom AIāÆagent on SAPāÆAIĀ Core in minutesHandsāon with LangChain, Google Search Tool, RAG, and StreamlitExposing the agent as a RESTĀ API and rebuilding the UI in SAPUI5/FioriTime CommitmentEach part is designed to be completed inĀ 10ā15Ā minutesĀ šŗļø Series RoadmapPart 0 ProloguePart 1 Env Setup: SAP AICore & AI Launchpad [current blog]Part 2 Building a Chat Model withĀ LangChainPart 3 AgentĀ Tools: Integrating GoogleĀ SearchPart 4 RAG Basics ā : HANA Cloud VectorEngine & EmbeddingPart 5 RAG Basics ā”: Building Retriever ToolPart 6 Streamlit BasicsPart 7Ā Streamlit UI PrototypeĀ Part 8 Expose as a RESTĀ APIPart 9 Rebuild theĀ UI withĀ SAPUI5 1st HalfĀ Part 10 Rebuild theĀ UI withĀ SAPUI5 2ndĀ HalfIf you enjoyed this post, please give it aĀ kudos! Your support really motivates me. Also, if thereās anything youād like to know more about, feel free to leave a comment!Env Setup: SAP AICore & AI Launchpad1Ā | OverviewIn this chapter, weāll connect to SAP AI Launchpad using the service key created for the SAP AI Core instance. Then, weāll proceed to deploy the LLM for running a chat model.Ā 2 | PrerequisitesBTP sub-accountSAP AI Core instanceSAP AI LaunchPad SubscriptionPython 3.13 and pipVSCode, BAS or any IDEĀ 3Ā | Create a ServiceĀ KeyCreating a serviceĀ key gives your local scripts a secure, OAuthābased passport into SAPĀ AIĀ Core.Ā Without it, Python SDK calls have no way to authenticate or discover endpoints.Open your AIāÆCore instance in BTP Cockpit ā Instances &āÆSubscriptions.Go to the ServiceĀ Keys tab and click Create. Give it any name.Download the generated JSON; youāll need it later.NOTE ā Resource GroupWhen calling SAPĀ AIĀ Core from Python you must set an extra environment variable named RESOURCE_GROUP in addition to the values contained in the service key. In this tutorial weāll simply point it to the builtāin default group.Ā 4Ā | Connect AIāÆLaunchpadYou can deploy an LLM (Large Language Model) directly to SAP AI Core using the service key you created earlier. However, in this guide, we’ll use SAP AI Launchpad to make the deployment process easier.To begin, you’ll need to establish a secure connection route from SAP AI Launchpad to SAP AI Core.From Subscriptions open AIāÆLaunchpad ā GoĀ toĀ Application.Click Add (topāright) ā API Connection and upload the ServiceĀ Key JSON.Select the default Resource Group in the side panel and save.Ā 5Ā | Configure &Ā Deploy an LLMOn the “Configuration” screen of SAP Launchpad, you can select the type of foundation model to use. Think of this as creating a model profile that can be shared across multiple deployments.Letās go ahead and create the configuration. In this case, weāll use the default foundation_models scenario and configure it to use gapt-4o-mini.Navigate MLāÆOperations ā Settings and click Create.Fill in: NameĀ =Ā <anyānameāyouālike>, ScenarioĀ =Ā foundation_models, VersionĀ =Ā 0.0.1, ExecutableĀ =Ā azure-openai.On the parameter screen leave modelName = gpt-4o-mini, modelVersion = latest and click Next ā Create.Youāll land on the new Setting detail pageācheck that all fields look correct; no extra edits needed.ClickĀ CreateĀ DeploymentĀ (topāright), breeze through the wizard by clickingĀ NextĀ untilĀ Create.Wait untilĀ Status =Ā Runningāhit the Refresh icon every few seconds. Copy theĀ DeploymentĀ ID shown in the title bar for later use.By the way, there are various LLMs available to run on SAP AI Core. You can browse them in the Generative AI Hub > Model Library section.The Leaderboard also allows you to compare models based on accuracy, token cost, and other metrics.Ā 6 | NextĀ UpPart 2 Building a Chat Model withĀ LangChain / LangChain ć§ćć£ććć¢ćć«ćę§ēÆWeāll finally implement the chat model!Ā Make sure your Python development environment is readyāVS Code or a similar IDE will work perfectly!Ā DisclaimerAll the views and opinions in the blog are my own and is made in my personal capacity and that SAP shall not be responsible or liable for any of the contents published in this blog.Ā Ā Ā Read MoreĀ Technology Blog Posts by SAP articlesĀ
#SAP
#SAPTechnologyblog