Skip to content

Commit 5dfc077

Browse files
committed
Add SmolLm2
1 parent e8b902e commit 5dfc077

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

Intro Sessions/Session 1 - Product Engineering for AI/handson_AWS.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Hands-on Guide: Setting Up Qwen 2.1 on AWS EC2 with Ollama
1+
# Hands-on Guide: Setting Up LLMs on AWS EC2 with Ollama
22

3-
This guide walks you through setting up and running Qwen 2.1, a small but efficient LLM, on a free tier AWS EC2 instance using Ollama.
3+
This guide walks you through setting up and running SmolLm2 or Qwen 2.1, small but efficient LLMs, on a free tier AWS EC2 instance using Ollama.
44

5-
## 1. Creating an EC2 Instance
5+
## 1. Create an EC2 Instance.
66

77
1. **Log in to AWS Console**
88
- Go to https://aws.amazon.com/console/
@@ -35,7 +35,7 @@ This guide walks you through setting up and running Qwen 2.1, a small but effici
3535
5. - **Configure Storage**: 30GB gp3 (free tier maximum, 30GB+ recommended)
3636
- Click "Launch Instance"
3737

38-
## 2. Connecting to Your Instance
38+
## 2. Connect to Your Instance
3939

4040
1. **Find your instance public IP**
4141
- On EC2 dashboard, select your instance
@@ -49,7 +49,7 @@ This guide walks you through setting up and running Qwen 2.1, a small but effici
4949
```
5050
- On Windows, use PuTTY or Windows Terminal
5151

52-
## 3. Create swap space (8GB recommended)
52+
## 3. Create swap space (8GB recommended on free tier)
5353

5454
```bash
5555
sudo fallocate -l 8G /swapfile
@@ -58,7 +58,7 @@ This guide walks you through setting up and running Qwen 2.1, a small but effici
5858
sudo swapon /swapfile
5959
```
6060

61-
## 4. Installing Ollama
61+
## 4. Install Ollama
6262

6363
**Install Ollama**
6464
```bash
@@ -73,7 +73,7 @@ This guide walks you through setting up and running Qwen 2.1, a small but effici
7373
![Install Ollama](https://raw.githubusercontent.com/kaizengrowth/oklahomai/main/assets/images/step4.png)
7474

7575

76-
## 5. Setting Up and Running a Small LLM
76+
## 5. Set Up and Running a Small LLM
7777

7878
**Pull and run the smallest smollm2 model**
7979
```bash
@@ -87,10 +87,22 @@ Test the model with a prompt!
8787
ollama pull qwen2:0.5b
8888
ollama run qwen2:0.5b
8989
```
90-
Test the model with a prompt!
9190

91+
## 6. Clean Up
92+
93+
When you're done, remember to stop or terminate your EC2 instance to avoid unnecessary charges:
94+
95+
1. In the EC2 dashboard, select your instance
96+
2. Choose "Instance state" and select "Stop" or "Terminate"
97+
98+
**Note**: Stopping the instance will preserve your data but still incur storage costs. Terminating the instance will delete all data.
99+
100+
----
101+
102+
103+
# Alternatives
92104
93-
## 6. Running Ollama as a Service
105+
## A. Run Ollama as a Service
94106
95107
1. **Start Ollama service**
96108
```bash
@@ -107,7 +119,7 @@ Test the model with a prompt!
107119
sudo systemctl status ollama
108120
```
109121
110-
## 7. Using the Ollama API
122+
## B. Use the Ollama API
111123
112124
Ollama provides a REST API that you can use for more advanced usage:
113125
@@ -124,21 +136,11 @@ Ollama provides a REST API that you can use for more advanced usage:
124136
```bash
125137
curl http://localhost:11434/api/tags
126138
```
127-
```
128139
129-
## 8. Running Ollama in the Background
140+
## C. Run Ollama in the Background
130141
131142
If you want to keep Ollama running after disconnecting:
132143
133144
```bash
134145
nohup ollama serve > ollama.log 2>&1 &
135-
```
136-
137-
## 9. Cleaning Up
138-
139-
When you're done, remember to stop or terminate your EC2 instance to avoid unnecessary charges:
140-
141-
1. In the EC2 dashboard, select your instance
142-
2. Choose "Instance state" and select "Stop" or "Terminate"
143-
144-
**Note**: Stopping the instance will preserve your data but still incur storage costs. Terminating the instance will delete all data.
146+
```

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,12 @@ <h3 style="font-size: 0.9em; margin-bottom: 8px;">Ethical Challenges</h3>
459459
<h3>Hands-on Activity</h3>
460460
<h2>Deploying a Tiny LLM</h2>
461461
<div class="fragment fade-in">
462-
<p>We'll deploy <span class="highlight">Qwen2.5</span>, a small but efficient LLM.</p>
462+
<p>We'll deploy <span class="highlight">SmolLm2</span> and <span class="highlight">Qwen2.5</span>, small but powerful LLMs.</p>
463463
<br>
464464
<p>Using:</p>
465465
<ul>
466466
<li>AWS EC2 (Free Tier)</li>
467467
<li>Ollama - Open source tool for running models locally</li>
468-
<li>Basic terminal commands</li>
469468
</ul>
470469
</div>
471470
</section>
@@ -481,6 +480,7 @@ <h3 class="fragment fade-in">Resources</h3>
481480
<li class="fragment fade-up" style="font-size: 0.8em; margin-bottom: 3px;"><a href="https://huyenchip.com/books/" target="_blank">Chip Huyen's "AI Engineering" and "Designing Machine Learning Systems"</a></li>
482481
<li class="fragment fade-up" style="font-size: 0.8em; margin-bottom: 3px;"><a href="https://ollama.com/docs" target="_blank">Ollama Documentation</a></li>
483482
<li class="fragment fade-up" style="font-size: 0.8em; margin-bottom: 3px;"><a href="https://huggingface.co/Qwen/Qwen2-7B" target="_blank">Qwen2 Model Card</a></li>
483+
<li class="fragment fade-up" style="font-size: 0.8em; margin-bottom: 3px;"><a href="https://huggingface.co/HuggingFaceTB/SmolLM-1.7B" target="_blank">SmolLM Model Card</a></li>
484484
<li class="fragment fade-up" style="font-size: 0.8em; margin-bottom: 3px;"><a href="https://huggingface.co/docs/evaluate/llm_evaluation" target="_blank">LLM Evaluation Guide</a></li>
485485
<li class="fragment fade-up" style="font-size: 0.8em; margin-bottom: 3px;"><a href="https://www.geeksforgeeks.org/aws-certified-ai-practitioner-aif-c01/" target="_blank">AWS Certified AI Practitioner (AIF-C01) Guide</a></li>
486486
</ul>

0 commit comments

Comments
 (0)