Skip to content

Commit b632f8b

Browse files
committed
version 2.0 of the workshop
This feels like the true v2.0 of this workshop release. Signed-off-by: JJ Asghar <[email protected]>
1 parent 7b08e0d commit b632f8b

File tree

8 files changed

+228
-54
lines changed

8 files changed

+228
-54
lines changed

docs/README.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,23 @@ logo: images/ibm-blue-background.png
88

99
## Open Source AI Workshop
1010

11-
Welcome to our workshop! In this workshop we'll be using a local AI Model for code completion, as well as training a model
12-
locally to help it gain some knowledge.
11+
Welcome to our workshop! In this workshop we'll be using a local AI Model for code completion, and learning best practices
12+
leveraging an Open Source LLM.
13+
14+
Our overarching goals of this workshop is as follows:
1315

1416
* Understand what Open Source AI is, and its general use cases
15-
* How to use an AI model that is built in a verifiable and legal way
16-
* Learn a suggested workflow on how to fine tune a model with new knowledge and skills!
17+
* How to use an Open Source AI model that is built in a verifiable and legal way
18+
* Learn about Prompt Engineering, how to leverage a local LLM in starter daily tasks
19+
20+
!!! tip
21+
This workshop may seem short, but a lot of working with AI is exploration and engagement.
22+
These labs is set up for you to get "everything you need to start" put together so you
23+
can share in a collaborative learning environment and shared exploration. Don't hesitate
24+
to raise your hand ask questions and engage with the other students.
25+
26+
By the time you leave today, you'll have everything you need leverage this on your laptop
27+
at home, without internet access, in a secure manner.
1728

1829
## About this workshop
1930

@@ -27,14 +38,21 @@ The introductory page of the workshop is broken down into the following sections
2738

2839
| | |
2940
| :--- | :--- |
30-
| [Lab 0: Pre-work](pre-work/README.md) | Pre-work for the project |
31-
| [Lab 1: Building a local AI co-pilot](lab-1/README.md) | Let's get it installed! |
41+
| [Lab 0: Pre-work](pre-work/README.md) | Pre-work and set up for the workshop |
42+
| [Lab 1: Building a local AI co-pilot](lab-1/README.md) | Let's get VSCode and our local AI working together |
3243
| [Lab 2: Using the local AI co-pilot](lab-2/README.md) | Let's learn about how to use a local AI co-pilot |
33-
| [Lab 3: Configuring AnythingLLM](lab-3/README.md) | Let's configure AnythingLLM |
34-
| [Lab 3.5: Configuring Open-WebUI](lab-3.5/README.md) | Let's configure Open-WebUI |
35-
| [Lab 4: Prompt engineering overview](lab-4/README.md) | Let's learn about leveraging the `granite3.1-dense` model |
44+
| [Lab 3: Configuring AnythingLLM](lab-3/README.md) | Let's configure AnythingLLM or Open-WebUI |
45+
| [Lab 3.5: Configuring Open-WebUI](lab-3.5/README.md) | Let's configure Open-WebUI or AnythingLLM |
46+
| [Lab 4: Prompt engineering overview](lab-4/README.md) | Let's learn about leveraging and engaging with the `granite3.1-dense` model |
3647
| [Lab 5: Useful prompts and use cases](lab-5/README.md) | Let's get some good over arching prompts and uses cases with `granite3.1-dense` model |
3748

