Instructions to use pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf", filename="codellama-7b-merged-Q4_K_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf: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 pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf: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 pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M
Use Docker
docker model run hf.co/pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf with Ollama:
ollama run hf.co/pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M
- Unsloth Studio new
How to use pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf 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 pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf 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 pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf to start chatting
- Docker Model Runner
How to use pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf with Docker Model Runner:
docker model run hf.co/pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M
- Lemonade
How to use pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Q4_K_M
Run and chat with the model
lemonade run user.codellama-7b-python-ai-assistant-full-gguf-Q4_K_M
List all available models
lemonade list
How to use from
llama.cppInstall from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:# Run inference directly in the terminal:
llama-cli -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf: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 pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:# Run inference directly in the terminal:
./llama-cli -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf: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 pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:# Run inference directly in the terminal:
./build/bin/llama-cli -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Use Docker
docker model run hf.co/pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:Quick Links
CodeLlama 7B Python AI Assistant (Merged GGUF)
This is a merged version of the QLoRA fine-tuned CodeLlama-7B model. The LoRA weights have been merged with the base model and converted to GGUF format for easy deployment.
Model Details
- Base Model: CodeLlama-7b-hf
- Original LoRA Adapter: pranav-pvnn/codellama-7b-python-ai-assistant
- Fine-tuning Method: QLoRA (4-bit quantization with LoRA)
- Format: GGUF (self-contained, no separate adapter needed)
- Training Framework: Unsloth
Available Quantizations
codellama-7b-merged-f16.gguf- Full precision (FP16) - ~13 GBcodellama-7b-merged-Q4_K_M.gguf- 4-bit quantization (recommended) - ~4 GBcodellama-7b-merged-Q5_K_M.gguf- 5-bit quantization (higher quality) - ~5 GBcodellama-7b-merged-Q8_0.gguf- 8-bit quantization (highest quality) - ~7 GB
Usage
With llama.cpp:
./llama-cli -m codellama-7b-merged-Q4_K_M.gguf -p "### Instruction:\nWrite a Python function to calculate factorial.\n### Response:\n"
With Python (llama-cpp-python):
from llama_cpp import Llama
llm = Llama(model_path="codellama-7b-merged-Q4_K_M.gguf")
prompt = "### Instruction:\nWrite a Python function to calculate factorial.\n### Response:\n"
output = llm(prompt, max_tokens=256)
print(output['choices'][0]['text'])
With Ollama:
- Create a Modelfile:
FROM ./codellama-7b-merged-Q4_K_M.gguf
- Create the model:
ollama create my-codellama -f Modelfile
ollama run my-codellama "Write a Python function to sort a list"
Training Details
- Quantization: 4-bit QLoRA
- LoRA Rank: 64
- Learning Rate: 2e-4
- Epochs: 4
- Max Seq Length: 2048
- Training Data: Custom Python programming examples (~2,000 examples)
- GPU: NVIDIA Tesla T4
Prompt Format
### Instruction:
[Your instruction here]
### Response:
License
Same as base model (Llama 2 license)
Acknowledgements
- Base Model: Meta's CodeLlama
- Training Framework: Unsloth
- Downloads last month
- 18
Hardware compatibility
Log In to add your hardware
4-bit
5-bit
8-bit
16-bit
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf
Base model
codellama/CodeLlama-7b-hf
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf:# Run inference directly in the terminal: llama-cli -hf pranav-pvnn/codellama-7b-python-ai-assistant-full-gguf: