Instructions to use mlabonne/Llama-3.1-70B-Instruct-lorablated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlabonne/Llama-3.1-70B-Instruct-lorablated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlabonne/Llama-3.1-70B-Instruct-lorablated") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mlabonne/Llama-3.1-70B-Instruct-lorablated") model = AutoModelForCausalLM.from_pretrained("mlabonne/Llama-3.1-70B-Instruct-lorablated") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mlabonne/Llama-3.1-70B-Instruct-lorablated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlabonne/Llama-3.1-70B-Instruct-lorablated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlabonne/Llama-3.1-70B-Instruct-lorablated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mlabonne/Llama-3.1-70B-Instruct-lorablated
- SGLang
How to use mlabonne/Llama-3.1-70B-Instruct-lorablated 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 "mlabonne/Llama-3.1-70B-Instruct-lorablated" \ --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": "mlabonne/Llama-3.1-70B-Instruct-lorablated", "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 "mlabonne/Llama-3.1-70B-Instruct-lorablated" \ --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": "mlabonne/Llama-3.1-70B-Instruct-lorablated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mlabonne/Llama-3.1-70B-Instruct-lorablated with Docker Model Runner:
docker model run hf.co/mlabonne/Llama-3.1-70B-Instruct-lorablated
🦙 Llama-3.1-70B-Instruct-lorablated
This is an uncensored version of Llama 3.1 70B Instruct created with abliteration (see this article to know more about it) using @grimjim's recipe.
More precisely, this is a LoRA-abliterated (lorablated) model:
- Extraction: We extract a LoRA adapter by comparing two models: a censored Llama 3 and an abliterated Llama 3
- Merge: We merge this new LoRA adapter using task arithmetic to a censored Llama 3.1 to abliterate it.
I adapted this recipe to Llama 3.1 70B using failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5 and optimized the LoRA rank.
The model is fully uncensored in my tests and maintains a high level of quality. A more rigorous evaluation is still needed to measure the impact of this process on benchmarks.
Special thanks to @grimjim for this technique (see his 8B model) and @FailSpy for his 70B abliterated model. Please follow them if you're interested in abliterated models.
In addition, thanks to brev.dev for providing me with compute!
🔍 Applications
General-purpose, role-play (see feedback from McUH). Use the Llama 3 chat template.
⚡️ Quantization
- GGUF: https://huggingface.co/mlabonne/Llama-3.1-70B-Instruct-lorablated-GGUF
- Bartowski: https://huggingface.co/bartowski/Llama-3.1-70B-Instruct-lorablated-GGUF (with IQ quants)
🧩 Configuration
This model was merged using the task arithmetic merge method using ./meta-llama/Meta-Llama-3.1-70B-Instruct + Llama-3-70B-Instruct-abliterated-LORA as a base.
The following YAML configuration was used to produce this model:
base_model: meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
dtype: bfloat16
merge_method: task_arithmetic
parameters:
normalize: false
slices:
- sources:
- layer_range: [0, 80]
model: meta-llama/Meta-Llama-3.1-70B-Instruct+Llama-3-70B-Instruct-abliterated-LORA
parameters:
weight: 1.0
You can reproduce this model using the following commands:
# Setup
git clone https://github.com/arcee-ai/mergekit.git
cd mergekit && pip install -e .
pip install bitsandbytes
# Extraction
mergekit-extract-lora failspy/Meta-Llama-3-70B-Instruct-abliterated-v3.5 meta-llama/Meta-Llama-3-70B-Instruct Llama-3-70B-Instruct-abliterated-LORA --rank=64
# Merge using previous config
mergekit-yaml config.yaml Llama-3.1-70B-Instruct-lorablated --allow-crimes --lora-merge-cache=./cache
- Downloads last month
- 83
Model tree for mlabonne/Llama-3.1-70B-Instruct-lorablated
Base model
meta-llama/Llama-3.1-70B
docker model run hf.co/mlabonne/Llama-3.1-70B-Instruct-lorablated