Instructions to use kamaboko2007/llm_advance_024_enhanced_rules with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kamaboko2007/llm_advance_024_enhanced_rules with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kamaboko2007/llm_advance_024_enhanced_rules") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kamaboko2007/llm_advance_024_enhanced_rules") model = AutoModelForCausalLM.from_pretrained("kamaboko2007/llm_advance_024_enhanced_rules") 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]:])) - Inference
- Local Apps Settings
- vLLM
How to use kamaboko2007/llm_advance_024_enhanced_rules with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kamaboko2007/llm_advance_024_enhanced_rules" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kamaboko2007/llm_advance_024_enhanced_rules", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kamaboko2007/llm_advance_024_enhanced_rules
- SGLang
How to use kamaboko2007/llm_advance_024_enhanced_rules 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 "kamaboko2007/llm_advance_024_enhanced_rules" \ --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": "kamaboko2007/llm_advance_024_enhanced_rules", "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 "kamaboko2007/llm_advance_024_enhanced_rules" \ --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": "kamaboko2007/llm_advance_024_enhanced_rules", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use kamaboko2007/llm_advance_024_enhanced_rules 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 kamaboko2007/llm_advance_024_enhanced_rules 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 kamaboko2007/llm_advance_024_enhanced_rules to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kamaboko2007/llm_advance_024_enhanced_rules to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="kamaboko2007/llm_advance_024_enhanced_rules", max_seq_length=2048, ) - Docker Model Runner
How to use kamaboko2007/llm_advance_024_enhanced_rules with Docker Model Runner:
docker model run hf.co/kamaboko2007/llm_advance_024_enhanced_rules
Qwen3-4B AgentBench "023-Jinja-Heuristics" LoRA
This repository provides a highly optimized merged model fine-tuned from Qwen/Qwen3-4B-Instruct-2507. It is specifically engineered to achieve state-of-the-art performance on AgentBench (specifically ALFWorld and DBBench) by solving the catastrophic forgetting and format-collision problems inherent in multi-task agent fine-tuning.
This repository contains the fully merged model (base + LoRA merged). No separate base model loading is needed.
Key Innovation: Jinja2 Contextual Routing & Heuristics Injection
The true power of this model lies not just in its weights, but in its custom tokenizer_config.json.
We completely overrode the default chat_template using Jinja2 to act as an "Absolute Defense Shield" and a "Dynamic Heuristics Injector".
Depending on the user's prompt, the tokenizer automatically intercepts the input and injects task-specific System Prompts (Cheat Sheets) just before inference:
1. DB Bench (MySQL) Mode
When MySQL or SQL is detected in the prompt, the model is forced into a DB Agent persona with the following injected rules:
- Error Recovery: "If you encounter an SQL error (e.g., 'Unknown column'), DO NOT panic. Use
Action: Operationto executeDESCRIBE table_name;and check the correct schema before retrying." - Loop Prevention: "Never repeat the exact same invalid SQL."
2. ALFWorld (Household) Mode
When household or Interact with a is detected, the model is forced into an ALFWorld Agent persona:
- Format Override: Completely ignores the evaluation system's trap (
THOUGHT:/ACTION:) and strictly enforces the stableThink:/Act:format. - Exploration Logic: "If an action fails (
Nothing happened), analyze why in yourThink:step and choose a DIFFERENT action." - Efficiency: "If you search a receptacle and do not find the target object, DO NOT search it again. Move to a different location."
Training Configuration (The "Golden Ratio")
To maximize reasoning capabilities without exceeding the 4B model's capacity, we used a highly curated "Golden Ratio" dataset:
- Dataset: ALFWorld v5 Trajectories + DBBench Distilled (494 high-quality, noise-free trajectories).
- Method: LoRA (full precision base) via Unsloth.
- Loss Strategy: Loss is applied strictly to all assistant turns in the multi-turn trajectory, ignoring user/system prompts.
Hyperparameters:
- Max sequence length: 8192
- Epochs: 2
- Learning rate: 1e-6
- LoRA Rank (r): 64
- LoRA Alpha: 128
- Target Modules:
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Usage
Because the magic is embedded in the Jinja2 chat_template, you must use this tokenizer to see the performance gains.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "your_huggingface_id/your_model_name" # Change this to your actual repo ID
# 1. Load the customized tokenizer (CRITICAL)
tokenizer = AutoTokenizer.from_pretrained(model_id)
# 2. Load merged model directly
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
# 3. Standard Inference (The Jinja2 template handles the routing automatically)
messages = [
{"role": "user", "content": "You are a specialized MySQL database agent..."}
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 14
Model tree for kamaboko2007/llm_advance_024_enhanced_rules
Base model
Qwen/Qwen3-4B-Instruct-2507