
إدارة سياق آلية متعددة الوكلاء للمهام طويلة المدى في وكلاء الذكاء الاصطناعي المحليين
هذا هو تنفيذ الحل المقترح في الورقة العلمية: Evaluating Context Segmentation in Locally Deployable SLMs for Cybersecurity CTF Tasks
تأكد من تثبيت Python 3.12.3+ إلى جانب Docker engine
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
شغّل llama.cpp مع Vulkan
docker compose --profile vulkan up -d
أو مع Cuda
docker compose --profile cuda up -d
نزّل نموذج اللغة الكبير (LLM) المطلوب بصيغة GGUF من HuggingFace، ثم ابنِ حاويات 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
شغّل N من المعايير لاستراتيجية (plain أو explorer)
هذا يراكم النتائج في ملف $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 وتم تعديله ليعمل مع إعدادنا.