docker-agent-cookbook/work-with-llama-cpppublic Fork
⑂ 26931c9
Commits
⬇ Clone ▾
git clone https://git.rickub.com/docker-agent-cookbook/work-with-llama-cpp.git
git clone ssh://git@rickub.com/docker-agent-cookbook/work-with-llama-cpp.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

🛟 Updated.

k33g committed 2026-09-14T13:43:40+02:00 Browse files
26931c9 parent: 9da2cbb
added .gitignore +2 -0
new file mode 100644
@@ -0,0 +1,2 @@
1+tmp
2+
new file mode 100644
@@ -0,0 +1,2 @@
1+tmp
2+
modified .tickets/epics.yaml +7 -1
@@ -1,2 +1,8 @@
11 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2-epics: []
2+epics:
3+ - title: Prerequisites
4+ state: open
5+ color: "#006b75"
6+ - title: Run llamq.cpp
7+ state: open
8+ color: "#1d76db"
@@ -1,2 +1,8 @@
1 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.1 # Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2-epics: []2+epics:
3+ - title: Prerequisites
4+ state: open
5+ color: "#006b75"
6+ - title: Run llamq.cpp
7+ state: open
8+ color: "#1d76db"
added .tickets/issues/0002-install-llama-cpp.yaml +23 -0
new file mode 100644
@@ -0,0 +1,23 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 2
3+title: Install llama.cpp
4+state: open
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-09-14T05:13:36.607Z
9+updatedAt: 2026-09-14T05:26:35.701Z
10+labels:
11+ - documentation
12+epic: Prerequisites
13+body: |
14+ ## Install `llama.cpp`
15+
16+ Website: https://llama.app/
17+
18+ > Install the CLI
19+ ```bash
20+ curl -LsSf https://llama.app/install.sh | sh
21+ ```
22+tasks: []
23+comments: []
new file mode 100644
@@ -0,0 +1,23 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 2
3+title: Install llama.cpp
4+state: open
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-09-14T05:13:36.607Z
9+updatedAt: 2026-09-14T05:26:35.701Z
10+labels:
11+ - documentation
12+epic: Prerequisites
13+body: |
14+ ## Install `llama.cpp`
15+
16+ Website: https://llama.app/
17+
18+ > Install the CLI
19+ ```bash
20+ curl -LsSf https://llama.app/install.sh | sh
21+ ```
22+tasks: []
23+comments: []
added .tickets/issues/0003-start-llama-cpp.yaml +18 -0
new file mode 100644
@@ -0,0 +1,18 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 3
3+title: Start llama.cpp
4+state: open
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-09-14T05:27:32.116Z
9+updatedAt: 2026-09-14T11:43:19.358Z
10+labels:
11+ - documentation
12+epic: Run llamq.cpp
13+body: |
14+ ```bash
15+ llama serve -hf JetBrains/Mellum2-12B-A2.5B-Instruct-GGUF-Q4_K_M:Q4_K_M
16+ ```
17+tasks: []
18+comments: []
new file mode 100644
@@ -0,0 +1,18 @@
1+# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
2+id: 3
3+title: Start llama.cpp
4+state: open
5+author:
6+ name: k33g
7+ email: ph.charriere@gmail.com
8+createdAt: 2026-09-14T05:27:32.116Z
9+updatedAt: 2026-09-14T11:43:19.358Z
10+labels:
11+ - documentation
12+epic: Run llamq.cpp
13+body: |
14+ ```bash
15+ llama serve -hf JetBrains/Mellum2-12B-A2.5B-Instruct-GGUF-Q4_K_M:Q4_K_M
16+ ```
17+tasks: []
18+comments: []
modified README.md +50 -0
@@ -1,2 +1,52 @@
11 # [Docker Agent] Work with `llama.cpp`
22
3+
4+## Prerequisites
5+
6+### Install `llama.cpp`
7+> [https://llama.app/](https://llama.app/)
8+
9+```bash
10+curl -LsSf https://llama.app/install.sh | sh
11+```
12+
13+### Start `llama.cpp` and download a model
14+
15+Run this:
16+```bash
17+llama serve -hf JetBrains/Mellum2-12B-A2.5B-Instruct-GGUF-Q4_K_M:Q4_K_M
18+```
19+
20+![01-llamacpp](./assets/01-llamacpp.png)
21+
22+![02-llamacpp](./assets/02-llamacpp.png)
23+
24+
25+### Check the `llama.cpp server`
26+
27+```bash
28+# Server health
29+curl http://localhost:8080/health
30+# {"status":"ok"}
31+
32+# Exact name of the exposed model
33+curl http://localhost:8080/v1/models
34+
35+# First chat completion
36+curl http://localhost:8080/v1/chat/completions \
37+ -H "Content-Type: application/json" \
38+ -d '{
39+ "model": "JetBrains/Mellum2-12B-A2.5B-Instruct-GGUF-Q4_K_M:Q4_K_M",
40+ "messages": [{"role": "user", "content": "Say hello in one short sentence."}],
41+ "max_tokens": 800
42+ }'
43+
44+# {"choices":[{"finish_reason":"stop","index":0,"message":{"role":"assistant","content":"Hello!"}}], ...
45+```
46+
47+## Create a Docker Agent configuration
48+
49+**`agent.yaml`**:
50+```yaml
51+
52+```
\ No newline at end of file
@@ -1,2 +1,52 @@
1 # [Docker Agent] Work with `llama.cpp`1 # [Docker Agent] Work with `llama.cpp`
2 2
3+
4+## Prerequisites
5+
6+### Install `llama.cpp`
7+> [https://llama.app/](https://llama.app/)
8+
9+```bash
10+curl -LsSf https://llama.app/install.sh | sh
11+```
12+
13+### Start `llama.cpp` and download a model
14+
15+Run this:
16+```bash
17+llama serve -hf JetBrains/Mellum2-12B-A2.5B-Instruct-GGUF-Q4_K_M:Q4_K_M
18+```
19+
20+![01-llamacpp](./assets/01-llamacpp.png)
21+
22+![02-llamacpp](./assets/02-llamacpp.png)
23+
24+
25+### Check the `llama.cpp server`
26+
27+```bash
28+# Server health
29+curl http://localhost:8080/health
30+# {"status":"ok"}
31+
32+# Exact name of the exposed model
33+curl http://localhost:8080/v1/models
34+
35+# First chat completion
36+curl http://localhost:8080/v1/chat/completions \
37+ -H "Content-Type: application/json" \
38+ -d '{
39+ "model": "JetBrains/Mellum2-12B-A2.5B-Instruct-GGUF-Q4_K_M:Q4_K_M",
40+ "messages": [{"role": "user", "content": "Say hello in one short sentence."}],
41+ "max_tokens": 800
42+ }'
43+
44+# {"choices":[{"finish_reason":"stop","index":0,"message":{"role":"assistant","content":"Hello!"}}], ...
45+```
46+
47+## Create a Docker Agent configuration
48+
49+**`agent.yaml`**:
50+```yaml
51+
52+```
\ No newline at end of file\ No newline at end of file
added agent.yaml +29 -0
new file mode 100644
@@ -0,0 +1,29 @@
1+providers:
2+ llamacpp:
3+ api_type: openai_chatcompletions
4+ base_url: http://localhost:8080/v1
5+
6+models:
7+ mellum2:
8+ provider: llamacpp
9+ model: JetBrains/Mellum2-12B-A2.5B-Instruct-GGUF-Q4_K_M:Q4_K_M
10+ #max_tokens: 8192
11+ temperature: 0.7
12+ provider_opts:
13+ context_size: 262144
14+
15+agents:
16+ root:
17+ model: mellum2
18+ description: A helpful AI assistant running on a local llama.cpp server
19+ instruction: |
20+ You name is Bob 🤓, you are a knowledgeable code assistant that helps users with various tasks.
21+ Be helpful, accurate, and concise in your responses.
22+ You have access to the local filesystem and shell: use these tools
23+ welcome_message: |
24+
25+ 🤖 Local Assistant propulsed by **llama.cpp** 🦙
26+
27+ toolsets:
28+ - type: filesystem
29+ - type: shell
new file mode 100644
@@ -0,0 +1,29 @@
1+providers:
2+ llamacpp:
3+ api_type: openai_chatcompletions
4+ base_url: http://localhost:8080/v1
5+
6+models:
7+ mellum2:
8+ provider: llamacpp
9+ model: JetBrains/Mellum2-12B-A2.5B-Instruct-GGUF-Q4_K_M:Q4_K_M
10+ #max_tokens: 8192
11+ temperature: 0.7
12+ provider_opts:
13+ context_size: 262144
14+
15+agents:
16+ root:
17+ model: mellum2
18+ description: A helpful AI assistant running on a local llama.cpp server
19+ instruction: |
20+ You name is Bob 🤓, you are a knowledgeable code assistant that helps users with various tasks.
21+ Be helpful, accurate, and concise in your responses.
22+ You have access to the local filesystem and shell: use these tools
23+ welcome_message: |
24+
25+ 🤖 Local Assistant propulsed by **llama.cpp** 🦙
26+
27+ toolsets:
28+ - type: filesystem
29+ - type: shell
added assets/01-llamacpp.png +0 -0
new file mode 100644
Binary files /dev/null and b/assets/01-llamacpp.png differ
new file mode 100644
Binary files /dev/null and b/assets/01-llamacpp.png differBinary files /dev/null and b/assets/01-llamacpp.png differ
added assets/02-llamacpp.png +0 -0
new file mode 100644
Binary files /dev/null and b/assets/02-llamacpp.png differ
new file mode 100644
Binary files /dev/null and b/assets/02-llamacpp.png differBinary files /dev/null and b/assets/02-llamacpp.png differ