SAP-samples/generative-ai-codejam
A CodeJam that deploys and queries a large language model on SAP AI CoreSAP AI CoreSAP's AI service on BTP: the runtime for AI assets, and through the Generative AI Hub inside it the access to foundation models, the orchestration service with its templating, masking, filtering and grounding modules, the Prompt Registry and Document Grounding.sap official, btp's Generative AI Hub, then builds a retrieval-augmented chatbot on top of it.
Exercises deploy an LLM on SAP AI CoreSAP AI CoreSAP's AI service on BTP: the runtime for AI assets, and through the Generative AI Hub inside it the access to foundation models, the orchestration service with its templating, masking, filtering and grounding modules, the Prompt Registry and Document Grounding.sap official, btp and query it through SAP AI LaunchpadSAP AI LaunchpadThe SaaS front end over SAP AI Core on BTP: a Model Library, Grounding Management for document pipelines, Workspaces that connect AI runtimes, and ML Operations for the lifecycle of a scenario.sap official, btp, the orchestration service and the Python SDK, then create embeddings for document chunks, store them, and use them to implement the retrieval augmented generation case the CodeJam is built around. Later exercises work through the orchestration service and its grounding, a chatbot with memory, and a chatbot the participant writes. The last item, numbered 12, is marked optional and links out to a community blog post on AI agents instead of being an exercise in the repository.
Facts
Where it sits
Who is behind it
In the atlas: maintains 222@SAP-samplesmaintainerAjinkya PatilContributes to this
In the atlas: contributes to 112@ajinkyapatil8190Antonio MaradiagaContributes to this
Developer Advocate
In the atlas: contributes to 10@ajmaradiagaKevin RiedelsheimerContributes to this
In the atlas: contributes to 11@KevinRiedelsheimerShrinivasan NeelamegamContributes to this
In the atlas: contributes to 4@neelamegamsNora von ThenenContributes to this
In the atlas: contributes to 3@noravthVitaliy RudnytskiyContributes to this
In the atlas: contributes to 6, wrote 1@Sygyzmundovych6 contributors
What it declares
Every artifact
- Type
- Sample
- Origin
- By SAP
- Use as
- A reference
As a sample
- Form
- Workshop or CodeJam material
Connections
Calling a language model with tenant and credential handling solved
Grounding a model's answer in data retrieved at question time
AI runtime on BTP with the Generative AI Hub
SaaS front end over SAP AI Core
Download
README
quoted from SAP-samples/generative-ai-codejam under Apache-2.0, readCodeJam - Getting started with Generative AI Hub on SAP AI Core
Description
This repository contains the material for the "Getting started with the Generative AI Hub on SAP AI Core" CodeJam, brought to you by the Developer Advocates at SAP.
Overview
In this CodeJam you will learn how to use Generative AI Hub on SAP AI Core to implement a retrieval augmented generation (RAG) use case to improve the responses of large language models (LLMs) and reduce hallucinations. You will learn how to deploy an LLM on SAP AI Core and query it via SAP AI Launchpad, the orchestration service and the Python SDK. Furthermore, you will learn about the most important genAI concepts and create and use text chunks and embeddings to improve your RAG response.
Requirements
The requirements necessary to complete the exercises in this repository, including hardware and software specifications, are outlined in the prerequisites file.
Exercises
You can find all exercises in the exercises folder. We will work through the exercises in the order shown here. From a session flow perspective, we are taking the "coordinated" approach:
The instructor will start you on the first exercise, and that's the only one you should do. You should only proceed to the next exercise once the instructor tells you to.
- Connect SAP AI Core and SAP AI Launchpad
- Explore the Prompt Editor in SAP AI Launchpad
- Setup your Python environment
- Prompt an LLM
- Create embeddings for your document chunks
- Store embeddings
- Implement the RAG use case
- Orchestration service S3 grounding (UI)
- Orchestration service
- Orchestration service - grounding
- Chatbot with Memory
- Your Chatbot
- OPTIONAL: AI Agents
Feedback
If you can spare a couple of minutes at the end of the session, please provide feedback to help us improve next time.
Use this Give feedback link to create a special "feedback" issue, and follow the instructions in there.
Thank you!
Other CodeJams
CodeJam repositories
- Service integration with SAP Cloud Application Programming Model
- CodeJam - Getting Started with Machine Learning using SAP HANA and Python
- Hands-on with the btp CLI and APIs
- CodeJam - Combine SAP Cloud Application Programming Model with SAP HANA Cloud to Create Full-Stack Applications
- All CodeJams in one list
CodeJam Community
Acknowledgements
The exercise content in this repository is based on different sample repositories created by the SAP AI Core team.
The exercises related to the prerequisites and setting up BAS were copied and adjusted from my colleague Vitaliy's CodeJam - Getting Started with Machine Learning using SAP HANA and Python.
How to obtain support
Create an issue in this repository if you find a bug or have questions about the content.
For additional support, ask a question in SAP Community.
License
Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-samples-generative-ai-codejam- JSON
- /artifacts/sap-samples-generative-ai-codejam.json
- MCP
- Connecting an agent