Instructions to use ProfessorCastillo/SCB_Llama3_1_8b_q8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ProfessorCastillo/SCB_Llama3_1_8b_q8 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 ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0 # Run inference directly in the terminal: llama cli -hf ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0 # Run inference directly in the terminal: llama cli -hf ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0
Use Docker
docker model run hf.co/ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0
- Llama new
- LM Studio
- Jan
- Ollama
How to use ProfessorCastillo/SCB_Llama3_1_8b_q8 with Ollama:
ollama run hf.co/ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0
- Unsloth Desktop
- Docker Model Runner
How to use ProfessorCastillo/SCB_Llama3_1_8b_q8 with Docker Model Runner:
docker model run hf.co/ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0
- Lemonade
How to use ProfessorCastillo/SCB_Llama3_1_8b_q8 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ProfessorCastillo/SCB_Llama3_1_8b_q8:Q8_0
Run and chat with the model
lemonade run user.SCB_Llama3_1_8b_q8-Q8_0
List all available models
lemonade list
- Atomic Chat
Download handler.py from ProfessorCastillo/SCB_Llama3_1_8b_q8: direct link, hf CLI and curl.
- Browser
- Download file 1.71 kB
-
https://huggingface.co/ProfessorCastillo/SCB_Llama3_1_8b_q8/resolve/main/handler.py
- Command line
-
hf download hf://ProfessorCastillo/SCB_Llama3_1_8b_q8/handler.py
-
curl -L -o handler.py https://huggingface.co/ProfessorCastillo/SCB_Llama3_1_8b_q8/resolve/main/handler.py
1.71 kB
| import os | |
| from llama_cpp import Llama | |
| from typing import Dict, List, Any | |
| class EndpointHandler: | |
| def __init__(self, path=""): | |
| # Get the model path from the environment variable | |
| model_path = os.environ.get("GGUF_MODEL_PATH") | |
| if not model_path: | |
| # Fallback for local testing or if the env var is not set | |
| # IMPORTANT: Replace this with the actual name of your GGUF file | |
| model_name = "Llama3_1_SCB_FT_Q8_0.gguf" | |
| model_path = os.path.join(path, model_name) | |
| print(f"Loading GGUF model from: {model_path}") | |
| # Load the GGUF model from the path | |
| # n_gpu_layers=-1 means offload all possible layers to the GPU | |
| # n_ctx is the context window size | |
| self.llama = Llama( | |
| model_path=model_path, | |
| n_gpu_layers=-1, | |
| n_ctx=4096, | |
| verbose=True, | |
| ) | |
| def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]: | |
| """ | |
| Handles the inference request. | |
| """ | |
| # Get inputs from the payload | |
| inputs = data.pop("inputs", None) | |
| if inputs is None: | |
| return {"error": "No 'inputs' key found in the request payload."} | |
| # Get generation parameters from the payload, with default values | |
| max_new_tokens = data.pop("max_new_tokens", 256) | |
| temperature = data.pop("temperature", 0.7) | |
| top_p = data.pop("top_p", 0.95) | |
| # Run inference | |
| output = self.llama( | |
| inputs, | |
| max_tokens=max_new_tokens, | |
| temperature=temperature, | |
| top_p=top_p, | |
| echo=False, # Don't echo the prompt in the output | |
| ) | |
| return output | |