Instructions to use QuixiAI/Llama-3-8B-Instruct-abliterated-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuixiAI/Llama-3-8B-Instruct-abliterated-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuixiAI/Llama-3-8B-Instruct-abliterated-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("QuixiAI/Llama-3-8B-Instruct-abliterated-v2") model = AutoModelForCausalLM.from_pretrained("QuixiAI/Llama-3-8B-Instruct-abliterated-v2", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use QuixiAI/Llama-3-8B-Instruct-abliterated-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuixiAI/Llama-3-8B-Instruct-abliterated-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuixiAI/Llama-3-8B-Instruct-abliterated-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuixiAI/Llama-3-8B-Instruct-abliterated-v2
- SGLang
How to use QuixiAI/Llama-3-8B-Instruct-abliterated-v2 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 "QuixiAI/Llama-3-8B-Instruct-abliterated-v2" \ --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": "QuixiAI/Llama-3-8B-Instruct-abliterated-v2", "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 "QuixiAI/Llama-3-8B-Instruct-abliterated-v2" \ --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": "QuixiAI/Llama-3-8B-Instruct-abliterated-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use QuixiAI/Llama-3-8B-Instruct-abliterated-v2 with Docker Model Runner:
docker model run hf.co/QuixiAI/Llama-3-8B-Instruct-abliterated-v2
|
Download README.md from QuixiAI/Llama-3-8B-Instruct-abliterated-v2: direct link, hf CLI and curl.
- Browser
- Download file 1.67 kB
-
https://huggingface.co/QuixiAI/Llama-3-8B-Instruct-abliterated-v2/resolve/main/README.md
- Command line
-
hf download hf://QuixiAI/Llama-3-8B-Instruct-abliterated-v2/README.md
-
curl -L -o README.md https://huggingface.co/QuixiAI/Llama-3-8B-Instruct-abliterated-v2/resolve/main/README.md
1.67 kB
| library_name: transformers | |
| license: llama3 | |
| # Model Card for Llama-3-8B-Instruct-abliterated-v2 | |
| ## Overview | |
| This model card describes the Llama-3-8B-Instruct-abliterated-v2 model, which is an orthogonalized version of the meta-llama/Llama-3-8B-Instruct model, and an improvement upon the previous generation Llama-3-8B-Instruct-abliterated. This variant has had certain weights manipulated to inhibit the model's ability to express refusal. | |
| [Join the Cognitive Computations Discord!](https://discord.gg/cognitivecomputations) | |
| ## Details | |
| * The model was trained with more data to better pinpoint the "refusal direction". | |
| * This model is MUCH better at directly and succinctly answering requests without producing even so much as disclaimers. | |
| ## Methodology | |
| The methodology used to generate this model is described in the preview paper/blog post: '[Refusal in LLMs is mediated by a single direction](https://www.alignmentforum.org/posts/jGuXSZgv6qfdhMCuJ/refusal-in-llms-is-mediated-by-a-single-direction)' | |
| ## Quirks and Side Effects | |
| This model may come with interesting quirks, as the methodology is still new and untested. The code used to generate the model is available in the Python notebook [ortho_cookbook.ipynb](https://huggingface.co/failspy/llama-3-70B-Instruct-abliterated/blob/main/ortho_cookbook.ipynb). | |
| Please note that the model may still refuse to answer certain requests, even after the weights have been manipulated to inhibit refusal. | |
| ## Availability | |
| ## How to Use | |
| This model is available for use in the Transformers library. | |
| GGUF Quants are available [here](https://huggingface.co/failspy/Llama-3-8B-Instruct-abliterated-v2-GGUF). |