Python-wizard-Llama-3.1-8b

A Python code-generation assistant fine-tuned from Meta-Llama-3.1-8B using LoRA, trained with Unsloth, and exported to GGUF for local inference (Ollama / llama.cpp).

Built with Llama.

Model Details

  • Base model: meta-llama/Llama-3.1-8B
  • Fine-tuning method: LoRA (Low-Rank Adaptation), via Unsloth
  • Quantized base: unsloth/Meta-Llama-3.1-8B-bnb-4bit (4-bit) used during training
  • Task: Instruction-following Python code generation
  • Export format: GGUF, quantized Q4_K_M (~4.92 GB)
  • Language: English

Training Data

Fine-tuned on flytech/python-codes-25k, a dataset of instruction/input/output triples for Python code generation tasks.

Prompt format used during training:

Below is an instruction that describes a task, paired with an optional introductory context. Write a response that appropriately completes the request with clean Python code.

### Instruction:
{instruction}

### Context:
{input}

### Response:
{output}

Training Configuration

Parameter Value
LoRA rank (r) 16
LoRA alpha 16
LoRA dropout 0
Target modules q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Bias none
Max sequence length 2048
Quantization (training) 4-bit
Gradient checkpointing Unsloth (optimized)
Random seed 3407

Note: this checkpoint was trained for a limited number of steps (checkpoint-60). Treat outputs as a proof-of-concept rather than a fully converged model — see Limitations below.

Usage

With Ollama

ollama run hf.co/ShyamSaran-18/Python-wizard-Llama-3.1-8b

With llama.cpp

llama-cli -hf ShyamSaran-18/Python-wizard-Llama-3.1-8b --jinja

With transformers + PEFT (LoRA adapter, if published separately)

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B")
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B")
model = PeftModel.from_pretrained(base, "ShyamSaran-18/Python-wizard-Llama-3.1-8b")

Intended Use

Generating Python code snippets and completions from natural-language instructions. Intended for experimentation, learning, and portfolio demonstration of LoRA fine-tuning and local LLM deployment workflows.

Limitations

  • Trained on a single open dataset with a limited number of training steps; not benchmarked against held-out evaluation data.
  • Inherits the general limitations and biases of the base Llama 3.1 model.
  • Generated code should be reviewed before use — no guarantees of correctness, security, or production-readiness.
  • Not evaluated for languages other than Python or for tasks outside code generation.

License

This model is a fine-tuned derivative of Meta's Llama 3.1 and is distributed under the Llama 3.1 Community License.

By using this model you agree to the terms of the Llama 3.1 Community License Agreement. Use of this model must also comply with Meta's Acceptable Use Policy.

Notice: Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.

Acknowledgements

Downloads last month
70
GGUF
Model size
8B params
Architecture
llama
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 ShyamSaran-18/Python-wizard-Llama-3.1-8b

Adapter
(957)
this model

Dataset used to train ShyamSaran-18/Python-wizard-Llama-3.1-8b