šŸš€ SAPĀ AIĀ QuickLaunchĀ Series / ē§’é€Ÿć§å­¦ć¶ SAP AI Agent 開発 šŸš€ –  Part 1 Env Setup / ē’°å¢ƒę§‹ēÆ‰
Share

GenerativeĀ AI has leapt from research papers to daily business reality— and SAP is surfing that wave at full speed.Ā InĀ this hands‑on series, I’ll show you how to spin up a custom AI agent on SAPĀ AIĀ Core in minutes, then grow it into a production‑ready asset—without drowning in theory.

ē”Ÿęˆ AI ćÆē ”ē©¶å®¤ć®å¤–ćøé£›ć³å‡ŗć—ć€ä»Šć‚„ćƒ“ć‚øćƒć‚¹ē¾å “ć®åøøč­˜ć‚’å”—ć‚Šę›æćˆć¦ć„ć¾ć™ć€‚SAPćÆå…Øé€ŸåŠ›ć§ćć®ę³¢ć«ä¹—ć£ć¦ć„ć¾ć™ć€‚ć“ć®ćƒ–ćƒ­ć‚°ć‚·ćƒŖćƒ¼ć‚ŗć§ćÆć€SAPĀ AIĀ Core ć®ę—¢å®šćƒ¢ćƒ‡ćƒ«ć‚’ęœ€é€Ÿć§å‘¼ć³å‡ŗć—ć€å®Ÿå‹™ć§ä½æćˆć‚‹ AI ć‚Øćƒ¼ć‚øć‚§ćƒ³ćƒˆćøę‹”å¼µć™ć‚‹ā€œē§’é€Ÿćƒćƒ³ć‚ŗć‚Ŗćƒ³ā€ć‚’ćŠå±Šć‘ć—ć¾ć™ć€‚

Ā 

šŸ“–What You’ll Learn in This Series / ęœ¬ć‚·ćƒŖćƒ¼ć‚ŗć§å­¦ć¹ć‚‹ć“ćØ

How to spin up a custom AI agent on SAP AIĀ Core in minutes
SAPĀ AIĀ Core äøŠć§ć‚«ć‚¹ć‚æćƒ  AI ć‚Øćƒ¼ć‚øć‚§ćƒ³ćƒˆć‚’ ā€œē§’é€Ÿā€ で動かす方法

Hands‑on with LangChain, Google Search Tool, RAG, and Streamlit
LangChain惻Google ę¤œē“¢ćƒ„ćƒ¼ćƒ«ćƒ»RAG惻Streamlit ć‚’ä½æć£ćŸå®Ÿč£…

Exposing the agent as a RESTĀ API and rebuilding the UI in SAPUI5/Fiori
ć‚Øćƒ¼ć‚øć‚§ćƒ³ćƒˆć‚’ RESTĀ API åŒ–ć—ć€UI 悒 SAPUI5/Fiori ć«č¼‰ć›ę›æćˆć‚‹ę‰‹é †

Time Commitment / 学習時間
Each part is designed to be completed in 10–15Ā minutes.
各章は 10–15 分 ć§čŖ­ć‚ć‚‹ļ¼†ę‰‹ć‚’å‹•ć‹ć›ć‚‹ć‚’äŗˆå®šć—ć¦ć„ć¾ć™ć€‚

Ā 

šŸ—ŗļø Series Roadmap / é€£č¼‰ćƒ­ćƒ¼ćƒ‰ćƒžćƒƒćƒ—

Part 0 Prologue / ćƒ—ćƒ­ćƒ­ćƒ¼ć‚°Ā Part 1 Env Setup: SAP AICore & AI Launchpad / ē’°å¢ƒę§‹ēÆ‰: SAP AI CoreとAI LaunchpadĀ [current blog / ē¾åœØć®ćƒ–ćƒ­ć‚°]Part 2 Building a Chat Model withĀ LangChain / LangChain ć§ćƒćƒ£ćƒƒćƒˆćƒ¢ćƒ‡ćƒ«ć‚’ę§‹ēÆ‰Part 3 AgentĀ Tools: Integrating GoogleĀ Search / Agentćƒ„ćƒ¼ćƒ«: GoogleĀ ę¤œē“¢ć‚’ēµ±åˆPart 4 RAG Basics ā‘ : File Upload & HANA Cloud VectorEngine / RAG åŸŗē¤Ž ā‘ : ćƒ•ć‚”ć‚¤ćƒ«ć‚¢ćƒƒćƒ—ćƒ­ćƒ¼ćƒ‰ & HANA Cloud ćƒ™ć‚Æć‚æćƒ¼ć‚Øćƒ³ć‚øćƒ³Part 5 RAG Basics ā‘”: Retriever Tool / RAG åŸŗē¤Ž ā‘”: Retriever Toolの構築Part 6 Streamlit UI Prototype / Streamlit でチャットUIPart 7 Expose as a RESTĀ API / AI Agent 悒 RESTĀ API 化Part 8 Rebuild theĀ UI withĀ SAPUI5 / SAPUI5 でチャットUI ć‚’å†ę§‹ēÆ‰

