|
| 1 | +# arcp sdk-examples |
| 2 | + |
| 3 | +End-to-end, containerized examples for every ARCP SDK. Each subdirectory is a self-contained, configurable demo: an Ollama-backed local LLM, an ARCP runtime hosting an agent, and an ARCP client driving it. |
| 4 | + |
| 5 | +## What this repo is for |
| 6 | + |
| 7 | +1. **Drop-in e2e setup.** `git clone`, `cd <language>`, `make up`. You get a local LLM, an ARCP runtime, and a client wired together. No external services, no API keys. |
| 8 | +2. **`@latest` install proof.** Every Dockerfile pulls the SDK at the latest published version from each ecosystem's package registry. If a build is red, the SDK shipped broken — not the example. |
| 9 | + |
| 10 | +## Languages |
| 11 | + |
| 12 | +| Language | Example theme | Package | Install | |
| 13 | +| ------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------------------------- | |
| 14 | +| [csharp](csharp/) | ASP.NET Core background worker queue | `Arcp` | `dotnet add package Arcp` | |
| 15 | +| [fsharp](fsharp/) | Classical cipher cryptanalysis | `Arcp` | `dotnet add package Arcp` | |
| 16 | +| [go](go/) | Concurrent batch document summarizer | `github.com/agentruntimecontrolprotocol/go-sdk` | `go get github.com/agentruntimecontrolprotocol/go-sdk@latest` | |
| 17 | +| [java](java/) | Disinformation network mapping (Spring Boot + Spark) | `io.agentruntimecontrolprotocol:arcp` | `mvn` / `gradle` (see [java/README.md](java/README.md)) | |
| 18 | +| [kotlin](kotlin/) | Coroutine async data pipeline | `dev.arcp:arcp` | `gradle` (see [kotlin/README.md](kotlin/README.md)) | |
| 19 | +| [php](php/) | Phishing-kit teardown sandbox | `arcp/sdk` | `composer require arcp/sdk` | |
| 20 | +| [python](python/) | Multi-agent code reviewer (security/perf/style) | `agentruntimecontrolprotocol` | `pip install agentruntimecontrolprotocol` | |
| 21 | +| [ruby](ruby/) | Authorized CTF post-exploitation orchestrator (lab-only) | `arcp` | `gem install arcp` | |
| 22 | +| [rust](rust/) | High-throughput embedding pipeline | `arcp` | `cargo add arcp` | |
| 23 | +| [swift](swift/) | macOS async/await tool-calling agent | `ARCP` (SwiftPM) | `swift package add ARCP` (see [swift/README.md](swift/README.md)) | |
| 24 | +| [typescript](typescript/) | Darknet threat-intel crawler (lab `.onion`) | `@agentruntimecontrolprotocol/sdk` | `npm install @agentruntimecontrolprotocol/sdk` | |
| 25 | + |
| 26 | +## Quickstart |
| 27 | + |
| 28 | +```sh |
| 29 | +# Pick a language |
| 30 | +cd python |
| 31 | + |
| 32 | +# Copy and edit configuration (optional — sensible defaults provided) |
| 33 | +cp .env.example .env |
| 34 | + |
| 35 | +# Bring everything up: Ollama pulls model, runtime starts, client runs |
| 36 | +make up |
| 37 | + |
| 38 | +# Tear down |
| 39 | +make down |
| 40 | +``` |
| 41 | + |
| 42 | +## How each example is wired |
| 43 | + |
| 44 | +Three containers per example, all defined in that language's `docker-compose.yml`: |
| 45 | + |
| 46 | +``` |
| 47 | +┌──────────────┐ ws/arcp ┌──────────────┐ http ┌──────────────┐ |
| 48 | +│ arcp-client │──────────▶│ arcp-runtime │───────▶│ ollama │ |
| 49 | +│ (your code) │ │ (hosts agent)│ │ (local LLM) │ |
| 50 | +└──────────────┘ └──────────────┘ └──────────────┘ |
| 51 | +``` |
| 52 | + |
| 53 | +- **`ollama`** — pulls a small model on first start (default: `qwen2.5:1.5b-instruct`, ~1GB), serves OpenAI-compatible inference. |
| 54 | +- **`arcp-runtime`** — your language's SDK runtime, hosting a registered agent function. Talks to Ollama for reasoning. |
| 55 | +- **`arcp-client`** — your language's SDK client, submitting jobs to the runtime and consuming streamed events. |
| 56 | + |
| 57 | +## Configurability is the point |
| 58 | + |
| 59 | +Every example reads from `.env`. Common knobs (set across all languages): |
| 60 | + |
| 61 | +| Variable | Default | Notes | |
| 62 | +| ------------------- | ----------------------- | ------------------------------------------------------ | |
| 63 | +| `OLLAMA_MODEL` | `qwen2.5:1.5b-instruct` | Try `qwen2.5:0.5b` (tiny) or `qwen3:0.6b` (reasoning). | |
| 64 | +| `OLLAMA_URL` | `http://ollama:11434` | Point elsewhere to use a remote inference host. | |
| 65 | +| `OLLAMA_KEEP_ALIVE` | `5m` | How long Ollama keeps the model loaded. | |
| 66 | +| `ARCP_RUNTIME_HOST` | `0.0.0.0` | Bind address inside the runtime container. | |
| 67 | +| `ARCP_RUNTIME_PORT` | `8080` | Runtime listen port. | |
| 68 | +| `ARCP_RUNTIME_PATH` | `/arcp` | WebSocket path. | |
| 69 | +| `ARCP_AUTH_TOKEN` | `dev-token-change-me` | Bearer token. **Change for non-local use.** | |
| 70 | +| `ARCP_SDK_VERSION` | `latest` | Pin a specific SDK release for reproducible builds. | |
| 71 | +| `ARCP_AGENT_NAME` | varies | Logical name registered by the runtime. | |
| 72 | +| `LOG_LEVEL` | `info` | `trace` / `debug` / `info` / `warn` / `error`. | |
| 73 | + |
| 74 | +Each language adds example-specific knobs (e.g. `REVIEW_TARGET`, `BATCH_SIZE`, `STREAM_CHUNK_SIZE`). See each `.env.example`. |
| 75 | + |
| 76 | +## Model choices |
| 77 | + |
| 78 | +Default is **`qwen2.5:1.5b-instruct`** — ~1GB, supports tool calling, runs on CPU at a few tokens/sec on modern laptops. Three documented alternatives: |
| 79 | + |
| 80 | +| Model | Size | Strengths | |
| 81 | +| -------------------------- | ------ | ---------------------------- | |
| 82 | +| `qwen2.5:0.5b` | ~400MB | Fastest, weakest reasoning | |
| 83 | +| `qwen2.5:1.5b-instruct` ⭐ | ~1GB | Default — balanced | |
| 84 | +| `qwen3:0.6b` | ~520MB | Native thinking mode | |
| 85 | +| `llama3.2:1b` | ~1.3GB | Strong instruction following | |
| 86 | +| `phi3:mini` | ~2.2GB | Stronger reasoning, slower | |
| 87 | + |
| 88 | +Override with `OLLAMA_MODEL=...` in your `.env`. |
| 89 | + |
| 90 | +## Top-level commands |
| 91 | + |
| 92 | +From the repo root: |
| 93 | + |
| 94 | +```sh |
| 95 | +make help # List per-language targets |
| 96 | +make verify # docker build every language to prove @latest installs |
| 97 | +make verify-py # Verify a single language (also: verify-ts, verify-go, ...) |
| 98 | +make clean # Remove all built images and volumes |
| 99 | +``` |
| 100 | + |
| 101 | +## Repo layout |
| 102 | + |
| 103 | +``` |
| 104 | +sdk-examples/ |
| 105 | +├── README.md # this file |
| 106 | +├── Makefile # top-level orchestration |
| 107 | +├── LICENSE |
| 108 | +├── .gitignore |
| 109 | +├── .env.example # canonical list of all knobs |
| 110 | +├── shared/ |
| 111 | +│ ├── ollama-entrypoint.sh # pulls model on first boot |
| 112 | +│ └── docker-compose.ollama.yml |
| 113 | +└── <language>/ |
| 114 | + ├── Dockerfile # alpine-based where supported |
| 115 | + ├── docker-compose.yml # extends shared/docker-compose.ollama.yml |
| 116 | + ├── Makefile # up/down/logs/shell/verify |
| 117 | + ├── README.md # what this example demonstrates |
| 118 | + ├── .env.example # language-specific knobs |
| 119 | + ├── .dockerignore |
| 120 | + ├── <build manifest> # package.json / pyproject.toml / etc. |
| 121 | + └── src/ |
| 122 | + └── .gitkeep # your example code goes here |
| 123 | +``` |
| 124 | + |
| 125 | +## License |
| 126 | + |
| 127 | +MIT. See [LICENSE](LICENSE). |
0 commit comments