Instructions to use olaverse/legal-peace-v1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use olaverse/legal-peace-v1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="olaverse/legal-peace-v1.0")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("olaverse/legal-peace-v1.0") model = AutoModelForMultimodalLM.from_pretrained("olaverse/legal-peace-v1.0") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use olaverse/legal-peace-v1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "olaverse/legal-peace-v1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "olaverse/legal-peace-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/olaverse/legal-peace-v1.0
- SGLang
How to use olaverse/legal-peace-v1.0 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 "olaverse/legal-peace-v1.0" \ --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": "olaverse/legal-peace-v1.0", "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 "olaverse/legal-peace-v1.0" \ --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": "olaverse/legal-peace-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use olaverse/legal-peace-v1.0 with Docker Model Runner:
docker model run hf.co/olaverse/legal-peace-v1.0
Legal-Peace-7B-v1.0 ๐๏ธโ๏ธ
โ ๏ธ Beta Model: This model is experimental and intended for research purposes. Outputs must always be reviewed by a qualified legal professional. Not recommended for production use.
Legal-Peace-7B-v1.0 is a fine-tuned Mistral-7B-v0.3 model designed for contract analysis and legal reasoning tasks.
Part of the Olaverse Legal
Quick Start
Via the olaverse library (recommended)
pip install olaverse[legal]
from olaverse.llm import LegalPeace
model = LegalPeace() # defaults to "olaverse/legal-peace-v1.0"
model.load() # requires GPU + unsloth
prompt = "Analyze this clause: 'All disputes shall be resolved through binding arbitration in Delaware.' What are the key implications?"
response = model.generate(prompt, max_new_tokens=300, temperature=0.7)
print(response)
Via Hugging Face directly
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="olaverse/legal-peace-v1.0",
max_seq_length=2048,
dtype=None,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
prompt = "Analyze this clause: 'All disputes shall be resolved through binding arbitration in Delaware.'"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=300, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Performance vs Base Mistral-7B
| Benchmark | Improvement |
|---|---|
| Inference Speed | โก 10.3% faster (9.27s vs 10.33s) |
| Contract Analysis | ๐ 32.6% faster |
| Case Predictions | โ๏ธ 14.0% faster |
| Response Quality | ๐ More structured, professional legal responses |
Model Details
| Property | Value |
|---|---|
| Base Model | Mistral-7B-v0.3 |
| Parameters | 7B |
| Quantization | 4-bit (unsloth BnB) |
| Training | SFT (4,800 cases) + DPO (419 legal reasoning examples) |
| License | Apache 2.0 |
Use Cases
โ Contract clause analysis and review โ Legal research assistance โ Evidence evaluation โ Case outcome prediction โ Legal Q&A
Limitations
โ ๏ธ Beta model โ not for production use โ ๏ธ Not a replacement for legal professionals โ ๏ธ Always verify outputs with qualified attorneys โ ๏ธ Trained primarily on U.S. legal data
Links
Made with โค๏ธ by Olaverse AI
- Downloads last month
- 91
Model tree for olaverse/legal-peace-v1.0
Base model
mistralai/Mistral-7B-v0.3
docker model run hf.co/olaverse/legal-peace-v1.0