Instructions to use Rufini/Gemma4-Reekon-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Rufini/Gemma4-Reekon-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-4-31b-it-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "Rufini/Gemma4-Reekon-lora") - Transformers
How to use Rufini/Gemma4-Reekon-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Rufini/Gemma4-Reekon-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Rufini/Gemma4-Reekon-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Rufini/Gemma4-Reekon-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rufini/Gemma4-Reekon-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rufini/Gemma4-Reekon-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Rufini/Gemma4-Reekon-lora
- SGLang
How to use Rufini/Gemma4-Reekon-lora 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 "Rufini/Gemma4-Reekon-lora" \ --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": "Rufini/Gemma4-Reekon-lora", "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 "Rufini/Gemma4-Reekon-lora" \ --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": "Rufini/Gemma4-Reekon-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Rufini/Gemma4-Reekon-lora 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 Rufini/Gemma4-Reekon-lora 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 Rufini/Gemma4-Reekon-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Rufini/Gemma4-Reekon-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Rufini/Gemma4-Reekon-lora", max_seq_length=2048, ) - Docker Model Runner
How to use Rufini/Gemma4-Reekon-lora with Docker Model Runner:
docker model run hf.co/Rufini/Gemma4-Reekon-lora
| """ | |
| 2026.5.3 | |
| 2026.5.5 | |
| 5.5.0 | |
| 0.24.0 | |
| __UNSLOTH_VERSIONING__ | |
| """ | |
| # Unsloth auto generated code | |
| # Copyright 2023-present Daniel Han-Chen, Michael Han-Chen & the Unsloth team. All rights reserved. | |
| # | |
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU Lesser General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # GNU General Public License for more details. | |
| # | |
| # You should have received a copy of the GNU Lesser General Public License | |
| # along with this program. If not, see <https://www.gnu.org/licenses/>. | |
| import os | |
| import sys | |
| import torch | |
| import importlib.util | |
| import math | |
| if importlib.util.find_spec("unsloth_studio") is None: | |
| UNSLOTH_STUDIO_ENABLED = False | |
| else: | |
| UNSLOTH_STUDIO_ENABLED = os.environ.get("UNSLOTH_STUDIO_DISABLED", "0") == "0" | |
| pass | |
| from typing import Any, List, Optional, Tuple, Union, Dict, Set, Callable | |
| import math | |
| UNSLOTH_ENABLE_LOGGING = os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") == "1" | |
| UNSLOTH_ENABLE_CCE = os.environ.get("UNSLOTH_ENABLE_CCE", "1") == "1" | |
| UNSLOTH_COMPILE_DISABLE = os.environ.get("UNSLOTH_COMPILE_DISABLE", "0") in ("1", "partial",) | |
| UNSLOTH_COMPILE_LOCATION = os.environ.get("UNSLOTH_COMPILE_LOCATION", "unsloth_compiled_cache") | |
| if UNSLOTH_COMPILE_LOCATION not in sys.path: | |
| sys.path.insert(0, UNSLOTH_COMPILE_LOCATION) | |
| import logging | |
| logger_compiler = logging.getLogger(__name__) | |
| if UNSLOTH_ENABLE_LOGGING: | |
| logger_compiler.setLevel(logging.DEBUG) | |
| global INFERENCE_RUNS | |
| INFERENCE_RUNS = 0 | |
| try: | |
| import torch._dynamo.eval_frame as torch_dynamo_eval_frame | |
| torch_dynamo_eval_frame._stance.stance | |
| torch_compiler_set_stance = torch.compiler.set_stance | |
| except: | |
| torch_dynamo_eval_frame = None | |
| torch_compiler_set_stance = None | |
| pass | |
| from unsloth_zoo import DEVICE_TYPE_TORCH, DEVICE_COUNT | |
| torch_compile_options = {'epilogue_fusion': True, 'max_autotune': False, 'shape_padding': True, 'trace.enabled': False, 'triton.cudagraphs': False, 'debug': False, 'dce': True, 'memory_planning': True, 'coordinate_descent_tuning': False, 'trace.graph_diagram': False, 'compile_threads': 28, 'group_fusion': True, 'disable_progress': True, 'verbose_progress': False, 'triton.multi_kernel': 0, 'triton.use_block_ptr': False, 'triton.enable_persistent_tma_matmul': True, 'triton.autotune_at_compile_time': False, 'triton.cooperative_reductions': False, 'cuda.compile_opt_level': '-O2', 'cuda.enable_cuda_lto': True, 'combo_kernels': False, 'benchmark_combo_kernel': True, 'combo_kernel_foreach_dynamic_shapes': True} | |
| from torch import Tensor | |
| import torch | |
| import torch.nn as nn | |
| from torch.nn import functional as F | |
| from typing import Any, List, Optional, Tuple, Union, Dict, Set, Callable | |
| from transformers.models.gemma4.modeling_gemma4 import (F, nn) | |
| def forward(self, input: Tensor, output_size: list[int] | None = None) -> Tensor: | |
| original_dtype = input.dtype | |
| input = input.to(self.weight.dtype) | |
| original_dtype = input.dtype | |
| input = input.to(self.weight.dtype) | |
| """ | |
| Performs the forward pass. | |
| Attributes: | |
| input (Tensor): The input tensor. | |
| output_size (list[int], optional): A list of integers representing | |
| the size of the output tensor. Default is None. | |
| """ | |
| if self.padding_mode != "zeros": | |
| raise ValueError( | |
| "Only `zeros` padding mode is supported for ConvTranspose2d" | |
| ) | |
| assert isinstance(self.padding, tuple) | |
| # One cannot replace List by Tuple or Sequence in "_output_padding" because | |
| # TorchScript does not support `Sequence[T]` or `Tuple[T, ...]`. | |
| num_spatial_dims = 2 | |
| output_padding = self._output_padding( | |
| input, | |
| output_size, | |
| self.stride, # type: ignore[arg-type] | |
| self.padding, # type: ignore[arg-type] | |
| self.kernel_size, # type: ignore[arg-type] | |
| num_spatial_dims, | |
| self.dilation, # type: ignore[arg-type] | |
| ) | |
| return F.conv_transpose2d( | |
| input, | |
| self.weight, | |
| self.bias, | |
| self.stride, | |
| self.padding, | |
| output_padding, | |
| self.groups, | |
| self.dilation, | |
| ).to(original_dtype).to(original_dtype) | |