File tree Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 11# Introduction
22
33This is an example on how to run an AI model with [ Ollama] ( https://ollama.com/ )
4+
5+ ## Running the AI model on the CPU
6+
7+ Just run the ` runner.py ` and use the ` usage_scenario_cpu.yml `
8+
9+ ## Running the AI model on the GPU
10+
11+ You must have the NVIDIA docker container provider installed and also a GPU on your system installed.
12+
13+ See https://hub.docker.com/r/ollama/ollama for details.
14+
15+ Then run the ` runner.py ` and use the ` usage_scenario_gpu.yml ` with the ` --allow-unsafe ` flag to mount the GPU into the containers.
Original file line number Diff line number Diff line change 11---
22name : AI model
33author : Arne Tarara <arne@green-coding.io>
4- description : Run an inference with a small AI model
4+ description : Run an inference with a small AI model on the CPU
55
66compose-file : !include compose.yml
77
Original file line number Diff line number Diff line change 1+ ---
2+ name : AI model
3+ author : Arne Tarara <arne@green-coding.io>
4+ description : Run an inference with a small AI model on the GPU
5+
6+ compose-file : !include compose.yml
7+
8+ services :
9+ gcb-ai-model :
10+ docker-run-args :
11+ - --gpus=all
12+
13+ flow :
14+ - name : Download gemma3-1b
15+ container : gcb-ai-model
16+ commands :
17+ - type : console
18+ command : ollama pull gemma3:1b
19+ read-notes-stdout : true
20+ log-stdout : true
21+
22+ - name : Load gemma3-1b into memory
23+ container : gcb-ai-model
24+ commands :
25+ - type : console
26+ command : ollama run gemma3:1b ""
27+ read-notes-stdout : true
28+ log-stdout : true
29+
30+ - name : Run Inference on gemma3-1b
31+ container : gcb-ai-model
32+ commands :
33+ - type : console
34+ command : ollama run gemma3:1b "Tell me a long joke?"
35+ read-notes-stdout : true
36+ log-stdout : true
You can’t perform that action at this time.
0 commit comments