Instructions to use ShyamSaran-18/Python-wizard-Llama-3.1-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ShyamSaran-18/Python-wizard-Llama-3.1-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ShyamSaran-18/Python-wizard-Llama-3.1-8b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ShyamSaran-18/Python-wizard-Llama-3.1-8b") model = AutoModelForCausalLM.from_pretrained("ShyamSaran-18/Python-wizard-Llama-3.1-8b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ShyamSaran-18/Python-wizard-Llama-3.1-8b with 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 ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M # Run inference directly in the terminal: llama cli -hf ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M # Run inference directly in the terminal: llama cli -hf ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M
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 ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M
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 ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M
Use Docker
docker model run hf.co/ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ShyamSaran-18/Python-wizard-Llama-3.1-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ShyamSaran-18/Python-wizard-Llama-3.1-8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShyamSaran-18/Python-wizard-Llama-3.1-8b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M
- SGLang
How to use ShyamSaran-18/Python-wizard-Llama-3.1-8b 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 "ShyamSaran-18/Python-wizard-Llama-3.1-8b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShyamSaran-18/Python-wizard-Llama-3.1-8b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "ShyamSaran-18/Python-wizard-Llama-3.1-8b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShyamSaran-18/Python-wizard-Llama-3.1-8b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use ShyamSaran-18/Python-wizard-Llama-3.1-8b with Ollama:
ollama run hf.co/ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M
- Unsloth Studio
How to use ShyamSaran-18/Python-wizard-Llama-3.1-8b 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 ShyamSaran-18/Python-wizard-Llama-3.1-8b 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 ShyamSaran-18/Python-wizard-Llama-3.1-8b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ShyamSaran-18/Python-wizard-Llama-3.1-8b to start chatting
- Docker Model Runner
How to use ShyamSaran-18/Python-wizard-Llama-3.1-8b with Docker Model Runner:
docker model run hf.co/ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M
- Lemonade
How to use ShyamSaran-18/Python-wizard-Llama-3.1-8b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ShyamSaran-18/Python-wizard-Llama-3.1-8b:Q4_K_M
Run and chat with the model
lemonade run user.Python-wizard-Llama-3.1-8b-Q4_K_M
List all available models
lemonade list
- Atomic Chat
| language: | |
| - en | |
| license: llama3.1 | |
| license_name: llama3.1 | |
| license_link: https://huggingface.co/meta-llama/Llama-3.1-8B/blob/main/LICENSE | |
| base_model: meta-llama/Llama-3.1-8B | |
| tags: | |
| - llama | |
| - llama-3.1 | |
| - unsloth | |
| - lora | |
| - code-generation | |
| - python | |
| - gguf | |
| datasets: | |
| - flytech/python-codes-25k | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| # Python-wizard-Llama-3.1-8b | |
| A Python code-generation assistant fine-tuned from **Meta-Llama-3.1-8B** using LoRA, trained with [Unsloth](https://github.com/unslothai/unsloth), and exported to GGUF for local inference (Ollama / llama.cpp). | |
| Built with Llama. | |
| ## Model Details | |
| - **Base model:** [meta-llama/Llama-3.1-8B](https://huggingface.co/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`](https://huggingface.co/datasets/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 | |
| ```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 | |
| - [Meta AI](https://ai.meta.com/llama/) for the base Llama 3.1 model | |
| - [Unsloth](https://github.com/unslothai/unsloth) for efficient fine-tuning and GGUF export tooling | |
| - [flytech/python-codes-25k](https://huggingface.co/datasets/flytech/python-codes-25k) dataset authors |