Instructions to use patched-codes/Llama-3.2-1B-FastApply with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use patched-codes/Llama-3.2-1B-FastApply with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("patched-codes/Llama-3.2-1B-FastApply", dtype="auto") - llama-cpp-python
How to use patched-codes/Llama-3.2-1B-FastApply with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="patched-codes/Llama-3.2-1B-FastApply", filename="unsloth.F16.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use patched-codes/Llama-3.2-1B-FastApply with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M # Run inference directly in the terminal: llama-cli -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M # Run inference directly in the terminal: llama-cli -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
Use Docker
docker model run hf.co/patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use patched-codes/Llama-3.2-1B-FastApply with Ollama:
ollama run hf.co/patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
- Unsloth Studio new
How to use patched-codes/Llama-3.2-1B-FastApply 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 patched-codes/Llama-3.2-1B-FastApply 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 patched-codes/Llama-3.2-1B-FastApply to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for patched-codes/Llama-3.2-1B-FastApply to start chatting
- Pi new
How to use patched-codes/Llama-3.2-1B-FastApply with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "patched-codes/Llama-3.2-1B-FastApply:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use patched-codes/Llama-3.2-1B-FastApply with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use patched-codes/Llama-3.2-1B-FastApply with Docker Model Runner:
docker model run hf.co/patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
- Lemonade
How to use patched-codes/Llama-3.2-1B-FastApply with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull patched-codes/Llama-3.2-1B-FastApply:Q4_K_M
Run and chat with the model
lemonade run user.Llama-3.2-1B-FastApply-Q4_K_M
List all available models
lemonade list
How to use from
llama.cppInstall from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf patched-codes/Llama-3.2-1B-FastApply:# Run inference directly in the terminal:
llama-cli -hf patched-codes/Llama-3.2-1B-FastApply:Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf patched-codes/Llama-3.2-1B-FastApply:# Run inference directly in the terminal:
./llama-cli -hf patched-codes/Llama-3.2-1B-FastApply:Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf patched-codes/Llama-3.2-1B-FastApply:# Run inference directly in the terminal:
./build/bin/llama-cli -hf patched-codes/Llama-3.2-1B-FastApply:Use Docker
docker model run hf.co/patched-codes/Llama-3.2-1B-FastApply:Quick Links
How to use?
- We use Unsloth for faster inference and load the adapter:
from unsloth import FastLanguageModel
max_seq_length = 8192
dtype = None
load_in_4bit = True
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "patched-codes/Llama-3.2-1B-FastApply",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
- The model works with original code and the edited code as input to generate the final updated code:
original_code = """import React from 'react';
import { Loader } from 'lucide-react';
interface ButtonProps {
text: string;
onClick?: () => void;
loading?: boolean;
disabled?: boolean;
icon?: React.ReactNode;
}
const Button: React.FC<ButtonProps> = ({
text,
onClick,
loading = false,
disabled = false,
icon
}) => (
<button
className="bg-blue-500 text-white p-2 rounded flex items-center gap-2"
onClick={onClick}
disabled={disabled || loading}
>
{loading ? <Loader className="animate-spin" /> : icon}
{text}
</button>
);
export default Button;
"""
update_snippet = """interface ButtonProps {
variant?: 'primary' | 'secondary' | 'danger';
size?: 'small' | 'medium' | 'large';
// ... other props
}
const Button: React.FC<ButtonProps> = ({
variant = 'primary',
size = 'medium',
// ... other props
}) => (
<button
className={`flex items-center gap-2 rounded ${
size === 'small' ? 'p-1 text-sm' :
size === 'large' ? 'p-3 text-lg' :
'p-2 text-md'
} ${
variant === 'primary' ? 'bg-blue-500 text-white' :
variant === 'secondary' ? 'bg-gray-500 text-white' :
'bg-red-500 text-white'
}`}
// ... other attributes
>
// ... existing code ...
</button>
);
"""
- Prepare your input following the prompt structure:
input_text = f"""
Merge all changes from the <update> snippet into the <code> below.
- Preserve the code's structure, order, comments, and indentation exactly.
- Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
- Do not include any additional text, explanations, placeholders, ellipses, or code fences.
<code>{original_code}</code>
<update>{update_snippet}</update>
Provide the complete updated code.
"""
messages = [
{"role": "system", "content": "You are a coding assistant that helps merge code updates, ensuring every modification is fully integrated."},
{"role": "user", "content": input_text.strip()},
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize = True,
add_generation_prompt = True, # Must add for generation
return_tensors = "pt",
).to("cuda")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer, skip_prompt = True)
output = model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens = 8192,
use_cache = True, temperature = 1.5, min_p = 0.1)
response = tokenizer.decode(output[0][len(inputs[0]):])
updated_code = response.split("<updated-code>")[1].split("</updated-code>")[0]
Uploaded model
- Developed by: patched-codes
- License: apache-2.0
- Finetuned from model : unsloth/llama-3.2-1b-instruct-bnb-4bit
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 97
Hardware compatibility
Log In to add your hardware
4-bit
5-bit
8-bit
16-bit
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support

Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf patched-codes/Llama-3.2-1B-FastApply:# Run inference directly in the terminal: llama-cli -hf patched-codes/Llama-3.2-1B-FastApply: