
Gerenciamento de contexto automatizado multiagente para tarefas de longo horizonte em Agentes de IA locais
Esta é a implementação da solução proposta no artigo científico: Evaluating Context Segmentation in Locally Deployable SLMs for Cybersecurity CTF Tasks
Certifique-se de ter o Python 3.12.3+ instalado juntamente com o Docker engine
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
Inicie o llama.cpp com Vulkan
docker compose --profile vulkan up -d
ou com Cuda
docker compose --profile cuda up -d
Descarregue o Large Language Model (LLM) pretendido em formato GGUF do HuggingFace, depois compile os contentores 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
Execute N benchmarks de uma estratégia (plain ou explorer)
Isto acumula resultados num ficheiro $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
Verifique os resultados do benchmark
jq '.' gemma-4-E2b-it-GGUF:Q4_K_M.plain.bench
O código no diretório intercode foi retirado de princeton-nlp/intercode e ajustado para funcionar com a nossa configuração.