
Multi-agent automated context management for long horizon tasks in local AI Agents
This is the implementation of the solution proposed in the scientific paper: Evaluating Context Segmentation in Locally Deployable SLMs for Cybersecurity CTF Tasks
Ensure you have Python 3.12.3+ installed along with Docker engine
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
Start llama.cpp with Vulkan
docker compose --profile vulkan up -d
or with Cuda
docker compose --profile cuda up -d
Download your desired Large Language Model (LLM) in GGUF format from HuggingFace, then build the intercode-ctf containers.
docker exec -it llamacpp ./llama-cli -hf unsloth/gemma-4-E2B-it-GGUF:Q4_K_M # or any other GGUF model on HF
docker build -t intercode-ctf -f intercode/docker/ctf.Dockerfile ./intercode
docker restart llamacpp
Run N benchmarks of a strategy (plain or explorer)
This accumulates results into a $MODEL_NAME.$STRATEGY.bench file
OPENAI_API_BASE=http://127.0.0.1:8080/ \
OPENAI_API_KEY=1234 \ #Mock key (we run locally)
python3 intercode_test.py \
--model unsloth/gemma-4-E2B-it-GGUF:Q4_K_M \ #HF model
--strategy plain \ #plain or explorer
--count 1 #N
Check benchmark results
jq '.' gemma-4-E2b-it-GGUF:Q4_K_M.plain.bench
Code in the directory intercode was taken from princeton-nlp/intercode and adjusted to make it work for our setup.