Text Generation
Transformers
Safetensors
llama
4bit
bnb
nf4
reasoning
think
openthoughts
sft
conversational
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use ping98k/open-llama-7b-openthought-sft-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ping98k/open-llama-7b-openthought-sft-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ping98k/open-llama-7b-openthought-sft-4bit") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ping98k/open-llama-7b-openthought-sft-4bit") model = AutoModelForCausalLM.from_pretrained("ping98k/open-llama-7b-openthought-sft-4bit") 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 ping98k/open-llama-7b-openthought-sft-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ping98k/open-llama-7b-openthought-sft-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ping98k/open-llama-7b-openthought-sft-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ping98k/open-llama-7b-openthought-sft-4bit
- SGLang
How to use ping98k/open-llama-7b-openthought-sft-4bit 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 "ping98k/open-llama-7b-openthought-sft-4bit" \ --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": "ping98k/open-llama-7b-openthought-sft-4bit", "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 "ping98k/open-llama-7b-openthought-sft-4bit" \ --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": "ping98k/open-llama-7b-openthought-sft-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ping98k/open-llama-7b-openthought-sft-4bit with Docker Model Runner:
docker model run hf.co/ping98k/open-llama-7b-openthought-sft-4bit
open-llama-7b-openthought-sft-4bit
Merged and 4-bit quantized OpenLLaMA 7B v2 fine-tuned on OpenThoughts-114k reasoning data with two-stage SFT.
How it was made
- Base: openlm-research/open_llama_7b_v2
- Stage 1 (mid): full-loss SFT on OpenThoughts-114k (3 epochs, 2K ctx)
- Stage 2 (sft): assistant-only SFT on OpenThoughts-114k (3 epochs, 2K ctx)
- Merged both LoRA stages into base (16bit), quantized to 4-bit NF4
Training Data
- open-thoughts/OpenThoughts-114k (DeepSeek-R1 reasoning traces)
- 10,582 samples after filtering (<= 2024 tokens)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("ping98k/open-llama-7b-openthought-sft-4bit", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("ping98k/open-llama-7b-openthought-sft-4bit")
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is a linked list?"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
print(tokenizer.decode(output[0], skip_special_tokens=False))
Related models
- ping98k/open-llama-7b-openthought-mid-lora — Stage 1 LoRA
- ping98k/open-llama-7b-openthought-mid-4bit — Stage 1 merged 4bit
- ping98k/open-llama-7b-openthought-sft-lora — Stage 2 LoRA (on top of mid-4bit)
- Downloads last month
- 2