Instructions to use khazarai/LawLumin-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khazarai/LawLumin-1.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khazarai/LawLumin-1.7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("khazarai/LawLumin-1.7B") model = AutoModelForCausalLM.from_pretrained("khazarai/LawLumin-1.7B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use khazarai/LawLumin-1.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khazarai/LawLumin-1.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khazarai/LawLumin-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/khazarai/LawLumin-1.7B
- SGLang
How to use khazarai/LawLumin-1.7B 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 "khazarai/LawLumin-1.7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khazarai/LawLumin-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "khazarai/LawLumin-1.7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khazarai/LawLumin-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use khazarai/LawLumin-1.7B with Docker Model Runner:
docker model run hf.co/khazarai/LawLumin-1.7B
Model Card for LawLumin-1.7B
Model Description
JurisQwen-1.7B-CoT is a fine-tuned version of Qwen3-1.7B, specialized for legal reasoning and analytical thinking using structured Chain-of-Thought (CoT) methodology. This model was trained on the moremilk/CoT_Legal_Issues_And_Laws — a curated collection of simplified legal reasoning tasks designed to help AI systems learn how to identify legal issues, apply rules, and derive logical conclusions through transparent step-by-step reasoning.
📘 Intended Use
Primary Use Cases:
- Research on automated legal reasoning and structured CoT prompting.
- Educational tools to teach the logic of legal analysis in simplified contexts.
- Development and benchmarking of explainable reasoning systems in law and ethics.
Examples of What It Can Do:
- Identify potential legal issues in a hypothetical scenario.
- Articulate simplified legal principles or rules.
- Apply those rules to a set of facts and reason toward a logical conclusion.
- Provide interpretable explanations of its reasoning process.
🚫 Out-of-Scope
This model must not be used for:
- Providing legal advice or professional representation.
- Deciding or predicting outcomes in real-world legal cases.
- Interpreting actual statutes, case law, or jurisdiction-specific rules.
- Simulating legal practice, strategy, or procedural law.
The model is intended strictly for research and educational purposes within a simplified, illustrative legal reasoning framework.
Bias, Risks, and Limitations
- Simplified Legal Scope: Only reflects general reasoning patterns — not actual laws or jurisdictions.
- No Factual Authority: Cannot verify legal facts, interpret statutes, or provide reliable advice.
- Ethical Use: Always ensure human oversight in any downstream application.
How to Get Started with the Model
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("khazarai/LawLumin-1.7B")
model = AutoModelForCausalLM.from_pretrained(
"khazarai/LawLumin-1.7B",
device_map={"": 0}
)
question = """
What types of legal assistance are typically offered through legal aid organizations, and how does eligibility for these services generally work?
"""
messages = [
{"role" : "user", "content" : question}
]
text = tokenizer.apply_chat_template(
messages,
tokenize = False,
add_generation_prompt = True,
enable_thinking = True,
)
from transformers import TextStreamer
_ = model.generate(
**tokenizer(text, return_tensors = "pt").to("cuda"),
max_new_tokens = 2048,
temperature = 0.6,
top_p = 0.95,
top_k = 20,
streamer = TextStreamer(tokenizer, skip_prompt = True),
)
Dataset
Dataset: moremilk/CoT_Legal_Issues_And_Laws Scope:
- Core Legal Reasoning Tasks: Identifying issues, stating relevant simplified rules, applying those rules to facts, and deriving conclusions.
- Illustrative Scenarios: Demonstrating legal logic with examples from basic tort, contract, or property situations.
- Emphasis on CoT: Step-by-step reasoning transparency for interpretability and explainability research.
- Foundational Focus: Designed to train models in logical, structured legal reasoning — not domain-specific law practice.
- Downloads last month
- 1