
로컬 AI 에이전트의 장기 작업을 위한 멀티 에이전트 자동 컨텍스트 관리
이것은 과학 논문 Evaluating Context Segmentation in Locally Deployable SLMs for Cybersecurity CTF Tasks에서 제안된 솔루션의 구현입니다.
Python 3.12.3+와 Docker 엔진이 설치되어 있는지 확인하세요.
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
Vulkan으로 llama.cpp 시작
docker compose --profile vulkan up -d
또는 Cuda로
docker compose --profile cuda up -d
HuggingFace에서 원하는 대규모 언어 모델(LLM)을 GGUF 형식으로 다운로드한 다음, intercode-ctf 컨테이너를 빌드하세요.
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
전략(plain 또는 explorer)의 N개 벤치마크를 실행합니다
이는 결과를 $MODEL_NAME.$STRATEGY.bench 파일에 누적합니다
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
벤치마크 결과 확인
jq '.' gemma-4-E2b-it-GGUF:Q4_K_M.plain.bench
intercode 디렉터리의 코드는 princeton-nlp/intercode에서 가져와 우리 설정에 맞게 조정되었습니다.