Note / 注記
Subsequent blogs will be published soon.
ē¶šē·ØćÆé †ę¬”å…¬é–‹äŗˆå®šć§ć™ć€‚

Env Setup: SAP AICore & AI Launchpad
ē’°å¢ƒę§‹ēÆ‰: SAP AI Coreと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.

ęœ¬ē« ć§ćÆć€SAP AI Core ć‚¤ćƒ³ć‚¹ć‚æćƒ³ć‚¹ć«åÆ¾ć—ć¦ä½œęˆć—ćŸć‚µćƒ¼ćƒ“ć‚¹ć‚­ćƒ¼ć‚’ä½æć„ć€SAP AI Launchpad ć«ęŽ„ē¶šć—ć¾ć™ć€‚ćć®å¾Œć€ćƒćƒ£ćƒƒćƒˆē”Ø LLM ć‚’å‹•ć‹ć™ćŸć‚ć®ćƒ‡ćƒ—ćƒ­ć‚¤ćƒ”ćƒ³ćƒˆć‚’å®Ÿę–½ć—ć¾ć™ć€‚

Ā 

2 | Prerequisites / äŗ‹å‰ęŗ–å‚™

BTP sub-account / BTP ć‚µćƒ–ć‚¢ć‚«ć‚¦ćƒ³ćƒˆSAP AI Core instance / SAP AI Core ć‚¤ćƒ³ć‚¹ć‚æćƒ³ć‚¹SAP AI LaunchPad Subscription / SAP AI Launchpadć®ć‚µćƒ–ć‚¹ć‚ÆćƒŖćƒ—ć‚·ćƒ§ćƒ³Python 3.13 and pip / Python 3.13ē’°å¢ƒ & pipVSCode, BAS or any IDE / VSCode悄BASなどのIDE

Ā 

3Ā | StepĀ 1 – Create a ServiceĀ Key / 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.

ć‚µćƒ¼ćƒ“ć‚¹ć‚­ćƒ¼ćÆć€ćƒ­ćƒ¼ć‚«ćƒ«ć®ć‚¹ć‚ÆćƒŖćƒ—ćƒˆćŒ SAPĀ AIĀ Core に安全かつ OAuth ćƒ™ćƒ¼ć‚¹ć§ć‚¢ć‚Æć‚»ć‚¹ć™ć‚‹ćŸć‚ć® ā€œćƒ‘ć‚¹ćƒćƒ¼ćƒˆā€ ć§ć™ć€‚ć“ć‚ŒćŒē„”ć„ćØć€Python SDK ćÆć‚Øćƒ³ćƒ‰ćƒć‚¤ćƒ³ćƒˆć‚„čŖčØ¼ęƒ…å ±ć‚’å–å¾—ć§ćć¾ć›ć‚“ć€‚

Open your AI Core instance in BTP Cockpit → Instances & Subscriptions.
BTP Cockpit 恮 Instances & Subscriptions 恧 AI Core ć‚¤ćƒ³ć‚¹ć‚æćƒ³ć‚¹ć‚’é–‹ćć¾ć™ć€‚

Go to the ServiceĀ Keys tab and click Create. Give it any name.
ServiceĀ Keys ć‚æćƒ–ć§ Create ć‚’ć‚ÆćƒŖćƒƒć‚Æć—ć€ä»»ę„ć®åå‰ć‚’å…„åŠ›ć—ć¦ä½œęˆć—ć¾ć™ć€‚

