Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
4a387d5
OpenSearch - ObjectStorage V1
MarcGueury Sep 29, 2022
325181f
Opensearch v2
MarcGueury Sep 29, 2022
d494e0b
Merge branch 'oracle-livelabs:main' into main
MarcGueury Sep 29, 2022
ff3dd95
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Sep 29, 2022
c57981c
v3
MarcGueury Sep 29, 2022
8c7431f
V3
MarcGueury Sep 29, 2022
84c5ec1
Image Alternative Texts
MarcGueury Sep 29, 2022
df09c1f
Merge branch 'oracle-livelabs:main' into main
MarcGueury Sep 29, 2022
1b1c93a
V2
MarcGueury Sep 30, 2022
accd69f
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Sep 30, 2022
04f854c
V2
MarcGueury Sep 30, 2022
38c6475
v4
MarcGueury Sep 30, 2022
02a8514
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Sep 30, 2022
75572fd
V4
MarcGueury Sep 30, 2022
522abd9
Update manifest.json
MarcGueury Sep 30, 2022
cf76f53
Merge branch 'oracle-livelabs:main' into main
MarcGueury Sep 30, 2022
f8e5bc2
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Oct 4, 2022
d397c46
Merge branch 'oracle-livelabs:main' into main
MarcGueury Oct 4, 2022
4567154
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Oct 4, 2022
f311e0e
Merge branch 'oracle-livelabs:main' into main
MarcGueury Oct 27, 2022
36c9589
additional step
MarcGueury Oct 27, 2022
0dd0120
various fixes
MarcGueury Oct 27, 2022
96681e8
various fixes
MarcGueury Oct 27, 2022
401407b
OCI Starter
MarcGueury Dec 5, 2022
bc20ef0
OpenSearch New version screen user/password
MarcGueury Feb 24, 2023
49fb7ed
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Feb 24, 2023
8898ca5
Update visual_builder.md
MarcGueury Feb 24, 2023
eef80c5
2023-03-18
MarcGueury Mar 18, 2023
7e62b90
2023-03-18
MarcGueury Mar 18, 2023
77c3002
2023-03-18
MarcGueury Mar 18, 2023
275050d
2023-03-21
MarcGueury Mar 21, 2023
8e98df5
APIM
MarcGueury Mar 21, 2023
e9e9e3e
APIM
MarcGueury Mar 21, 2023
e51dcd1
Update test.md
MarcGueury Mar 21, 2023
39fdde8
Update test.md
MarcGueury Mar 21, 2023
e77a132
APIM
MarcGueury Mar 22, 2023
8388521
APIM
MarcGueury Mar 22, 2023
d9360ae
Update test.md
MarcGueury Mar 22, 2023
289247b
APIM
MarcGueury Mar 23, 2023
ce98916
APIM
MarcGueury Mar 23, 2023
b1e5c54
APIM
MarcGueury Mar 23, 2023
cb73490
APIM
MarcGueury Mar 27, 2023
57054ac
APIM
MarcGueury Mar 27, 2023
efa345c
APIM
MarcGueury Mar 27, 2023
b504462
APIM
MarcGueury Apr 3, 2023
c32d23c
APIM
MarcGueury Apr 3, 2023
f6db294
Merge branch 'main' into main
MarcGueury Apr 5, 2023
4bbdc44
APIM
MarcGueury Apr 6, 2023
9c05823
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Apr 6, 2023
c47179c
Merge branch 'main' into main
MarcGueury Apr 7, 2023
84e6637
Formatting
MarcGueury Apr 15, 2023
c65853c
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Apr 15, 2023
042faef
Formatting
MarcGueury Apr 15, 2023
946f29b
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Apr 15, 2023
d03a782
Numbering
MarcGueury Apr 18, 2023
8d541cb
Update intro.md
MarcGueury Apr 18, 2023
3004b0d
Merge branch 'main' into main
MarcGueury Apr 18, 2023
c6ec8ff
Lab 2 Task 2 indentation
MarcGueury Apr 20, 2023
2181aeb
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Apr 20, 2023
1a8fa62
-
MarcGueury Apr 28, 2023
d9d934a
2023-06-05
MarcGueury Jun 5, 2023
ba317c3
2023-06-05
MarcGueury Jun 5, 2023
742037e
2023-06-05
MarcGueury Jun 5, 2023
315658b
2023-06-05
MarcGueury Jun 5, 2023
476a0f0
2023-06-05
MarcGueury Jun 5, 2023
cacd3e9
Merge branch 'main' into main
kaylien Jun 5, 2023
ea74f6f
Merge branch 'oracle-livelabs:main' into main
MarcGueury Jun 6, 2023
5854739
2023-06-06
MarcGueury Jun 6, 2023
dd96b5e
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Jun 6, 2023
7e60bd4
2023-06-06
MarcGueury Jun 6, 2023
5527bdf
Merge branch 'oracle-livelabs:main' into main
MarcGueury Jun 12, 2023
f035656
2023-06-12
MarcGueury Jun 12, 2023
de9b70e
2023-06-12
MarcGueury Jun 12, 2023
dad305f
2023-07-31
MarcGueury Jul 31, 2023
c72da99
2023-08-01
MarcGueury Aug 1, 2023
2813735
2023-08-01
MarcGueury Aug 1, 2023
ee86057
Videos
MarcGueury Aug 14, 2023
8eb0cdc
Video
MarcGueury Aug 14, 2023
8d7edcb
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Sep 14, 2023
ccf3a23
Update integration.md
MarcGueury Sep 14, 2023
e7e1648
Update integration.md
MarcGueury Sep 14, 2023
03f8d16
oci-starter-lab v1
MarcGueury Oct 9, 2023
50bf36c
Update intro.md
MarcGueury Oct 10, 2023
f614e6a
OCI-Starter V2
MarcGueury Oct 10, 2023
6b5cac7
push oci-portal
MarcGueury Oct 16, 2023
dbec6a6
Merge branch 'main' into main
anooshapilli Oct 17, 2023
63451ea
OCI Starter Lab v1
MarcGueury Oct 17, 2023
5e55653
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Oct 17, 2023
5114dfc
Merge branch 'oracle-livelabs:main' into main
MarcGueury Oct 17, 2023
72ad71e
QA
MarcGueury Oct 26, 2023
2fb99f2
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Oct 26, 2023
2ad5798
. files removed
MarcGueury Oct 26, 2023
4170365
Removed beta remark.
MarcGueury Oct 26, 2023
625da64
Merge branch 'oracle-livelabs:main' into main
MarcGueury Oct 27, 2023
71a3f42
oci starter - formatting
MarcGueury Nov 2, 2023
869cdcf
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Nov 2, 2023
c1c495e
OCI-Starter
MarcGueury Nov 3, 2023
fbb352a
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Nov 3, 2023
3fb8e39
oci-starter bullets
MarcGueury Nov 3, 2023
e6289cd
Introduction tag
MarcGueury Nov 6, 2023
9233367
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Nov 6, 2023
85850c2
Green Button (1rst version)
MarcGueury Nov 15, 2023
e00832b
LiveLabs Green Button
MarcGueury Nov 27, 2023
28cc4af
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Nov 27, 2023
72410f0
Small title change
MarcGueury Dec 6, 2023
d8218ed
Merge branch 'oracle-livelabs:main' into main
MarcGueury Dec 6, 2023
252ac57
Instance Pool Lab
MarcGueury Dec 13, 2023
1208dfe
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Dec 13, 2023
c84659c
Instance Pool
MarcGueury Dec 13, 2023
295f5f6
TLS
MarcGueury Jan 12, 2024
789db92
ARM
MarcGueury Mar 11, 2024
90d71c7
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Mar 11, 2024
b169a8a
ARM
MarcGueury Mar 11, 2024
07106b3
TLS
MarcGueury Mar 11, 2024
0bdbaa2
Merge branch 'oracle-livelabs:main' into main
MarcGueury Mar 18, 2024
424a106
Database Actions
MarcGueury May 22, 2024
d8357a3
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury May 22, 2024
a5fd74a
Database Action v2
MarcGueury May 25, 2024
bfbf0a6
oci-starter 3.2
MarcGueury Jan 20, 2025
27288b7
Merge branch 'oracle-livelabs:main' into main
MarcGueury Jan 20, 2025
9916e3d
Merge branch 'oracle-livelabs:main' into main
MarcGueury Feb 3, 2025
9e325ad
Split Public VM / Private VM
MarcGueury Feb 3, 2025
945a2ba
fix change in directory
MarcGueury Feb 3, 2025
33011f8
Merge branch 'oracle-livelabs:main' into main
MarcGueury Jun 2, 2025
b2d2038
Redwood change
MarcGueury Jun 2, 2025
1bff7a9
OIC3 + Redwood
MarcGueury Jun 9, 2025
9adcd5c
env.sh -> terraform.tfvars
MarcGueury Sep 10, 2025
55a63b6
Update public_compute_green.md
MarcGueury Sep 10, 2025
f0189f6
Update public_compute_green.md
MarcGueury Sep 17, 2025
f300ba6
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury May 15, 2026
d1dfc8e
Vibe-Coding Lab
MarcGueury May 15, 2026
536d630
oci-starter
MarcGueury May 15, 2026
3d489bd
Merge branch 'oracle-livelabs:main' into main
MarcGueury May 19, 2026
2eb7e97
second generation usecase
MarcGueury May 19, 2026
b2aaa0f
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury May 19, 2026
92f6eb9
Fixomat
MarcGueury May 19, 2026
b515d78
Merge branch 'oracle-livelabs:main' into main
MarcGueury May 21, 2026
0e3f8df
Small fixes
MarcGueury Jun 4, 2026
a464003
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Jun 4, 2026
55ff025
Small typos
MarcGueury Jun 4, 2026
9151517
windows
MarcGueury Jun 4, 2026
615ec2e
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Jun 4, 2026
0e710aa
typos
MarcGueury Jun 4, 2026
c3c2e53
Feedback
MarcGueury Jun 5, 2026
63365cc
Merge branch 'oracle-livelabs:main' into main
MarcGueury Aug 27, 2026
be86fab
oci-vibe-dav-lab
Aug 27, 2026
efb49f9
lg-dac
Sep 2, 2026
23a9ca1
lg-dac
Sep 2, 2026
38cf452
lg-dac
Sep 2, 2026
cb426cd
lg-dac
Sep 2, 2026
7321706
zip in lab
MarcGueury Sep 14, 2026
2c6d5fa
.env
MarcGueury Sep 14, 2026
45dd6e7
typo
MarcGueury Sep 14, 2026
9e09cc7
Merge branch 'oracle-livelabs:main' into main
MarcGueury Sep 14, 2026
f343564
TYPOS
MarcGueury Sep 14, 2026
a7e4efb
Merge branch 'main' of github.com:MarcGueury/oci
MarcGueury Sep 14, 2026
a1078ae
renumbering
MarcGueury Sep 14, 2026
ea3521f
renaming
MarcGueury Sep 14, 2026
4fff091
renaming
MarcGueury Sep 14, 2026
38f1569
screenshots
MarcGueury Sep 15, 2026
0177054
Image compressed
MarcGueury Sep 15, 2026
60fa31f
title change
MarcGueury Sep 15, 2026
29505bc
typo
MarcGueury Sep 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions oci-langchain-dac-lab/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
src/terraform/.terraform
src/terraform/provider.tf
src/terraform/env.tf
src/function/command.md
src/helidon
src/target
tfstate.tf
ssh_key_starter
ssh_key_starter.pub
target
helper
variables.sh
env.sh
output
option/src/app/dotnet/src/obj
option/src/app/dotnet_mysql/src/obj
option/src/app/java_helidon/target
option/src/app/java_helidon_mysql/target
option/src/app/java_springboot/target
option/src/app/fn/fn_java/target
.DS_Store
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions oci-langchain-dac-lab/0-intro/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Introduction

