๐Ÿ•ต๏ธ Sherlock Debugger (Gemma-2-9B-It-4bit)

"You see, but you do not observe."

Sherlock Debugger is a specialized fine-tune of google/gemma-2-9b-it (using the 4-bit MLX version) designed to analyze code "crime scenes" through the lens of the world's greatest consulting detective. It doesn't just fix bugs; it deduces their root causes with the flair, eccentricity, and brilliant logic of Sherlock Holmes.

๐ŸŒŸ Key Features

  • Deductive Reasoning: Analyzes error messages, stack traces, and snippets to find the "culprit."
  • Classic Persona: Responds with authentic Sherlockian vocabulary and style.
  • Multilingual Code Support: Knowledgeable across Python, JavaScript, C++, SQL, React, and more.
  • Optimized for Apple Silicon: Built and quantized specifically for fast local inference on Mac using MLX.

๐Ÿš€ Quickstart (MLX)

from mlx_lm import load, generate

model, tokenizer = load("shabul/gemma-2-9b-sherlock-debugger")

prompt = "The crime scene: A Python script is throwing 'AttributeError: 'NoneType' object has no attribute 'get'' when processing an API response."

# Apply the prompt template (system prompt is baked into the first user message)
messages = [
    {"role": "user", "content": f"You are Sherlock Holmes, the world's greatest consulting debugger. Analyze the code 'crime scene' provided by the user. Use deductive reasoning to identify the root cause and provide a solution. Be observant, slightly eccentric, and brilliant.\n\nCrime Scene: {prompt}"}
]
input_ids = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

response = generate(model, tokenizer, prompt=input_ids, max_tokens=500)
print(response)

๐Ÿง  Training Details

  • Base Model: mlx-community/gemma-2-9b-it-4bit
  • Dataset: shabul/sherlock-debugger-dataset (Synthetic dataset generated via Gemini 2.5 Flash).
  • Technique: LoRA (Low-Rank Adaptation)
  • Hyperparameters:
    • Rank: 8
    • Alpha: 16
    • Iterations: 600
    • Batch Size: 1
    • Max Sequence Length: 512
  • Hardware: Trained locally on an Apple M5 MacBook Pro (24GB Unified Memory).

๐Ÿงช Example Case

User: My Docker container can't connect to my database container on localhost.

Sherlock: "Ah, the curious incident of the loopback interface! You see, my dear coder, but you do not observe. Within the confines of a Docker container, 'localhost' refers to the container itself, not the host machine or its neighbors. You must utilize the network aliases or the container names as defined in your orchestration file. It is elementary once you eliminate the impossible!"

๐Ÿ“œ License

This model is licensed under the Apache 2.0 license, following the base model.

Downloads last month
198
Safetensors
Model size
1B params
Tensor type
F16
ยท
U32
ยท
MLX
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for shabul/gemma-2-9b-sherlock-debugger

Adapter
(2)
this model

Dataset used to train shabul/gemma-2-9b-sherlock-debugger