--- base_model: - meta-llama/Llama-3.1-8B - MaziyarPanahi/calme-2.3-legalkit-8b library_name: peft tags: - mergekit - peft - lora - vllm --- # NEXS legal LoRA (vLLM-ready) Rank-128 LoRA adapter for the **legal** domain, extracted with [mergekit](https://github.com/arcee-ai/mergekit) from [MaziyarPanahi/calme-2.3-legalkit-8b](https://huggingface.co/MaziyarPanahi/calme-2.3-legalkit-8b) against the base model [meta-llama/Llama-3.1-8B](https://huggingface.co/meta-llama/Llama-3.1-8B), then sanitized for vLLM serving. ## Sanitization applied The raw mergekit extraction included full-rank `modules_to_save` tensors (`embed_tokens`, `lm_head`, and RMSNorm layers) that vLLM's LoRA runtime does not support. This upload contains only the pure low-rank `lora_A`/`lora_B` weights (224 pairs: 32 layers x q/k/v/o/gate/up/down projections, bf16), with `modules_to_save: null` in `adapter_config.json`. No `resize_token_embeddings()` call is needed to load this adapter. ## Serving with vLLM ```bash python -m vllm.entrypoints.openai.api_server \ --model meta-llama/Llama-3.1-8B \ --enable-lora \ --lora-modules legal=anjohn0077/NEXS-legal-lora \ --port 8000 \ --max-lora-rank 128 \ --gpu-memory-utilization 0.85 ``` ## Evaluation (mmlu_professional_law) | Variant | Accuracy | |---|---| | Base model | 0.4941 | | **This LoRA on base (via vLLM)** | **0.4915** | | Original full fine-tune | 0.4948 | Evaluated with [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness) against a local vLLM OpenAI-compatible endpoint: ```bash lm_eval --model local-completions \ --model_args model=legal,base_url=http://localhost:8000/v1/completions,tokenizer=meta-llama/Llama-3.1-8B,num_concurrent=10 \ --tasks mmlu_professional_law \ --output_path results/vllm_legal ```