You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/lab-2/README.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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
+
---
2
6
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!
4
8
5
9
!!! note
6
10
There is an expectation of some programming experience/knowledge here, if you don't have any
7
11
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.
9
13
10
14
## Sanity checks
11
15
@@ -34,7 +38,7 @@ Now, lets open up VSCode and have it look something like the following:
34
38

35
39
36
40
!!! 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.
38
42
39
43
## Building out `main.py`
40
44
@@ -185,6 +189,3 @@ take a look at the next screen shot:
185
189
186
190
It does some amazing work for you code, and really finally, take a look at [this video](https://www.youtube.com/watch?v=V3Yq6w9QaxI)
187
191
if you want a quick video of other neat <https://continue.dev> functions we didn't go over.
You'll notice that it's a lot like programming in general. And that's by design, PE is just an engineering
56
55
problem leveraging development processes.
57
56
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
+
58
96
Now that you see this overview, lets actually get into some prompts and helpful prompt templates.
59
97
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
0 commit comments