Team Ai
Modelpublic

ShyamSaran-18/Python-wizard-Llama-3.1-8b

sourceHugging Facellama3.1updated 2mo agoView on Hugging Face
0likes316downloads
Model Card

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

ParameterValue
LoRA rank (r)16
LoRA alpha16
LoRA dropout0
Target modulesqproj, kproj, vproj, oproj, gateproj, upproj, down_proj
Biasnone
Max sequence length2048
Quantization (training)4-bit
Gradient checkpointingUnsloth (optimized)
Random seed3407
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

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

With llama.cpp

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

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

python
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.

  • —License text: https://huggingface.co/meta-llama/Llama-3.1-8B/blob/main/LICENSE
  • —Acceptable Use Policy: https://llama.meta.com/llama3_1/use-policy

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