## About This Workshop
In this workshop, you will learn how to build AI agents using LangChain and LangGraph.

You will progressively build agents using:
- Python
- LangChain or LangGraph
- an on-demand large language model (LLM)
- or a Dedicated AI Cluster (DAC) to import open-weight models from Hugging Face.
- See https://docs.oracle.com/en-us/iaas/Content/generative-ai/imported-models.htm.
- For example, models include Alibaba Qwen, DeepSeek, Google Gemma, Meta Llama, Microsoft Phi, MiniMax, Mistral, Moonshot AI Kimi, NVIDIA Nemotron, OpenAI Whisper, OpenAI GptOss, and Z.ai GLM.

The installation requirements for this lab are minimal. Everything is done in OCI Cloud Editor.

Estimated Workshop Time: 60 minutes

### What You Will Learn

In these labs, you will get an introduction to how to:
- Connect LangChain or LangGraph to OCI
- Build systems ranging from simple agents to multi-agent systems

![Screenshot](images/lg-screenshot.png =50%x*)

### What is an Agent

**Definition of AI Agent:**:
- An AI Agent interacts autonomously with its environment. It uses tools and data to perform self-determined tasks to meet predetermined goals. 

![Definition](images/oda-agent-definition.png =50%x*)

Unlike a traditional program, an AI agent determines which steps and actions to take to achieve a goal.