49+
!!! success
50+
Thank you SO MUCH for joining us on this workshop, if you have any thoughts or questions
51+
the TAs would love answer them for you. If you found any issues or bugs, don't hesitate
52+
to put a [Pull Request](https://github.com/IBM/opensource-ai-workshop/pulls) or an
53+
[Issue](https://github.com/IBM/opensource-ai-workshop/issues/new) in and we'll get to it
54+
ASAP.
55+
3856
## Compatibility
3957

4058
This workshop has been tested on the following platforms:

docs/lab-1/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Building a local AI co-pilot
1+
---
2+
title: Building a local AI co-pilot
3+
description: Learn how to leverage Open Source AI
4+
logo: images/ibm-blue-background.png
5+
---
26

37
## Overview
48

docs/lab-2/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
# Using the local AI co-pilot
1+
---
2+
title: Using the local AI co-pilot
3+
description: Learn how to leverage Open Source AI
4+
logo: images/ibm-blue-background.png
5+
---
26

3-
Lets play with our new found local AI Open Source AI!
7+
Let's play with our new found local AI Open Source AI!
48

59
!!! note
610
There is an expectation of some programming experience/knowledge here, if you don't have any
711
or are uncomfortable here, don't fret! Our TA's are here to help and want to help, raise your
8-
hand and ask. You can always skip to Lab 3, or Lab 5 if you want.
12+
hand and ask.
913

1014
## Sanity checks
1115

@@ -34,7 +38,7 @@ Now, lets open up VSCode and have it look something like the following:
3438
![batman](../images/whoisbatman.png)
3539

3640
!!! troubleshooting
37-
If you lose the Continue pane in VSCode, you can re-enable it in VSCode by clicking at the top of the screen under "View --> Appearance --> Secondary Side Bar" and then the Continue window will be visiable again.
41+
If you lose the Continue pane in VSCode, you can re-enable it in VSCode by clicking at the top of the screen under "View --> Appearance --> Secondary Side Bar" and then the Continue window will be visible again.
3842

3943
## Building out `main.py`
4044

@@ -185,6 +189,3 @@ take a look at the next screen shot:
185189

186190
It does some amazing work for you code, and really finally, take a look at [this video](https://www.youtube.com/watch?v=V3Yq6w9QaxI)
187191
if you want a quick video of other neat <https://continue.dev> functions we didn't go over.
188-
189-
On to the next lab!
190-

docs/lab-3.5/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: Steps to configure Open-WebUI for usage
44
logo: images/ibm-blue-background.png
55
---
66

7-
# Configuring Open-WebUI
8-
97
Now that you've gotten [Open-WebUI installed](../pre-work/README.md#open-webui) we need to configure it with `ollama` and Open-WebUI
108
to talk to one another. The following screenshots will be from a Mac, but the gist of this should be the same on Windows and Linux.
119

@@ -19,13 +17,19 @@ raise your hand we'll be there to help you ASAP.
1917
Before clicking the "Getting Started" button, make sure that `ollama` has
2018
`granite3.1-dense` pulled down.
2119

20+
```bash
21+
ollama pull granite3.1-dense:8b
22+
```
23+
2224
Run the following command to confirm you have the [granite3.1-dense](https://ollama.com/library/granite3.1-dense)
2325
model downloaded in `ollama`. This may take a bit, but we should have a way to copy it directly on your laptop.
2426

2527
If you didn't know, the supported languages with `granite3.1-dense` now include:
28+
2629
- English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, Chinese (Simplified)
2730

2831
And the Capabilities also include:
32+
2933
- Summarization
3034
- Text classification
3135
- Text extraction
@@ -39,16 +43,13 @@ And the Capabilities also include:
3943
!!! note
4044
We need to figure out a way to copy the models into ollama without downloading.
4145

42-
```bash
43-
ollama pull granite3.1-dense:8b
44-
```
45-
4646
Click the "Getting Started" button, and fill out the next screen, and click the
47-
"Create Admin Account"
47+
"Create Admin Account". This will be your login for your local machine, remember this because
48+
it will also be the Open-WebUI configuration user if want to dig deeper into it after this workshop.
4849

4950
![user setup screen](../images/openwebui_user_setup_screen.png)
5051

51-
You should see the main page now, with `granite3.1-dense:latest` right there in
52+
You should see the Open-WebUI main page now, with `granite3.1-dense:latest` right there in
5253
the center!
5354

5455
![main screen](../images/openwebui_main_screen.png)
@@ -64,7 +65,7 @@ Who is Batman?
6465
Now you may notice that the answer is slighty different then the screen shot above. That's expected and nothing to worry about. If
6566
you have more questions about it raise your hand and one of the helpers would love to talk you about it.
6667

67-
Congratulations! You have Open-WebUI running now, configured to work with `granite3.1-dense` and `Ollama`!
68+
Congratulations! You have Open-WebUI running now, configured to work with `granite3.1-dense` and `ollama`!
6869

6970
!!! note
7071
This was done on your local machine, take a moment and realize if you

docs/lab-3/README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: Steps to configure AnythingLLM for usage
44
logo: images/ibm-blue-background.png
55
---
66

7-
# Configuring AnythingLLM
8-
97
Now that you've gotten [AnythingLLM installed](../pre-work/README.md#anythingllm) we need to configure it with `ollama` and AnythingLLM
108
to talk to one another. The following screenshots will be from a Mac, but the gist of this should be the same on Windows and Linux.
119

@@ -18,6 +16,10 @@ raise your hand we'll be there to help you ASAP.
1816
Next as a sanity check, run the following command to confirm you have the [granite3.1-dense](https://ollama.com/library/granite3.1-dense)
1917
model downloaded in `ollama`. This may take a bit, but we should have a way to copy it directly on your laptop.
2018

19+
```bash
20+
ollama pull granite3.1-dense:8b
21+
```
22+
2123
If you didn't know, the supported languages with `granite3.1-dense` now include:
2224

2325
- English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, Chinese (Simplified)
@@ -35,18 +37,14 @@ And the Capabilities also include:
3537
- Long-context tasks including long document/meeting summarization, long document QA, etc.
3638

3739
!!! note
38-
We need to figure out a way to copy the models into ollama without downloading.
39-
40-
```bash
41-
ollama pull granite3.1-dense:8b
42-
```
40+
We need to figure out a way to copy the models into ollama without downloading, conference wifi is never fast enough.
4341

4442
Next click on the `wrench` icon, and open up the settings. For now we are going to configure the global settings for `ollama`
4543
but you may want to change it in the future.
4644

4745
![wrench icon](../images/anythingllm_wrench_icon.png)
4846

49-
Click on the "LLM" section, and select **Ollama** as the LLM Provider. Also select the `granite3-dense:8b` model. (you should be able to
47+
Click on the "LLM" section, and select **Ollama** as the LLM Provider. Also select the `granite3-dense:8b` model. (You should be able to
5048
see all the models you have access to through `ollama` there.)
5149

5250
![llm configuration](../images/anythingllm_llm_config.png)
@@ -68,5 +66,5 @@ it knows _something_.
6866
Now you may notice that the answer is slighty different then the screen shot above. That's expected and nothing to worry about. If
6967
you have more questions about it raise your hand and one of the helpers would love to talk you about it.
7068

71-
Congratulations! You have AnythingLLM running now, configured to work with `granite3.1-dense` and `Ollama`!
69+
Congratulations! You have AnythingLLM running now, configured to work with `granite3.1-dense` and `ollama`!
7270

docs/lab-4/README.md

Lines changed: 113 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ description: A general overview of Prompt Engineering
44
logo: images/ibm-blue-background.png
55
---
66

7-
# Prompt engineering overview
8-
97
First off, a lot of this information was taken from some training from
108
[@juliandiscovers](https://www.youtube.com/channel/UCXKuHxwAeZZu_dg_qs8Z-9w) and [@BenzaMaman](https://www.instagram.com/benzamaman/)
119
workshops and content. This is just a broad overview of what they teach,
1210
and if you are looking for in depth tutorials, on Prompt Engineering they
1311
are amazing.
1412

1513
## What is Prompt Engineering (PE)?
14+
1615
An [article from IBM](https://www.ibm.com/topics/prompt-engineering).
1716

1817
From [Wikipedia](https://en.wikipedia.org/wiki/Prompt_engineering):
@@ -55,5 +54,117 @@ desired subject, style, layout, lighting, and aesthetic.
5554
You'll notice that it's a lot like programming in general. And that's by design, PE is just an engineering
5655
problem leveraging development processes.
5756

57+
## Hands on portion
58+
59+
Bring up your interface to your local LLM, this can be one of the previous configured systems like
60+
AnythingLLM or Open-WebUI, or even `ollama` on the command line.
61+
62+
This is an example of using the CLI with vanilla `ollama`:
63+
64+
```bash
65+
$ ollama run granite3.1-dense
66+
>>> Send a message (/? for help)
67+
```
68+
69+
You can pretty much write whatever you want to, give it a shot. Treat it like a good friend, be polite,
70+
and guide it to an answer you are looking for.
71+
72+
I really do like starting with `Who is Batman?` then work from there. Maybe see if the LLM knows who's
73+
Batman's top 10 enemies are, and what was the most interesting way Batman saved the day? You have an opportunity
74+
to ask a knowledge repository here on everything Batman related, or any super hero for that matter, take advantage of
75+
it.
76+
77+
If you treat the LLM like the knowledge repository it is, you can get so much useful information out of it, but like
78+
all interpreted knowledge repositories you need can't blindly take it's output. You should always cross reference important things,
79+
and treat it like the "best librarian" you've ever seen. They know a TON of information, know how to
80+
find it, and where to get more, but they aren't the final authority on the topic.
81+
82+
!!! tip
83+
Have you figured something neat out? Raise your hand and offer it to the workshop. Only you know what you came up with.
84+
We've had stories of leveraging `granite` as a DM for a "one shot" dungeon campaign and leveraged it for collaborative
85+
writing exercises. We are excited to see what you share!
86+
87+
If you're curious the one shot `prompt` was this, the student took inspiration from [this website](https://www.the-enchanted-scribe.com/post/6-steps-one-prompt-using-chatgpt-to-generate-one-shot-d-d-adventures):
88+
89+
```
90+
Generate a self-contained dungeon adventure for a party of 4 adventurers,
91+
set in a [specific environment like a forgotten temple or an abandoned mine],
92+
with a clear objective, unique challenges, and a memorable boss encounter,
93+
all designed to be completed in a single session of gameplay
94+
```
95+
5896
Now that you see this overview, lets actually get into some prompts and helpful prompt templates.
5997

98+
## Asking the LLM about Batman
99+
100+
```
101+
$ ollama run granite3.1-dense
102+
>>> Who is Batman?
103+
Batman is a fictional superhero created by artist Bob Kane and writer Bill Finger. He first appeared in Detective Comics #27,
104+
published by DC Comics in 1939. Born as Bruce Wayne, he becomes Batman to fight crime after witnessing the murder of his parents
105+
as a child. Unlike most superheroes, he has no actual superpowers but instead relies on his physical prowess, intellect, and
106+
advanced technology. His symbol is a bat, which instills fear in criminals due to its nocturnal nature. Batman is known for his
107+
strong moral code, not killing his enemies, and his relentless pursuit of justice. He's one of the most iconic and enduring
108+
characters in the world of comics and popular culture.
109+
110+
>>> What was Batman's top 10 enemies?
111+
Batman has faced numerous villains over the years, but here are ten of his most notable adversaries:
112+
113+
1. The Joker - One of Batman's archenemies, The Joker is a criminal mastermind known for his chaotic and psychopathic behavior.
114+
He often uses deadly weapons disguised as everyday objects like flowers or toys.
115+
116+
2. Two-Face (Harvey Dent) - Once Batman's ally and Gotham City district attorney, Harvey Dent was scarred by acid and became a
117+
villain with a coin that decides his actions, representing the duality of good and evil within him.
118+
119+
3. Penguin (Oswald Cobblepot) - A short, stout criminal with an umbrella-based arsenal, Penguin is known for his love of
120+
animals, especially birds, and operates from his hideout in the sewers beneath Gotham City.
121+
122+
4. Catwoman (Selina Kyle) - A skilled thief and Batman's complex love interest, Catwoman wears a cat-themed costume and uses her
123+
agility, charm, and whip to outwit her adversaries.
124+
125+
5. Ra's al Ghul - An immortal villain who leads the League of Assassins, Ra's seeks to cleanse the world with natural disasters
126+
and replace humanity with a more "pure" species. Batman's ally Talia heads the organization.
127+
128+
6. The Riddler (Edward Nygma) - A criminal genius with an obsession for riddles, The Riddler uses complex puzzles to taunt
129+
Batman while committing crimes.
130+
131+
7. Mr. Freeze (Victor Fries) - Once a brilliant cryogenic scientist, Victor Fries became Mr. Freeze after an accident involving
132+
cryogenic technology left him needing a refrigerated suit to survive.
133+
134+
8. Poison Ivy (Dr. Pamela Isley) - A plant-based villainess with control over plants and the ability to manipulate pheromones,
135+
she seeks to destroy humanity and create a new world dominated by flora.
136+
137+
9. Bane - A supervillain known for his physical strength, enhanced by a drug called Venom, Bane once broke Batman's back in a
138+
legendary storyline.
139+
140+
10. Ra's al Ghul's Daughter Talia - As mentioned earlier, Talia is both the daughter of Ra's and an occasional love interest for
141+
Bruce Wayne/Batman. She has played both roles as ally and enemy throughout various Batman stories.
142+
143+
These villains represent a mix of criminal masterminds, twisted psychopaths, and formidable physical threats that challenge
144+
Batman's intellect, strength, and resolve.
145+
146+
>>> What was the most interesting way Batman saved the day?
147+
One of the most intriguing and innovative ways Batman has saved the day is from Frank Miller's seminal graphic novel "The Dark
148+
Knight Returns." In this story, an aging Batman returns to crime-fighting after a self-imposed retirement.
149+
150+
After a series of escalating conflicts with a new mutant gang known as the Mutants, led by Green Arrow's former sidekick, Talia
151+
al Ghul (daughter of Ra's al Ghul), Batman faces off against their leader, a mutated Joker. The Joker has been given superhuman
152+
strength through a risky experiment conducted by his henchmen.
153+
154+
The climax of the storyline takes place in a nuke-laden Bomb Squad truck, driven by the Joker himself and escorted by the
155+
Mutants. With conventional methods proving ineffective against the Joker's newfound power, Batman devises an unconventional
156+
plan:
157+
158+
1. Luring the Joker into a trap at the Gotham Bay.
159+
2. Tying a massive concrete block to his leg and dropping him into the water, hoping the weight would neutralize the mutagenic
160+
serum, returning the Joker's strength to normal levels.
161+
3. Simultaneously triggering an explosion that would capsize the Bomb Squad truck carrying the nuclear bomb, causing it to sink
162+
with the now-weakened Joker still inside.
163+
4. Jumping into the water after the Joker and subduing him just before the truck goes underwater.
164+
5. Finally, using a remote detonator to destroy the truck and the bomb, thus saving Gotham City from a catastrophic explosion.
165+
166+
This daring plan showcases Batman's resourcefulness, unwavering determination, and willingness to take risks for the greater
167+
good - all hallmarks of his character. The innovative approach to saving the day has since become one of the most iconic moments
168+
in Batman's extensive history.
169+
```
170+

0 commit comments

Comments
 (0)