{"id":20484510,"url":"https://github.com/sap-samples/btp-genai-starter-kit","last_synced_at":"2025-04-05T20:03:25.633Z","repository":{"id":233784374,"uuid":"781900353","full_name":"SAP-samples/btp-genai-starter-kit","owner":"SAP-samples","description":"This repo aims to help developers to get into the genAI topic quicker by automating AI Core and HANA Vector Engine provisioning and configuration with Terraform Provider for SAP BTP.","archived":false,"fork":false,"pushed_at":"2025-03-11T06:05:26.000Z","size":3073,"stargazers_count":81,"open_issues_count":5,"forks_count":33,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-03-29T19:01:19.289Z","etag":null,"topics":["ai-core","genai","hana-cloud","langchain","rag","terraform","vector-engine"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SAP-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-04T08:59:00.000Z","updated_at":"2025-03-14T09:22:28.000Z","dependencies_parsed_at":"2024-06-24T08:30:01.463Z","dependency_job_id":"d2e161a2-2191-45c0-9e22-58dca1ea393e","html_url":"https://github.com/SAP-samples/btp-genai-starter-kit","commit_stats":null,"previous_names":["sap-samples/btp-genai-starter-kit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fbtp-genai-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fbtp-genai-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fbtp-genai-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fbtp-genai-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SAP-samples","download_url":"https://codeload.github.com/SAP-samples/btp-genai-starter-kit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393552,"owners_count":20931811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-core","genai","hana-cloud","langchain","rag","terraform","vector-engine"],"created_at":"2024-11-15T16:23:25.831Z","updated_at":"2025-04-05T20:03:25.596Z","avatar_url":"https://github.com/SAP-samples.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SAP BTP genAI starter kit\n\n[![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/btp-genai-starter-kit)](https://api.reuse.software/info/github.com/SAP-samples/btp-genai-starter-kit)\n\n## Description\n\nThis repo wants to give users of the SAP Business Technology Platform (BTP) a quick way to learn how to use generative AI with BTP services.\n\n\u003cimg src=\"pictures/overview.png\" alt=\"Architectural overview\" width=\"600\"/\u003e\n\n\n## Requirements\n\n- You have access to an SAP BTP global account or an existing SAP BTP sub account.\n- `Visual Studio Code` is installed on your machine with the `Dev Container` extension. You understand purpose and basic concepts of [Dev Containers in VS Code](https://code.visualstudio.com/docs/devcontainers/containers).\n- As prerequisite for using dev containers, `Docker` is installed on your machine and you understand its basics concepts.\n- `Git` is available on your machine (test with `git --version`) and you know how to clone a project from github.\n- The SAP BTP global account needs to be sufficiently entitled to use the following services and applications:\n\n  | Name | Service/ Application | Plan |\n  | --- | --- | --- |\n  | **AI Core** | `aicore` (service)| `extended` |\n  | **AI Launchpad** (optional) | `ai-launchpad` (app subscription) | `standard` |\n  | **HANA Cloud** | `hana-cloud` (service) | `hana` |\n  | **HANA Cloud Tools** | `hana-cloud-tools` (app subscription) | `tools` |\n\n## Download and Installation\n\n### Step 1: Setup SAP BTP infrastructure\n\n- Clone this GitHub repository to your local machine and open it in VS Code.\n- Open the Dev Container on your machine from within VS Code (`Reopen in Dev Container`).\n- Wait for the dev container to be built and the project to be loaded within it.\n  \u003eBe aware that opening the dev container can take a while!\n- In the folder [`config/secrets`](config/secrets) rename the file `btp_ai_setup.tfvars` to `my_btp_ai_setup.tfvars`.\n    - adapt the value for `globalaccount` for the subaccount to be created within. You find in the global account landing page (\"Subdomain: .....\").\n    - if you would like to use custom IDP, provide the value for `idp` e.g. `\u003cyour-ias-tenant\u003e.accounts.ondemand.com`.\n    - add your email address to the variable `admins`. This should be looking similar to this: `admins  = [\"your.email@sap.com\"]`.\n    - save the file.\n- In the folder [`config/secrets`](config/secrets) rename the file `btp_credentials.tfvars` to `my_btp_credentials.tfvars`.\n    - adapt the value for the variable `BTP_USERNAME` to your email address.\n    - save the file.\n- Within VS Code open a terminal session.\n- In the terminal simply type `./run.sh` and enter your `BTP_PASSWORD` as well as the password for the `HANA DB` (you will be prompted accordingly).\n  \u003e Make sure that the password for the HANA DB matches the minimum requirements (length \u003e= 8, 1+ upper case chars, 2+ lower case chars, 1+ digit)!\n\n\u003e In case you want to authenticate via Single-Sign-On (SSO) you should set the enironment variable `BTP_ENABLE_SSO` to `true`. You do this by running the following command within your dev container:\n`export BTP_ENABLE_SSO=true`\n\n\nThe starter script will now setup the following things for you in your SAP BTP global account:\n\n- It creates a subaccount with the name configured in the `my_btp_ai_setup.tfvars` file (folder `config/secrets`).\n- It creates service instances/subscriptions for the following services\n    - SAP AI Core (service)\n    - SAP HANA Cloud (service) with integrated vector engine\n    - SAP HANA Cloud tools (app subscription)\n- It creates a file called `.env` that will be copied into the [`config/secrets`](config/secrets) folder.\n\n\n### Step 2: Deploy AI Models for your genAI experiments in AI Core\n\n\u003eThe second step will automatically be taken care of by the running `./run.sh` command from step 1.\n\u003cbr\u003eAfter the successful setup of the BTP subaccount, it calls the python script `poetry run python main.py` in the folder [`scripts`](scripts).\n\nThat python script does the following:\n\n- It loads the content of the newly created `.env` file from step 1 into the environment variables of the session.\n- It calls the AI Core APIs to give you access to the models you have defined in the file [config/secrets/my_btp_ai_setup.tfvars](config/secrets/my_btp_ai_setup.tfvars) (through the variable `target_ai_core_model`).\n\n### Step 3: Run GenAI examples\n\n\u003e After the steps above, you are all set for your first genAI experiments on SAP BTP.\n\nYou can proceed by switching to the folder [`scripts/step03_explore_examples`](scripts/step03_explore_examples).\n\nHere you will find [some examples](scripts/step03_explore_examples/README.md) with respective instructions and sample code.\n\n## Known Issues\n\n\u003e ❗There is an existing issue that makes AI Core API token invalid for about 1-2 hours after it was created. We implemented a retry mechanism, nevertheless, until the issue is resolved, running the `./run.sh` might result in the following error.\nAs a temporary workaround, just re-run the `./run.sh` in 1-2 hours.\n![issue](./pictures/Issue.jpg)\n\n## How to obtain support\n[Create an issue](https://github.com/SAP-samples/\u003crepository-name\u003e/issues) in this repository if you find a bug or have questions about the content.\n\nFor additional support, [ask a question in SAP Community](https://answers.sap.com/questions/ask.html).\n\n## Contributing\nIf you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).\n\n## License\nCopyright (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](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsap-samples%2Fbtp-genai-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsap-samples%2Fbtp-genai-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsap-samples%2Fbtp-genai-starter-kit/lists"}