Instructions to use whoami02/defog-sqlcoder-2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use whoami02/defog-sqlcoder-2-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="whoami02/defog-sqlcoder-2-GGUF", filename="sqlcoder-7b-2.q8_0.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 whoami02/defog-sqlcoder-2-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf whoami02/defog-sqlcoder-2-GGUF:Q8_0 # Run inference directly in the terminal: llama-cli -hf whoami02/defog-sqlcoder-2-GGUF:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf whoami02/defog-sqlcoder-2-GGUF:Q8_0 # Run inference directly in the terminal: llama-cli -hf whoami02/defog-sqlcoder-2-GGUF:Q8_0
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 whoami02/defog-sqlcoder-2-GGUF:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf whoami02/defog-sqlcoder-2-GGUF:Q8_0
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 whoami02/defog-sqlcoder-2-GGUF:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf whoami02/defog-sqlcoder-2-GGUF:Q8_0
Use Docker
docker model run hf.co/whoami02/defog-sqlcoder-2-GGUF:Q8_0
- LM Studio
- Jan
- vLLM
How to use whoami02/defog-sqlcoder-2-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "whoami02/defog-sqlcoder-2-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "whoami02/defog-sqlcoder-2-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/whoami02/defog-sqlcoder-2-GGUF:Q8_0
- Ollama
How to use whoami02/defog-sqlcoder-2-GGUF with Ollama:
ollama run hf.co/whoami02/defog-sqlcoder-2-GGUF:Q8_0
- Unsloth Studio new
How to use whoami02/defog-sqlcoder-2-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 whoami02/defog-sqlcoder-2-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 whoami02/defog-sqlcoder-2-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for whoami02/defog-sqlcoder-2-GGUF to start chatting
- Docker Model Runner
How to use whoami02/defog-sqlcoder-2-GGUF with Docker Model Runner:
docker model run hf.co/whoami02/defog-sqlcoder-2-GGUF:Q8_0
- Lemonade
How to use whoami02/defog-sqlcoder-2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull whoami02/defog-sqlcoder-2-GGUF:Q8_0
Run and chat with the model
lemonade run user.defog-sqlcoder-2-GGUF-Q8_0
List all available models
lemonade list
output = llm(
"Once upon a time,",
max_tokens=512,
echo=True
)
print(output)Model Details
I do not claim ownership of this model.
It is converted into 8-bit GGUF format from original repository huggingface.co/defog/sqlcoder-7b-2
Model Description
Developed by: Defog AI
Model Sources
Repository: https://huggingface.co/defog/sqlcoder-7b-2
Example usage
With Llamacpp:
from langchain_community.llms. llamacpp import Llamacpp
from huggingface_hub import hf_hub_download
YOUR_MODEL_DIRECTORY = None
CONTEXT LENGHT = None
MAX TOKENS = None
BATCH SIZE = None
TEMPERATURE = None
GPU_OFFLOAD = None
def load_model (model_id, model_basename):
model_path = hf_hub_download (
repo_id=model_id,
filename=model_basename,
resume_download=True,
cache_dir="YOUR_MODEL_DIRECTORY",
)
kwargs = {
'model_path': model_path,
'n_ctx': CONTEXT_LENGHT,
'max_tokens': MAX_TOKENS,
'n_batch': BATCH_SIZE,
'n_gpu_layers': GPU_OFFLOAD,
'temperature': TEMPERATURE,
'verbose': True,
}
return LlamaCpp(**kwargs)
11m = load_model(
model_id="whoami02/defog-sqlcoder-2-GGUF",
model_basename="sqlcoder-7b-2.q8_0.gguf",
- Downloads last month
- 35
Hardware compatibility
Log In to add your hardware
8-bit
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="whoami02/defog-sqlcoder-2-GGUF", filename="sqlcoder-7b-2.q8_0.gguf", )