Instructions to use runtime-contracts/llama31-8b-knapsack-lora-persistent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use runtime-contracts/llama31-8b-knapsack-lora-persistent with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B") model = PeftModel.from_pretrained(base_model, "runtime-contracts/llama31-8b-knapsack-lora-persistent") - Transformers
How to use runtime-contracts/llama31-8b-knapsack-lora-persistent with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="runtime-contracts/llama31-8b-knapsack-lora-persistent")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("runtime-contracts/llama31-8b-knapsack-lora-persistent", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use runtime-contracts/llama31-8b-knapsack-lora-persistent with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "runtime-contracts/llama31-8b-knapsack-lora-persistent" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "runtime-contracts/llama31-8b-knapsack-lora-persistent", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/runtime-contracts/llama31-8b-knapsack-lora-persistent
- SGLang
How to use runtime-contracts/llama31-8b-knapsack-lora-persistent with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "runtime-contracts/llama31-8b-knapsack-lora-persistent" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "runtime-contracts/llama31-8b-knapsack-lora-persistent", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "runtime-contracts/llama31-8b-knapsack-lora-persistent" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "runtime-contracts/llama31-8b-knapsack-lora-persistent", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use runtime-contracts/llama31-8b-knapsack-lora-persistent with Docker Model Runner:
docker model run hf.co/runtime-contracts/llama31-8b-knapsack-lora-persistent
llama31-8b-knapsack-lora-persistent
Supplementary release for the paper Evaluating Agents Across Runtime Contracts: When Mismatch Costs Efficiency or Quality (IAEval 2026, the NeurIPS 2026 Workshop on Evaluation of Interactive Agents). This is one of four LoRA adapters (Mistral-7B-v0.3 / Llama-3.1-8B base model x persistent/stateless training regime) fine-tuned on the Opaque Knapsack agentic task, extending a prior single-base-model result (see the sibling Qwen3-8B release) to a second base model family for the same paper.
- Base model: meta-llama/Llama-3.1-8B
- Training regime: persistent (trained with a persistent Python interpreter runtime (state carries over across agent turns))
- Seed: 3407
Training configuration
Fine-tuned with Axolotl, LoRA adapter, 4-bit NF4 quantized base:
| Hyperparameter | Value |
|---|---|
| lora_r | 64 |
| lora_alpha | 128 |
| lora_dropout | 0.05 |
| lora_target_modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| learning_rate | 1e-4 |
| lr_scheduler | cosine |
| optimizer | adamw_torch |
| epochs | 3.0 |
| micro_batch_size | 1 |
| gradient_accumulation_steps | 16 |
| sequence_len | 16384 |
| sample_packing | false |
| seed | 3407 |
| training data | paired traces for the "persistent" regime (see paper Appendix for pairing/filtering procedure) |
Base checkpoint's own chat-format tokens (e.g. <|eot_id|>) are untrained on this base (non-instruct) checkpoint -- trained and served with a hand-written minimal template using only real trained tokens (BOS/EOS + plain-text role prefixes), not Llama's native instruct template.
Provenance
Released alongside the paper Evaluating Agents Across Runtime Contracts: When Mismatch Costs Efficiency or Quality (IAEval 2026, the NeurIPS 2026 Workshop on Evaluation of Interactive Agents), to reproduce its reported results.
License
Built with Llama. These LoRA weights are a derivative of meta-llama/Llama-3.1-8B and are distributed under the Llama 3.1 Community License (a copy is included as LICENSE), not Apache 2.0. Use is also subject to Meta's Acceptable Use Policy.
- Downloads last month
- 12
Model tree for runtime-contracts/llama31-8b-knapsack-lora-persistent
Base model
meta-llama/Llama-3.1-8B