Instructions to use EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT") model = AutoModelForCausalLM.from_pretrained("EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT") 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 EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT
- SGLang
How to use EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT 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 "EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT" \ --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": "EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT", "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 "EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT" \ --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": "EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT 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 EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT 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 EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT", max_seq_length=2048, ) - Docker Model Runner
How to use EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT with Docker Model Runner:
docker model run hf.co/EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT
Model Information
EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT
This is a state-of-the-art language model optimized for neutrality, STEM proficiency, and ethical alignment. Fine-tuned Deepseek-R1-distill-llama-8b-unsloth-bnb-4bit for science, chemistry, and mathematics with reduced cultural/political bias. This large language model is open source. This is supervised fine tuned with medical chain of thought
Table of Contents
Features
- Neutral Worldview: Minimizes political/cultural bias via globally diverse training data and human feedback.
- STEM Specialization: Enhanced performance in:
- Chemistry: Reaction mechanisms, periodic trends, spectroscopy.
- Mathematics: Equation solving, proofs, calculus.
- General Science: Hypothesis generation, research summarization.
- Ethical Guardrails: Filters sensitive content and flags uncertain outputs.
Installation
pip install transformers torch
pip install accelerate
pip install -U transformers
Basic Inference
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT")
model = AutoModelForCausalLM.from_pretrained("EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT")
prompt = "Calculate the molar mass of sulfuric acid (H₂SO₄)."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
##advance inference
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained("EpistemeAI/Fireball-R1-Llama-3.1-8B-Medical-COT")
# Load the model in 8-bit precision using bitsandbytes (requires a CUDA GPU)
model = AutoModelForCausalLM.from_pretrained(
"EpistemeAI/Fireball-R1-Llama-3.1-8B",
load_in_8bit=True, # Enable 8-bit loading to reduce memory usage
device_map="auto" # Automatically map model layers to the available device(s)
)
# Define the system prompt and the user prompt
system_prompt = "You are a highly knowledgeable assistant with expertise in chemistry and physics. <think>"
user_prompt = "Calculate the molar mass of sulfuric acid (H₂SO₄)."
# Combine the system prompt with the user prompt. The format here follows a common convention for chat-like interactions.
full_prompt = f"System: {system_prompt}\nUser: {user_prompt}\nAssistant:"
# Tokenize the combined prompt and move the inputs to the GPU
inputs = tokenizer(full_prompt, return_tensors="pt").to("cuda")
# Generate output text from the model
outputs = model.generate(**inputs, max_length=12200)
# Decode and print the result, skipping special tokens
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)
Uploaded model
- Developed by: EpistemeAI
- License: apache-2.0
- Finetuned from model : unsloth/deepseek-r1-distill-llama-8b-unsloth-bnb-4bit
Ethical Considerations
Do Not Use For:
- legal advice without expert oversight.
- Generating partisan or culturally insensitive content.
Limitations:
- May occasionally produce plausible but incorrect scientific explanations.
- Not fully immune to subtle biases.
Thank you
We appreciate the companies as following: Unsloth, Meta and Deepseek.
License
This model is licensed under [apache-2.0] - see LICENSE for details.
Uploaded model
- Developed by: EpistemeAI
- License: apache-2.0
- Finetuned from model : EpistemeAI/Fireball-R1-Llama-3.1-8B
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 6