In practice, an AI agent has:
- **Tools**
- **Data**

that it can use. It decides which tool or data to use to achieve the **goal** and produce the desired **result**. At the core of an agent is a large language model. During the lab, we will use either an on-demand model or a Dedicated AI Cluster (DAC).

![LLM](images/oda-agent-llm.png =50%x*)

### Logical Architecture

This LiveLab covers several AI-agent architectures.
- First, **a single agent** with tools and data.
- **A ReAct agent** that combines step-by-step reasoning with external tool use to solve complex tasks.

![Agent](images/lg-agent-react.png =50%x*)

We will then explore more complex architectures, including memory, and several multi-agent systems.
- **Reflection**
- **Human in the loop**
- **Supervisor**, ....

![MultiAgent](images/agent-architecture.png =50%x*)

### Physical Architecture

The physical architecture consists primarily of LangChain Agents, which call Python functions or REST APIs to access tools.
In the lab, we keep the setup as simple as possible by using dummy tools to avoid dependencies.

![Physical Architecture](images/physical-architecture.png =50%x*)

### Objectives

- Import all the samples and test them

**Please proceed to the [next lab.](#next)**

## Acknowledgements

- **Author**
- Marc Gueury, AI Applied Engineer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added oci-langchain-dac-lab/1-install/images/dac0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added oci-langchain-dac-lab/1-install/images/dac1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added oci-langchain-dac-lab/1-install/images/dac2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added oci-langchain-dac-lab/1-install/images/dac3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added oci-langchain-dac-lab/1-install/images/dac4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
216 changes: 216 additions & 0 deletions oci-langchain-dac-lab/1-install/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
# Install the components

## Introduction
In this lab, you will prepare OCI to use Generative AI and Large Language Models (LLMs).

Optionally, you will import an open-weight model into a Dedicated AI Cluster (DAC).

DAC-hosted models run on dedicated infrastructure in your tenancy. Use a DAC-hosted model when you need production-grade control over model hosting and inference. DACs provide flexibility, isolation, predictable latency, fine-tuning support, cost efficiency at scale, deployment near data, and simplified management.

Estimated time: 30 min

### Objectives

- Configure OCI Generative AI access.

### Prerequisites

- An OCI account with sufficient credits for completing the lab. (Some of the services used in this lab are not part of the *Always Free* program.)
- Check that your tenancy has access to a Generative AI region, such as **Frankfurt, London, Chicago, Abu Dhabi, Riyadh, or Osaka**. See the full list here: https://docs.oracle.com/en-us/iaas/Content/generative-ai/regions.htm
- **For Paid Tenancy**
- Click the region selector at the top of the screen.
- Check that your tenancy is subscribed to one of the above regions.
- If not, click **Manage Regions** to add it to your regions list. You need tenancy administrator rights for this.
- For example, click on the US Midwest (Chicago).
- Click **Subscribe**.

![Chicago Region](images/chicago-region.png)

- **For Free Trial**, the home region should be one where Generative AI On Demand is available.
- This lab uses Cloud Shell with Public Network access.

The lab assumes that you have access to OCI Cloud Shell with Public Network access.
To check whether you have it, start Cloud Shell. You should see **Network: Public** at the top. If not, try changing to **Public Network**. If it works, there is nothing else to do.
![Cloud Shell Public Network](images/cloud-shell-public-network.png)

OCI administrators have this permission automatically, or your administrator may have already added the required policy.
- **Solution:**

If not, ask your administrator to follow this document:

https://docs.oracle.com/en-us/iaas/Content/API/Concepts/cloudshellintro_topic-Cloud_Shell_Networking.htm#cloudshellintro_topic-Cloud_Shell_Public_Network

They need to add a policy to your tenancy:

```
<copy>
allow group <GROUP-NAME> to use cloud-shell-public-network in tenancy
</copy>
```

## Task 1: Prepare to save configuration settings

1. Open a text editor and copy and paste this text into a file on your local computer. These are the variables used during the lab.

```
<copy>
List of ##VARIABLES##
=====================
REGION=(SAMPLE) eu-frankfurt-1
COMPARTMENT_OCID=(SAMPLE) ocid1.compartment.oc1.xxxxxxx
api-key1=(SAMPLE) sk-xxxxxxxxxxxxxx
api-key2=(SAMPLE) sk-xxxxxxxxxxxxxx
OBJECT_STORAGE_NAME=(SAMPLE) bucket-123456
OPENWEATHER_API_KEY=(SAMPLE) xxxxxx

Optional
========
hugging-face-token=(SAMPLE) hf_xxxxxxxxxxxxxxxxxxxx
BASE_URL=(sample) https://inference.generativeai.eu-frankfurt-1.oci.oraclecloud.com/openai/v1/chat/completions
GENAI_DAC_ENDPOINT_OCID=(SAMPLE) ocid1.generativeaiendpoint.oc1.xxxxxxxxxx



-----------------------------------------------------------------------
</copy>
```

## Task 2: Create a Compartment

The compartment will be used to contain all the components of the lab.

You can:
- Use an existing compartment to run the lab.
- Create a new one (recommended).

1. Log in to your OCI account/tenancy.
2. Double-check that you are in a region with GenAI available.
3. Go to the 3-bar/hamburger menu of the console, then Identity & Security > Compartments.
![Menu Compartment](images/compartment1.png)
4. Click ***Create Compartment***.
- Give it a name, for example, ***VIBE-AI***.
- Click ***Create Compartment*** again.
![Create Compartment](images/compartment2.png)
5. When the compartment is created, copy the compartment OCID, ##COMPARTMENT_OCID##, and add it to your notes.

## Task 3: Create a Policy

- Go to the OCI Console menu and choose *Identity & Security* / *Policies*.
![Policy Menu](images/policy-menu.png)
- Click *Create Policy*.
- Name: *policy-vibe*
- Description: *policy-vibe*
- Click *Show Manual editor*.
- Copy the following, replacing ##COMPARTMENT\_OCID## with your value:
```
allow any-user to manage generative-ai-family in compartment id ##COMPARTMENT_OCID##
```
- Click *Create*.
![Policy Create](images/policy-create.png)

## Task 4: Create an API Key - Optional

First, create an OpenAI-compatible API key.
1. Log in to the OCI Console. Record the region name in your notes as ##REGION##. You should be in a region with Generative AI. See the full list here: https://docs.oracle.com/en-us/iaas/Content/generative-ai/regions.htm
2. Click the hamburger menu / AI & Analytics / Generative AI.

![API_KEY](images/api_key1.png)

3. Go to **API Keys** on the right side.
4. Click **Create API key**.

![API_KEY](images/api_key2.png)

5. Fill in the following:
- Name: **api-key**
- Key one name: **api-key1**
- Key one expiration date: **7/20/2030** (a date far in the future)
- Key two name: **api-key2**
- Key two expiration date: **7/20/2030** (a date far in the future)
- Click *Create*.

![API_KEY](images/api_key3.png)

6. Copy the values of the two keys in your notes (##api-key1##, ##api-key2##).
- api-key1=sk-xxxxxxxxx
- api-key2=sk-xxxxxxxxx
- Click **Close**.
Although you can choose any model from any provider to continue the lab, this guide covers several models available in OCI.

7. Note, if you use a API Key the policy defined above can be more specific like this:

```
allow any-user to manage generative-ai-family in compartment id ##COMPARTMENT_OCID## where request.principal.type = 'generativeaiapikey'
```

## Task 5: Install a Dedicated AI Cluster (DAC) - Optional

⚠️ This optional task starts a GPU for at least one hour, so it may cost several euros per hour. Do not forget to stop the DAC after testing.

We will follow this process: https://docs.oracle.com/en-us/iaas/Content/generative-ai/imported-models.htm

DAC-hosted models run on dedicated infrastructure in your tenancy. Use a DAC-hosted model when you need production-grade control over model hosting and inference. DACs provide several advantages:

- **Flexibility:** Import supported Hugging Face-format models from Hugging Face or Object Storage, test imported models with shorter commitments, choose fine-tuned or quantized versions, and right-size based on visible hardware specifications.
- **Isolation:** Run workloads on dedicated GPU resources inside your tenancy, which helps protect sensitive data, avoids shared-resource contention, and supports regulated workloads.
- **Predictable latency:** Dedicated infrastructure can provide more stable time-to-first-token and inference response times than shared model endpoints, especially for scaling production applications.
- **Fine-tuning support:** Host fine-tuned models alongside base models, run multiple fine-tuned models on a single cluster, and control model lifecycle and upgrade cadence.
- **Cost efficiency at scale:** For inference-heavy workloads, DACs can reduce effective price per token by keeping dedicated resources highly utilized and hosting multiple models on one cluster.
- **Deployment near data:** Deploy in supported OCI regions, including regulated regions where available, to support data residency, lower latency, and simpler security reviews.
- **Simplified management:** OCI manages the infrastructure while you manage model deployment, scaling, fine-tuning, and application integration.

Documentation: https://docs.oracle.com/en-us/iaas/Content/generative-ai/import-model-from-hugging-face.htm#top

1. Create a Hugging Face token.
- Open https://huggingface.co/ in your browser.
- Log in or sign up.
- Go to Hugging Face / Settings / Access Tokens.
- Click **Create new token**.
![Hugging face](images/hugging-face1.png)
- Use either a read token (easier) or, preferably for production, a fine-grained token scoped to the model repository.
- Copy the token into your notes as ##hugging-face-token##.
![Hugging face](images/hugging-face2.png)
2. In OCI Console, go to Analytics & AI / Generative AI / Imported models.
3. Click **Create Imported model**.
![imported model](images/imported-model1.png)
4. Enter model metadata:
- Available models may differ by the time you complete this lab. Choose the model that best suits your needs. This lab uses the following NVIDIA model: https://docs.oracle.com/en-us/iaas/Content/generative-ai/imported-nvidia-models.htm
- Name: **NVIDIA-Nemotron-3-Nano-30B-A3B-FP8**
- Description (optional): **Imported directly from Hugging Face**
- Vendor (optional): **NVIDIA**
- Version (optional): **1.0**
5. In Import configuration:
- Data source type: **HuggingFace**
- Model ID: **nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8**
- HuggingFace Token: paste the copied token ##hugging-face-token##
![dac](images/dac0.png)
6. Click **Next**, then **Save**, and wait until the imported model is active. For this model, it takes about three minutes.
7. In the left-hand menu, go to **Dedicated AI clusters**.
8. Click **Create dedicated AI cluster**.
- Name: **dac-vibe***
- Base model: **nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8**
- Unit shape: **H100 X4** (or **H100 X2** if you accept slower performance)
- Model replica: **1**
![dac](images/dac1.png)
9. Wait until the DAC is active.
10. Go to **Endpoints**.
![dac](images/dac2.png)
11. Click **Create endpoint**.
- Name: **dac-endpoint***
- Model: **NVIDIA-Nemotron-3-Nano-30B-A3B-FP8**
- Click **Create**.
![dac](images/dac3.png)
- Open the endpoint, copy the endpoint OCID, and add it to your notes as ##GENAI_DAC_ENDPOINT_OCID##.
12. When the endpoint is active (which can take 15 minutes or more, depending on the model size), try it using **View in Playground** in the top-left corner. Try “tell me a joke” or “who are you?”
![dac](images/dac4.png)


## Known Issues

- None

## Acknowledgements

- **Author**
- Marc Gueury, AI Agents Black Belt
- Ilayda Temir, Generative AI Black Belt
Binary file not shown.
Binary file added oci-langchain-dac-lab/2-test/images/editor1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added oci-langchain-dac-lab/2-test/images/editor2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added oci-langchain-dac-lab/2-test/images/editor3.png
Binary file added oci-langchain-dac-lab/2-test/images/env_dac.png
Binary file added oci-langchain-dac-lab/2-test/images/ex1.png
Binary file added oci-langchain-dac-lab/2-test/images/ex1_graph.png
Binary file added oci-langchain-dac-lab/2-test/images/ex2.png
Binary file added oci-langchain-dac-lab/2-test/images/ex3.png
Binary file added oci-langchain-dac-lab/2-test/images/ex4.png
Binary file added oci-langchain-dac-lab/2-test/images/ex5.png
Binary file added oci-langchain-dac-lab/2-test/images/ex5_2.png
Loading
Loading