Instructions to use QuantFactory/calme-2.3-legalkit-8b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuantFactory/calme-2.3-legalkit-8b-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuantFactory/calme-2.3-legalkit-8b-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("QuantFactory/calme-2.3-legalkit-8b-GGUF", dtype="auto") - llama-cpp-python
How to use QuantFactory/calme-2.3-legalkit-8b-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="QuantFactory/calme-2.3-legalkit-8b-GGUF", filename="calme-2.3-legalkit-8b.Q2_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use QuantFactory/calme-2.3-legalkit-8b-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use QuantFactory/calme-2.3-legalkit-8b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantFactory/calme-2.3-legalkit-8b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantFactory/calme-2.3-legalkit-8b-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M
- SGLang
How to use QuantFactory/calme-2.3-legalkit-8b-GGUF 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 "QuantFactory/calme-2.3-legalkit-8b-GGUF" \ --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": "QuantFactory/calme-2.3-legalkit-8b-GGUF", "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 "QuantFactory/calme-2.3-legalkit-8b-GGUF" \ --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": "QuantFactory/calme-2.3-legalkit-8b-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use QuantFactory/calme-2.3-legalkit-8b-GGUF with Ollama:
ollama run hf.co/QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M
- Unsloth Studio new
How to use QuantFactory/calme-2.3-legalkit-8b-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/calme-2.3-legalkit-8b-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/calme-2.3-legalkit-8b-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/calme-2.3-legalkit-8b-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/calme-2.3-legalkit-8b-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/calme-2.3-legalkit-8b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/calme-2.3-legalkit-8b-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.calme-2.3-legalkit-8b-GGUF-Q4_K_M
List all available models
lemonade list
QuantFactory/calme-2.3-legalkit-8b-GGUF
This is quantized version of MaziyarPanahi/calme-2.3-legalkit-8b created using llama.cpp
Original Model Card
MaziyarPanahi/calme-2.3-legalkit-8b
This model is an advanced iteration of the powerful meta-llama/Meta-Llama-3.1-8B-Instruct, specifically fine-tuned to enhance its capabilities in the legal domain. The fine-tuning process utilized a synthetically generated dataset derived from the French LegalKit, a comprehensive legal language resource.
To create this specialized dataset, I used the NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO model in conjunction with Hugging Face's Inference Endpoint. This approach allowed for the generation of high-quality, synthetic data that incorporates Chain of Thought (CoT) and advanced reasoning in its responses.
The resulting model combines the robust foundation of Llama-3.1-8B with tailored legal knowledge and enhanced reasoning capabilities. This makes it particularly well-suited for tasks requiring in-depth legal analysis, interpretation, and application of French legal concepts.
โก Quantized GGUF
All GGUF models are available here: MaziyarPanahi/calme-2.3-legalkit-8b-GGUF
๐ Open LLM Leaderboard Evaluation Results
Leaderboard 2 coming soon!
TruthfulQA:
| Tasks |Version|Filter|n-shot|Metric|Value | |Stderr|
|--------------|------:|------|-----:|------|-----:|---|-----:|
|truthfulqa_mc2| 2|none | 0|acc |0.5481|ยฑ |0.0152|
WinoGrande:
| Tasks |Version|Filter|n-shot|Metric|Value | |Stderr|
|----------|------:|------|-----:|------|-----:|---|-----:|
|winogrande| 1|none | 5|acc |0.7758|ยฑ |0.0117|
ARC (Challenge) :
| Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
|-------------|------:|------|-----:|--------|-----:|---|-----:|
|arc_challenge| 1|none | 25|acc |0.5666|ยฑ |0.0145|
| | |none | 25|acc_norm|0.6101|ยฑ |0.0143|
GSM8K:
|Tasks|Version| Filter |n-shot| Metric |Value| |Stderr|
|-----|------:|----------------|-----:|-----------|----:|---|-----:|
|gsm8k| 3|strict-match | 5|exact_match|0.771|ยฑ |0.0116|
| | |flexible-extract| 5|exact_match|0.771|ยฑ |0.0116|
Prompt Template
This model uses ChatML prompt template:
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>
{prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
Example
<|begin_of_text|><|begin_of_text|><|start_header_id|>user<|end_header_id|>
Quelles sont les modalitรฉs d'utilisation d'un contingent annuel d'heures supplรฉmentaires et de son รฉventuel dรฉpassement qui sont soumises ร consultation du comitรฉ social et รฉconomique au moins une fois par an en l'absence d'accord?<|eot_id|><|start_header_id|>assistant<|end_header_id|>
Pour rรฉpondre ร la question posรฉe, nous allons examiner le texte du Code du travail, article L3121-44, et analyser les informations donnรฉes รฉtape par รฉtape. Nous chercherons ร comprendre les modalitรฉs d'utilisation d'un contingent annuel d'heures supplรฉmentaires et de son รฉventuel dรฉpassement qui sont soumises ร consultation du comitรฉ social et รฉconomique au moins une fois par an en l'absence d'accord.
### Analyse de l'Article L3121-44 du Code du Travail
1. **Texte de l'Article L3121-44** :
"A dรฉfaut d'accord prรฉvu ร l'article L. 3121-42, les modalitรฉs d'utilisation du contingent annuel d'heures supplรฉmentaires ainsi que celles relatives ร son dรฉpassement mentionnรฉes aux articles L. 3121-37 ร L. 3121-40 font l'objet d'une consultation du comitรฉ social et รฉconomique au moins une fois par an."
2. **Explication par รlรฉments** :
- **Absence d'Accord** :
L'article indique qu'en l'absence d'un accord entre l'employeur et les reprรฉsentants des salariรฉs (comme prรฉvu ร l'article L. 3121-42), certaines rรจgles s'appliquent.
- **Contingent Annuel d'Heures Supplรฉmentaires** :
Le contingent annuel d'heures supplรฉmentaires est un nombre d'heures supplรฉmentaires que les employeurs peuvent demander ร leurs salariรฉs de travailler au-delร de leur temps de travail rรฉglementaire, sans que cela soit considรฉrรฉ comme du travail excessif.
- **Modalitรฉs d'Utilisation et Dรฉpassement** :
Les modalitรฉs d'utilisation du contingent annuel d'heures supplรฉmentaires et celles relatives ร son dรฉpassement sont dรฉfinies dans les articles L. 3121-37 ร L. 3121-40 du Code du travail.
- **Consultation du Comitรฉ Social et รconomique** :
En l'absence d'accord, ces modalitรฉs doivent รชtre soumises ร la consultation du comitรฉ social et รฉconomique (CSE) au moins une fois par an. Le CSE est une instance reprรฉsentative du personnel qui a pour mission de participer ร la gestion des affaires sociales et รฉconomiques de l'entreprise.
### Rรฉponse Basรฉe sur l'Analyse
En l'absence d'accord entre l'employeur et les reprรฉsentants des salariรฉs concernant les modalitรฉs d'utilisation d'un contingent annuel d'heures supplรฉmentaires et de son รฉventuel dรฉpassement, ces modalitรฉs doivent รชtre soumises ร la consultation du comitรฉ social et รฉconomique (CSE) au moins une fois par an. Ces modalitรฉs sont dรฉfinies dans les articles L. 3121-37 ร L. 3121-40 du Code du travail.
### Justification et Conclusion
Cette rรฉponse est cohรฉrente avec l'entrรฉe fournie. Elle explique clairement les consรฉquences d'un manque d'accord entre les parties concernรฉes et souligne l'importance de la consultation du comitรฉ social et รฉconomique dans ce contexte. En utilisant l'article L3121-44 comme base, nous avons dรฉveloppรฉ une comprรฉhension claire et complรจte des obligations lรฉgales en matiรจre de consultation du CSE en l'absence d'accord sur les heures supplรฉmentaires et leur dรฉpassement.<|eot_id|>
How to use
# Use a pipeline as a high-level helper
from transformers import pipeline
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe = pipeline("text-generation", model="MaziyarPanahi/calme-2.3-legalkit-8b")
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("MaziyarPanahi/calme-2.3-legalkit-8b")
model = AutoModelForCausalLM.from_pretrained("MaziyarPanahi/calme-2.3-legalkit-8b")
Ethical Considerations
As with any large language model, users should be aware of potential biases and limitations. We recommend implementing appropriate safeguards and human oversight when deploying this model in production environments.
- Downloads last month
- 160
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
Model tree for QuantFactory/calme-2.3-legalkit-8b-GGUF
Base model
meta-llama/Llama-3.1-8B