Skip to content

Commit c35e514

Browse files
committed
docs: Update with model download instructions.
1 parent 720974e commit c35e514

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@
22

33
Building blocks for **local** agents in C++.
44

5-
> **Note:** This library is designed for running small language models locally using [llama.cpp](https://github.com/ggml-org/llama.cpp). It does not support cloud-based APIs (OpenAI, Anthropic, etc.). If you want to call external LLM APIs, this is not the right fit.
5+
> [!NOTE]
6+
> This library is designed for running small language models locally using [llama.cpp](https://github.com/ggml-org/llama.cpp). If you want to call external LLM APIs, this is not the right fit.
67
78
## Examples
89

10+
You need to download a GGUF model in order to run the examples, the default model configuration is set for `granite-4.0-micro`:
11+
12+
```bash
13+
wget https://huggingface.co/ibm-granite/granite-4.0-micro-GGUF/resolve/main/granite-4.0-micro-Q8_0.gguf
14+
```
15+
16+
> [!IMPORTANT]
17+
> If you use a different model, you will probably have to adjust the values in `ModelConfig`.
18+
19+
920
- **[Context Engineering](./examples/context-engineering/README.md)** - Use callbacks to manipulate the context between iterations of the agent loop.
1021

1122
- **[Memory](./examples/memory/README.md)** - Use tools that allow an agent to store and retrieve relevant information across conversations.

examples/context-engineering/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ This example demonstrates how to use callbacks to modify the input messages (con
44

55
## Building Blocks
66

7+
### Callbacks
78

9+
This example uses three callbacks:
10+
11+
- **ContextTrimmerCallback**: Implements `before_llm_call` to modify messages before they are sent to the LLM. It keeps only the N most recent tool call pairs (assistant message with tool_calls + tool responses), trimming older ones to prevent context window overflow during long conversations.
12+
13+
- **LoggingCallback**: Shared callback from `examples/shared/` that logs tool execution information, displaying which tool is being called and its results.
14+
15+
- **ErrorRecoveryCallback**: Shared callback from `examples/shared/` that converts tool execution errors into JSON results, allowing the agent to see errors and potentially retry or adjust.
816

917
### Tools
1018

examples/shell/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ This example exposes a single tool that can execute the given shell commands:
1212

1313
### Callbacks
1414

15+
This example uses two callbacks:
16+
17+
- **ShellConfirmationCallback**: Implements human-in-the-loop confirmation before executing shell commands. Before each command runs, it prompts the user to approve, reject, or edit the command. This is critical for security when executing arbitrary shell commands.
18+
19+
- **ErrorRecoveryCallback**: Shared callback from `examples/shared/` that converts tool execution errors into JSON results, allowing the agent to see errors and potentially retry or adjust.
1520

1621
## Building
1722

@@ -36,12 +41,11 @@ cmake --build build -j$(nproc)
3641
## Usage
3742

3843
```bash
39-
./shell-example -m <path-to-model.gguf> [-d <working-directory>]
44+
./shell-example -m <path-to-model.gguf>
4045
```
4146

4247
Options:
4348
- `-m <path>` - Path to the GGUF model file (required)
44-
- `-d <path>` - Working directory for shell commands (default: current directory)
4549

4650
## Example
4751

0 commit comments

Comments
 (0)