Instructions to use Solshine/reflection-llama-3.1-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Solshine/reflection-llama-3.1-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Solshine/reflection-llama-3.1-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Solshine/reflection-llama-3.1-8B") model = AutoModelForCausalLM.from_pretrained("Solshine/reflection-llama-3.1-8B") 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 Solshine/reflection-llama-3.1-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Solshine/reflection-llama-3.1-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Solshine/reflection-llama-3.1-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Solshine/reflection-llama-3.1-8B
- SGLang
How to use Solshine/reflection-llama-3.1-8B 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 "Solshine/reflection-llama-3.1-8B" \ --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": "Solshine/reflection-llama-3.1-8B", "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 "Solshine/reflection-llama-3.1-8B" \ --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": "Solshine/reflection-llama-3.1-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use Solshine/reflection-llama-3.1-8B 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 Solshine/reflection-llama-3.1-8B 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 Solshine/reflection-llama-3.1-8B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Solshine/reflection-llama-3.1-8B to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Solshine/reflection-llama-3.1-8B", max_seq_length=2048, ) - Docker Model Runner
How to use Solshine/reflection-llama-3.1-8B with Docker Model Runner:
docker model run hf.co/Solshine/reflection-llama-3.1-8B
This model is TrainRound5, following Solshine/reflection-llama-3.1-8B-Solshine-trainround4-16bit in an iterative fine-tuning process
Not Officially Benchmarked Yet! (Please submit any benchmarking or eval results via the Community tab.)
Uploaded model
- Developed by: Solshine (Caleb DeLeeuw)
- License: llama 3.1
- Finetuned from model : Solshine/reflection-llama-3.1-8B-Solshine-trainround4-16bit
This model, trained on chain of thoughts within the reinforcement learning, predates OpenAI's o1 model. Inspired by and featuring the Reflection Tuning technique pioneered by Matt Shumer (possibly earlier innovated by the team at Anthropic, and Mlabbone' Hermes.)
To the authors' knowledge, this is V5 of the first "reflection tuned" Llama 3.1 8B LLM
As per the inspiring model "mattshumer/Reflection-Llama-3.1-70B" (this mode was not used in the training process nor as a foundational model, but only served as inspiration) :
'''
During sampling, the model will start by outputting reasoning inside and tags, and then once it is satisfied with its reasoning, it will output the final answer inside tags. Each of these tags are special tokens, trained into the model.
This enables the model to separate its internal thoughts and reasoning from its final answer, improving the experience for the user.
Inside the section, the model may output one or more tags, which signals the model has caught an error in its reasoning and will attempt to correct it before providing a final answer.
System Prompt: The system prompt used for training this model is:
You are a world-class AI system, capable of complex reasoning and reflection. Reason through the query inside tags, and then provide your final response inside
We recommend using this exact system prompt to get the best results from Reflection Llama-3.1 70B. You may also want to experiment combining this system prompt with your own custom instructions to customize the behavior of the model.
Chat Format: As mentioned above, the model uses the standard Llama 3.1 chat format. Here’s an example:
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are a world-class AI system, capable of complex reasoning and reflection. Reason through the query inside tags, and then provide your final response inside
what is 2+2?<|eot_id|><|start_header_id|>assistant<|end_header_id|>
'''
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 9