Download the generated JSON; you’ll need it later.
ē”Ÿęˆć•ć‚ŒćŸ JSON ć‚’ćƒ€ć‚¦ćƒ³ćƒ­ćƒ¼ćƒ‰ć—ć¦äæē®”ć—ć¾ć™ć€‚

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.
Python ć‹ć‚‰å‘¼ć³å‡ŗć™éš›ć«ćÆć‚µćƒ¼ćƒ“ć‚¹ć‚­ćƒ¼ć«å«ć¾ć‚Œć¦ć„ć‚‹å¤‰ę•°ä»„å¤–ć« Resource Group ćØå‘¼ć°ć‚Œć‚‹ē’°å¢ƒå¤‰ę•°ćŒåæ…č¦ć§ć™ćŒć€ęœ¬ćƒćƒ„ćƒ¼ćƒˆćƒŖć‚¢ćƒ«ć§ćÆę—¢å®šć® defaultĀ ć‚’ęŒ‡å®šć—ć¾ć™ć€‚

Ā 

4Ā | StepĀ 2 – Connect AI Launchpad / 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.

å…ˆć»ć©ä½œęˆć—ćŸ SAP AI Core ć®ć‚µćƒ¼ćƒ“ć‚¹ć‚­ćƒ¼ć‚’ä½æćˆć°ć€SAP AI Core ć«ē›“ęŽ„ć‚¢ć‚Æć‚»ć‚¹ć—ć¦ LLMć‚’ćƒ‡ćƒ—ćƒ­ć‚¤ć™ć‚‹ć“ćØć‚‚åÆčƒ½ć§ć™ć€‚ćŸć ć—ć€ć“ć“ć§ćÆć‚ˆć‚Šē°”å˜ćŖę–¹ę³•ćØć—ć¦ć€ŒSAP AI Launchpadć€ć‚’ä½æć£ć¦ćƒ‡ćƒ—ćƒ­ć‚¤ć‚’å®Ÿę–½ć—ć¾ć™ć€‚ć¾ćšćÆć€SAP AI Launchpad 恋悉 SAP AI Core ćøå®‰å…Øć«ęŽ„ē¶šć™ć‚‹ćŸć‚ć®ēµŒč·Æć‚’ęŗ–å‚™ć—ć¾ć—ć‚‡ć†ć€‚

From Subscriptions open AI Launchpad → GoĀ toĀ Application.
Subscriptions 恋悉 AI Launchpad → GoĀ toĀ Application で起動します。

Click Add (top‑right) → API Connection and upload the ServiceĀ Key JSON.
å³äøŠć® Add → API Connection を選び、ServiceĀ Key JSON ć‚’ć‚¢ćƒƒćƒ—ćƒ­ćƒ¼ćƒ‰ć—ć¾ć™ć€‚

Select the default Resource Group in the side panel and save.
ć‚µć‚¤ćƒ‰ćƒ‘ćƒćƒ«ć§ Resource Group 恫 default ć‚’éøęŠžć—ć¦äæå­˜ć—ć¾ć™ć€‚

Ā 

5Ā | StepĀ 3 – 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.

SAP Launchpad ć®ć€ŒčØ­å®šć€ē”»é¢ć§ćÆć€ä½æē”Øć™ć‚‹åŸŗē›¤ćƒ¢ćƒ‡ćƒ«ć®ēØ®é”žćŖć©ć‚’éøć³ć¾ć™ć€‚ć“ć‚ŒćÆć€č¤‡ę•°ć®ćƒ‡ćƒ—ćƒ­ć‚¤ćƒ”ćƒ³ćƒˆć§å…±ęœ‰ć§ćć‚‹ ā€œćƒ¢ćƒ‡ćƒ«ć®ćƒ—ćƒ­ćƒ•ć‚”ć‚¤ćƒ«ā€ ć®ć‚ˆć†ćŖć‚‚ć®ćØč€ƒćˆć‚‹ćØē†č§£ć—ć‚„ć™ć„ć§ć—ć‚‡ć†ć€‚

ćć‚Œć§ćÆčØ­å®šć‚’ä½œęˆć—ć¦ćæć¾ć—ć‚‡ć†ć€‚ä»Šå›žćÆć€ćƒ‡ćƒ•ć‚©ćƒ«ćƒˆć§ęä¾›ć•ć‚Œć¦ć„ć‚‹ foundation_models ćØć„ć†ć‚·ćƒŠćƒŖć‚Ŗć‚’éøęŠžć—ć€gapt-4o-mini ć‚’ęŒ‡å®šć—ć¾ć™ć€‚

