How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf xenonshare/NanoMend-1.5-Ultimate
# Run inference directly in the terminal:
llama cli -hf xenonshare/NanoMend-1.5-Ultimate
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf xenonshare/NanoMend-1.5-Ultimate
# Run inference directly in the terminal:
llama cli -hf xenonshare/NanoMend-1.5-Ultimate
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 xenonshare/NanoMend-1.5-Ultimate
# Run inference directly in the terminal:
./llama-cli -hf xenonshare/NanoMend-1.5-Ultimate
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 xenonshare/NanoMend-1.5-Ultimate
# Run inference directly in the terminal:
./build/bin/llama-cli -hf xenonshare/NanoMend-1.5-Ultimate
Use Docker
docker model run hf.co/xenonshare/NanoMend-1.5-Ultimate
Quick Links

πŸ› οΈ NanoMend 1.5 Ultimate (GGUF)

NanoMend-1.5-Ultimate is a fine-tuned, CPU-optimized 1.5B parameter language model specialized in Python AST-aware logic trap detection, code repair, and performance optimization.

Engineered specifically for local, privacy-first developer tooling (such as VS Code extensions), it pairs deterministically with AST parsers to diagnose infinite loops, resource leaks, semantic intent errors, O(NΒ²) performance issues, and static index errors without sending code to cloud APIs.


🌟 Key Features

  • Quantization: CPU-friendly GGUF quantization format (llama.cpp compatible).
  • Prompt Format: ChatML (<|im_start|>system...)
  • Context Length: 2048 tokens
  • Specialization: Python Code Repair, AST Trap Resolution, Performance Refactoring.
  • Privacy: 100% offline, zero external telemetry.

⚑ Quickstart Usage (Python / llama-cpp-python)

You can run NanoMend-1.5-Ultimate locally using Python in just a few lines:

pip install llama-cpp-python huggingface_hub
from huggingface_hub import hf_hub_download
from llama_cpp import Llama

# 1. Download model from Hugging Face Hub
model_path = hf_hub_download(
    repo_id="xenonshare/NanoMend-1.5-Ultimate",
    filename="nanomend-ultimate-1.5b.gguf"
)

# 2. Load model into CPU memory
llm = Llama(
    model_path=model_path,
    n_ctx=2048,
    n_threads=8,
    verbose=False
)

# 3. Format Prompt (ChatML Format)
system_prompt = "You are a Senior Python Developer. The user's code has a CRITICAL error: INTENT ERROR. Function 'add' implies addition but uses multiplication (*). Rewrite the code to fix this. Output ONLY the fixed python code."
code_snippet = """def add(a, b):
    return a * b
"""

prompt = f"<|im_start|>system\n{system_prompt}<|im_end|>\n<|im_start|>user\n{code_snippet}<|im_end|>\n<|im_start|>assistant\n"

# 4. Generate Repair
output = llm(
    prompt,
    max_tokens=256,
    stop=["<|im_end|>"],
    temperature=0.1
)

print(output['choices'][0]['text'])

πŸ’¬ Prompt Template

NanoMend uses the standard ChatML format:

<|im_start|>system
You are a Senior Python Developer. The user's code has a CRITICAL error: {AST_WARNING}. Rewrite the code to fix this. Output ONLY the fixed python code.<|im_end|>
<|im_start|>user
{PYTHON_CODE}<|im_end|>
<|im_start|>assistant

πŸ¦™ Running with Ollama

You can import this model into Ollama by creating a Modelfile:

FROM ./nanomend-ultimate-1.5b.gguf

TEMPLATE """<|im_start|>system
{{ .System }}<|im_end|>
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""

PARAMETER stop "<|im_end|>"
PARAMETER temperature 0.1

Run in terminal:

ollama create nanomend -f Modelfile
ollama run nanomend "Fix this loop: while x > 0: print(x)"

πŸ“‹ Evaluation & Scope

NanoMend-1.5-Ultimate is fine-tuned to resolve the 12 primary Python logic traps:

  1. Infinite Loops (Unmutated control variables)
  2. Type Safety Mismatches
  3. Resource Leaks (open() without with or .close())
  4. Security Risks (Hardcoded credentials)
  5. $O(N^2)$ Nested Loops to $O(N)$ Hash Lookups
  6. Semantic Intent (e.g. multiply using +, is_even returning odd)
  7. Void Function Assignment (return None)
  8. Index Out of Bounds
  9. Off-by-one average calculations

πŸ“„ License

MIT License. Free for commercial and open-source use.

Downloads last month
34
GGUF
Model size
2B params
Architecture
qwen2
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

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

Model tree for xenonshare/NanoMend-1.5-Ultimate

Quantized
(246)
this model