Instructions to use Rafii/f1llama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Rafii/f1llama with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Rafii/f1llama") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- MLX LM
How to use Rafii/f1llama with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Rafii/f1llama"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Rafii/f1llama" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rafii/f1llama", "messages": [ {"role": "user", "content": "Hello"} ] }'
Rafii/f1llama
The Model Rafii/f1llama was converted to MLX format from mlx-community/Meta-Llama-3-8B-Instruct-8bit using mlx-lm version 0.20.1 and Finetuned using Low-rank adaptation (LoRA) on M3.
Use with mlx
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("Rafii/f1llama")
prompt="hello"
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, verbose=True)
- Downloads last month
- 6
Model size
3B params
Tensor type
F16
·
U32 ·
Hardware compatibility
Log In to add your hardware
Quantized
Model tree for Rafii/f1llama
Base model
mlx-community/Meta-Llama-3-8B-Instruct-8bit