Navigate ML Operations → Settings and click Create.
å·¦ćƒ”ćƒ‹ćƒ„ćƒ¼ ML 運用 → 設定 恧 作成 ć‚’ć‚ÆćƒŖćƒƒć‚Æć—ć¾ć™ć€‚

Fill in: NameĀ =Ā <any‑name‑you‑like>, ScenarioĀ =Ā foundation_models, VersionĀ =Ā 0.0.1, ExecutableĀ =Ā azure-openai.
čØ­å®šå <ご自由に>, ć‚·ćƒŠćƒŖć‚Ŗ foundation_models, ćƒćƒ¼ć‚øćƒ§ćƒ³ 0.0.1, å®Ÿč”ŒåÆčƒ½ azure-openai ć‚’å…„åŠ›ć—ć¾ć™ć€‚

On the parameter screen leave modelName = gpt-4o-mini, modelVersion = latest and click Next → Create.
ćƒ‘ćƒ©ćƒ”ćƒ¼ć‚æē”»é¢ć§ćÆ modelName = gpt-4o-mini, modelVersion = latest ć‚’ćć®ć¾ć¾ć« 欔へ → ä½œęˆć€‚

You’ll land on the new Setting detail page—check that all fields look correct; no extra edits needed.
ä½œęˆå¾Œć«čØ­å®šč©³ē“°ć®ē”»é¢ćøé·ē§»ć—ć¾ć™ć€‚å…„åŠ›å†…å®¹ć«čŖ¤ć‚ŠćŒćŖć„ć‹ć–ć£ćØē¢ŗčŖć—ć¾ć—ć‚‡ć†ļ¼ˆåŸŗęœ¬ēš„ć«ćć®ć¾ć¾ć§ OK です)。

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.
ć‚¹ćƒ†ćƒ¼ć‚æć‚¹ćŒĀ ć€Œå®Ÿč”Œäø­ć€Ā ć«ćŖć‚‹ć¾ć§ć€ę›“ę–°ćƒœć‚æćƒ³ć§ę•°ē§’ćŠćć«ćƒŖćƒ•ćƒ¬ćƒƒć‚·ćƒ„ć—ć¾ć™ć€‚ć‚æć‚¤ćƒˆćƒ«ćƒćƒ¼ć«č”Øē¤ŗć•ć‚Œć‚‹Ā DeploymentĀ IDĀ ć‚’ęŽ§ćˆć¦ćŠćć¾ć—ć‚‡ć†ć€‚

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.

ごなみに、SAP AI Core äøŠć§åˆ©ē”ØåÆčƒ½ćŖ LLM ćÆć•ć¾ć–ć¾ć§ć™ć€‚ć€Œē”Ÿęˆ AI 惏惖 > ćƒ¢ćƒ‡ćƒ«ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć€ē”»é¢ć‚’é–‹ććØć€ćć‚Œć‚‰ć®äø€č¦§ćŒē¢ŗčŖć§ćć¾ć™ć€‚

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!

Part 2ć§ćÆć€ć„ć‚ˆć„ć‚ˆćƒćƒ£ćƒƒćƒˆćƒ¢ćƒ‡ćƒ«ć®å®Ÿč£…ć«å…„ć‚Šć¾ć™ļ¼VS Code などを使って Python ć®é–‹ē™ŗē’°å¢ƒć‚’ęŗ–å‚™ć—ć¦ćŠćć¾ć—ć‚‡ć†ļ¼

Ā 

Disclaimer / å…č²¬äŗ‹é …

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.
å…č²¬äŗ‹é … – ęœ¬ćƒ–ćƒ­ć‚°ć«čØ˜č¼‰ć•ć‚ŒćŸč¦‹č§£ćŠć‚ˆć³ę„č¦‹ćÆć™ć¹ć¦ē§å€‹äŗŗć®ć‚‚ć®ć§ć‚ć‚Šć€ē§ć®å€‹äŗŗēš„ćŖē«‹å “ć§ē™ŗäæ”ć—ć¦ć„ć¾ć™ć€‚SAP ćÆęœ¬ćƒ–ćƒ­ć‚°ć®å†…å®¹ć«ć¤ć„ć¦äø€åˆ‡ć®č²¬ä»»ć‚’č² ć„ć¾ć›ć‚“ć€‚

Ā 

Ā GenerativeĀ AI has leapt from research papers to daily business reality— and SAP is surfing that wave at full speed.Ā InĀ this hands‑on series, I’ll show you how to spin up a custom AI agent on SAPĀ AIĀ Core in minutes, then grow it into a production‑ready asset—without drowning in theory.ē”Ÿęˆ AI ćÆē ”ē©¶å®¤ć®å¤–ćøé£›ć³å‡ŗć—ć€ä»Šć‚„ćƒ“ć‚øćƒć‚¹ē¾å “ć®åøøč­˜ć‚’å”—ć‚Šę›æćˆć¦ć„ć¾ć™ć€‚SAPćÆå…Øé€ŸåŠ›ć§ćć®ę³¢ć«ä¹—ć£ć¦ć„ć¾ć™ć€‚ć“ć®ćƒ–ćƒ­ć‚°ć‚·ćƒŖćƒ¼ć‚ŗć§ćÆć€SAPĀ AIĀ Core ć®ę—¢å®šćƒ¢ćƒ‡ćƒ«ć‚’ęœ€é€Ÿć§å‘¼ć³å‡ŗć—ć€å®Ÿå‹™ć§ä½æćˆć‚‹ AI ć‚Øćƒ¼ć‚øć‚§ćƒ³ćƒˆćøę‹”å¼µć™ć‚‹ā€œē§’é€Ÿćƒćƒ³ć‚ŗć‚Ŗćƒ³ā€ć‚’ćŠå±Šć‘ć—ć¾ć™ć€‚Ā šŸ“–What You’ll Learn in This Series / ęœ¬ć‚·ćƒŖćƒ¼ć‚ŗć§å­¦ć¹ć‚‹ć“ćØHow to spin up a custom AI agent on SAP AIĀ Core in minutesSAPĀ AIĀ Core äøŠć§ć‚«ć‚¹ć‚æćƒ  AI ć‚Øćƒ¼ć‚øć‚§ćƒ³ćƒˆć‚’ ā€œē§’é€Ÿā€ で動かす方法Hands‑on with LangChain, Google Search Tool, RAG, and StreamlitLangChain惻Google ę¤œē“¢ćƒ„ćƒ¼ćƒ«ćƒ»RAG惻Streamlit ć‚’ä½æć£ćŸå®Ÿč£…Exposing the agent as a RESTĀ API and rebuilding the UI in SAPUI5/Fiorić‚Øćƒ¼ć‚øć‚§ćƒ³ćƒˆć‚’ RESTĀ API åŒ–ć—ć€UI 悒 SAPUI5/Fiori ć«č¼‰ć›ę›æćˆć‚‹ę‰‹é †Time Commitment / 学習時間Each part is designed to be completed in 10–15Ā minutes.各章は 10–15 分 ć§čŖ­ć‚ć‚‹ļ¼†ę‰‹ć‚’å‹•ć‹ć›ć‚‹ć‚’äŗˆå®šć—ć¦ć„ć¾ć™ć€‚Ā šŸ—ŗļø Series Roadmap / é€£č¼‰ćƒ­ćƒ¼ćƒ‰ćƒžćƒƒćƒ—Part 0 Prologue / ćƒ—ćƒ­ćƒ­ćƒ¼ć‚°Ā Part 1 Env Setup: SAP AICore & AI Launchpad / ē’°å¢ƒę§‹ēÆ‰: SAP AI CoreとAI LaunchpadĀ [current blog / ē¾åœØć®ćƒ–ćƒ­ć‚°]Part 2 Building a Chat Model withĀ LangChain / LangChain ć§ćƒćƒ£ćƒƒćƒˆćƒ¢ćƒ‡ćƒ«ć‚’ę§‹ēÆ‰Part 3 AgentĀ Tools: Integrating GoogleĀ Search / Agentćƒ„ćƒ¼ćƒ«: GoogleĀ ę¤œē“¢ć‚’ēµ±åˆPart 4 RAG Basics ā‘ : File Upload & HANA Cloud VectorEngine / RAG åŸŗē¤Ž ā‘ : ćƒ•ć‚”ć‚¤ćƒ«ć‚¢ćƒƒćƒ—ćƒ­ćƒ¼ćƒ‰ & HANA Cloud ćƒ™ć‚Æć‚æćƒ¼ć‚Øćƒ³ć‚øćƒ³Part 5 RAG Basics ā‘”: Retriever Tool / RAG åŸŗē¤Ž ā‘”: Retriever Toolの構築Part 6 Streamlit UI Prototype / Streamlit でチャットUIPart 7 Expose as a RESTĀ API / AI Agent 悒 RESTĀ API 化Part 8 Rebuild theĀ UI withĀ SAPUI5 / SAPUI5 でチャットUI ć‚’å†ę§‹ēÆ‰Note / 注記Subsequent blogs will be published soon.ē¶šē·ØćÆé †ę¬”å…¬é–‹äŗˆå®šć§ć™ć€‚Env Setup: SAP AICore & AI Launchpadē’°å¢ƒę§‹ēÆ‰: SAP AI CoreとAI Launchpad1Ā | 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.ęœ¬ē« ć§ćÆć€SAP AI Core ć‚¤ćƒ³ć‚¹ć‚æćƒ³ć‚¹ć«åÆ¾ć—ć¦ä½œęˆć—ćŸć‚µćƒ¼ćƒ“ć‚¹ć‚­ćƒ¼ć‚’ä½æć„ć€SAP AI Launchpad ć«ęŽ„ē¶šć—ć¾ć™ć€‚ćć®å¾Œć€ćƒćƒ£ćƒƒćƒˆē”Ø LLM ć‚’å‹•ć‹ć™ćŸć‚ć®ćƒ‡ćƒ—ćƒ­ć‚¤ćƒ”ćƒ³ćƒˆć‚’å®Ÿę–½ć—ć¾ć™ć€‚Ā 2 | Prerequisites / äŗ‹å‰ęŗ–å‚™BTP sub-account / BTP ć‚µćƒ–ć‚¢ć‚«ć‚¦ćƒ³ćƒˆSAP AI Core instance / SAP AI Core ć‚¤ćƒ³ć‚¹ć‚æćƒ³ć‚¹SAP AI LaunchPad Subscription / SAP AI Launchpadć®ć‚µćƒ–ć‚¹ć‚ÆćƒŖćƒ—ć‚·ćƒ§ćƒ³Python 3.13 and pip / Python 3.13ē’°å¢ƒ & pipVSCode, BAS or any IDE / VSCode悄BASなどのIDEĀ 3Ā | StepĀ 1 – Create a ServiceĀ Key / 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.ć‚µćƒ¼ćƒ“ć‚¹ć‚­ćƒ¼ćÆć€ćƒ­ćƒ¼ć‚«ćƒ«ć®ć‚¹ć‚ÆćƒŖćƒ—ćƒˆćŒ SAPĀ AIĀ Core に安全かつ OAuth ćƒ™ćƒ¼ć‚¹ć§ć‚¢ć‚Æć‚»ć‚¹ć™ć‚‹ćŸć‚ć® ā€œćƒ‘ć‚¹ćƒćƒ¼ćƒˆā€ ć§ć™ć€‚ć“ć‚ŒćŒē„”ć„ćØć€Python SDK ćÆć‚Øćƒ³ćƒ‰ćƒć‚¤ćƒ³ćƒˆć‚„čŖčØ¼ęƒ…å ±ć‚’å–å¾—ć§ćć¾ć›ć‚“ć€‚Open your AI Core instance in BTP Cockpit → Instances & Subscriptions.BTP Cockpit 恮 Instances & Subscriptions 恧 AI Core ć‚¤ćƒ³ć‚¹ć‚æćƒ³ć‚¹ć‚’é–‹ćć¾ć™ć€‚Go to the ServiceĀ Keys tab and click Create. Give it any name.ServiceĀ Keys ć‚æćƒ–ć§ Create ć‚’ć‚ÆćƒŖćƒƒć‚Æć—ć€ä»»ę„ć®åå‰ć‚’å…„åŠ›ć—ć¦ä½œęˆć—ć¾ć™ć€‚Download the generated JSON; you’ll need it later.ē”Ÿęˆć•ć‚ŒćŸ JSON ć‚’ćƒ€ć‚¦ćƒ³ćƒ­ćƒ¼ćƒ‰ć—ć¦äæē®”ć—ć¾ć™ć€‚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.Python ć‹ć‚‰å‘¼ć³å‡ŗć™éš›ć«ćÆć‚µćƒ¼ćƒ“ć‚¹ć‚­ćƒ¼ć«å«ć¾ć‚Œć¦ć„ć‚‹å¤‰ę•°ä»„å¤–ć« Resource Group ćØå‘¼ć°ć‚Œć‚‹ē’°å¢ƒå¤‰ę•°ćŒåæ…č¦ć§ć™ćŒć€ęœ¬ćƒćƒ„ćƒ¼ćƒˆćƒŖć‚¢ćƒ«ć§ćÆę—¢å®šć® defaultĀ ć‚’ęŒ‡å®šć—ć¾ć™ć€‚Ā 4Ā | StepĀ 2 – Connect AI Launchpad / 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.å…ˆć»ć©ä½œęˆć—ćŸ SAP AI Core ć®ć‚µćƒ¼ćƒ“ć‚¹ć‚­ćƒ¼ć‚’ä½æćˆć°ć€SAP AI Core ć«ē›“ęŽ„ć‚¢ć‚Æć‚»ć‚¹ć—ć¦ LLMć‚’ćƒ‡ćƒ—ćƒ­ć‚¤ć™ć‚‹ć“ćØć‚‚åÆčƒ½ć§ć™ć€‚ćŸć ć—ć€ć“ć“ć§ćÆć‚ˆć‚Šē°”å˜ćŖę–¹ę³•ćØć—ć¦ć€ŒSAP AI Launchpadć€ć‚’ä½æć£ć¦ćƒ‡ćƒ—ćƒ­ć‚¤ć‚’å®Ÿę–½ć—ć¾ć™ć€‚ć¾ćšćÆć€SAP AI Launchpad 恋悉 SAP AI Core ćøå®‰å…Øć«ęŽ„ē¶šć™ć‚‹ćŸć‚ć®ēµŒč·Æć‚’ęŗ–å‚™ć—ć¾ć—ć‚‡ć†ć€‚From Subscriptions open AI Launchpad → GoĀ toĀ Application.Subscriptions 恋悉 AI Launchpad → GoĀ toĀ Application で起動します。Click Add (top‑right) → API Connection and upload the ServiceĀ Key JSON.å³äøŠć® Add → API Connection を選び、ServiceĀ Key JSON ć‚’ć‚¢ćƒƒćƒ—ćƒ­ćƒ¼ćƒ‰ć—ć¾ć™ć€‚Select the default Resource Group in the side panel and save.ć‚µć‚¤ćƒ‰ćƒ‘ćƒćƒ«ć§ Resource Group 恫 default ć‚’éøęŠžć—ć¦äæå­˜ć—ć¾ć™ć€‚Ā 5Ā | StepĀ 3 – 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.SAP Launchpad ć®ć€ŒčØ­å®šć€ē”»é¢ć§ćÆć€ä½æē”Øć™ć‚‹åŸŗē›¤ćƒ¢ćƒ‡ćƒ«ć®ēØ®é”žćŖć©ć‚’éøć³ć¾ć™ć€‚ć“ć‚ŒćÆć€č¤‡ę•°ć®ćƒ‡ćƒ—ćƒ­ć‚¤ćƒ”ćƒ³ćƒˆć§å…±ęœ‰ć§ćć‚‹ ā€œćƒ¢ćƒ‡ćƒ«ć®ćƒ—ćƒ­ćƒ•ć‚”ć‚¤ćƒ«ā€ ć®ć‚ˆć†ćŖć‚‚ć®ćØč€ƒćˆć‚‹ćØē†č§£ć—ć‚„ć™ć„ć§ć—ć‚‡ć†ć€‚ćć‚Œć§ćÆčØ­å®šć‚’ä½œęˆć—ć¦ćæć¾ć—ć‚‡ć†ć€‚ä»Šå›žćÆć€ćƒ‡ćƒ•ć‚©ćƒ«ćƒˆć§ęä¾›ć•ć‚Œć¦ć„ć‚‹ foundation_models ćØć„ć†ć‚·ćƒŠćƒŖć‚Ŗć‚’éøęŠžć—ć€gapt-4o-mini ć‚’ęŒ‡å®šć—ć¾ć™ć€‚Navigate ML Operations → Settings and click Create.å·¦ćƒ”ćƒ‹ćƒ„ćƒ¼ ML 運用 → 設定 恧 作成 ć‚’ć‚ÆćƒŖćƒƒć‚Æć—ć¾ć™ć€‚Fill in: NameĀ =Ā <any‑name‑you‑like>, ScenarioĀ =Ā foundation_models, VersionĀ =Ā 0.0.1, ExecutableĀ =Ā azure-openai.čØ­å®šå <ご自由に>, ć‚·ćƒŠćƒŖć‚Ŗ foundation_models, ćƒćƒ¼ć‚øćƒ§ćƒ³ 0.0.1, å®Ÿč”ŒåÆčƒ½ azure-openai ć‚’å…„åŠ›ć—ć¾ć™ć€‚On the parameter screen leave modelName = gpt-4o-mini, modelVersion = latest and click Next → Create.ćƒ‘ćƒ©ćƒ”ćƒ¼ć‚æē”»é¢ć§ćÆ modelName = gpt-4o-mini, modelVersion = latest ć‚’ćć®ć¾ć¾ć« 欔へ → ä½œęˆć€‚You’ll land on the new Setting detail page—check that all fields look correct; no extra edits needed.ä½œęˆå¾Œć«čØ­å®šč©³ē“°ć®ē”»é¢ćøé·ē§»ć—ć¾ć™ć€‚å…„åŠ›å†…å®¹ć«čŖ¤ć‚ŠćŒćŖć„ć‹ć–ć£ćØē¢ŗčŖć—ć¾ć—ć‚‡ć†ļ¼ˆåŸŗęœ¬ēš„ć«ćć®ć¾ć¾ć§ OK です)。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.ć‚¹ćƒ†ćƒ¼ć‚æć‚¹ćŒĀ ć€Œå®Ÿč”Œäø­ć€Ā ć«ćŖć‚‹ć¾ć§ć€ę›“ę–°ćƒœć‚æćƒ³ć§ę•°ē§’ćŠćć«ćƒŖćƒ•ćƒ¬ćƒƒć‚·ćƒ„ć—ć¾ć™ć€‚ć‚æć‚¤ćƒˆćƒ«ćƒćƒ¼ć«č”Øē¤ŗć•ć‚Œć‚‹Ā DeploymentĀ IDĀ ć‚’ęŽ§ćˆć¦ćŠćć¾ć—ć‚‡ć†ć€‚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.ごなみに、SAP AI Core äøŠć§åˆ©ē”ØåÆčƒ½ćŖ LLM ćÆć•ć¾ć–ć¾ć§ć™ć€‚ć€Œē”Ÿęˆ AI 惏惖 > ćƒ¢ćƒ‡ćƒ«ćƒ©ć‚¤ćƒ–ćƒ©ćƒŖć€ē”»é¢ć‚’é–‹ććØć€ćć‚Œć‚‰ć®äø€č¦§ćŒē¢ŗčŖć§ćć¾ć™ć€‚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!Part 2ć§ćÆć€ć„ć‚ˆć„ć‚ˆćƒćƒ£ćƒƒćƒˆćƒ¢ćƒ‡ćƒ«ć®å®Ÿč£…ć«å…„ć‚Šć¾ć™ļ¼VS Code などを使って Python ć®é–‹ē™ŗē’°å¢ƒć‚’ęŗ–å‚™ć—ć¦ćŠćć¾ć—ć‚‡ć†ļ¼Ā Disclaimer / å…č²¬äŗ‹é …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.å…č²¬äŗ‹é … – ęœ¬ćƒ–ćƒ­ć‚°ć«čØ˜č¼‰ć•ć‚ŒćŸč¦‹č§£ćŠć‚ˆć³ę„č¦‹ćÆć™ć¹ć¦ē§å€‹äŗŗć®ć‚‚ć®ć§ć‚ć‚Šć€ē§ć®å€‹äŗŗēš„ćŖē«‹å “ć§ē™ŗäæ”ć—ć¦ć„ć¾ć™ć€‚SAP ćÆęœ¬ćƒ–ćƒ­ć‚°ć®å†…å®¹ć«ć¤ć„ć¦äø€åˆ‡ć®č²¬ä»»ć‚’č² ć„ć¾ć›ć‚“ć€‚Ā Read MoreĀ Technology Blogs by SAP articlesĀ 

#SAPCHANNEL

By