Instructions to use securelocalai/Llama-3.1-8B-SLAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use securelocalai/Llama-3.1-8B-SLAI with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="securelocalai/Llama-3.1-8B-SLAI", filename="Llama-3.1-8B-SLAI-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use securelocalai/Llama-3.1-8B-SLAI 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 securelocalai/Llama-3.1-8B-SLAI:Q4_K_M # Run inference directly in the terminal: llama cli -hf securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf securelocalai/Llama-3.1-8B-SLAI:Q4_K_M # Run inference directly in the terminal: llama cli -hf securelocalai/Llama-3.1-8B-SLAI: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 securelocalai/Llama-3.1-8B-SLAI:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf securelocalai/Llama-3.1-8B-SLAI: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 securelocalai/Llama-3.1-8B-SLAI:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
Use Docker
docker model run hf.co/securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use securelocalai/Llama-3.1-8B-SLAI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "securelocalai/Llama-3.1-8B-SLAI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "securelocalai/Llama-3.1-8B-SLAI", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
- Ollama
How to use securelocalai/Llama-3.1-8B-SLAI with Ollama:
ollama run hf.co/securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
- Unsloth Studio
How to use securelocalai/Llama-3.1-8B-SLAI 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 securelocalai/Llama-3.1-8B-SLAI 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 securelocalai/Llama-3.1-8B-SLAI to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for securelocalai/Llama-3.1-8B-SLAI to start chatting
- Pi
How to use securelocalai/Llama-3.1-8B-SLAI with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "securelocalai/Llama-3.1-8B-SLAI:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use securelocalai/Llama-3.1-8B-SLAI with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use securelocalai/Llama-3.1-8B-SLAI with Docker Model Runner:
docker model run hf.co/securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
- Lemonade
How to use securelocalai/Llama-3.1-8B-SLAI with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull securelocalai/Llama-3.1-8B-SLAI:Q4_K_M
Run and chat with the model
lemonade run user.Llama-3.1-8B-SLAI-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)Llama-3.1-8B-SLAI
A Llama 3.1 8B Instruct variant created by Secure Local AI, LLC. It is fine-tuned with corrective activation training: a small set of targeted examples derived from analyzing the base model's own benchmark failures, which bakes reasoning and output-format corrections into the weights so they no longer need to be supplied at inference time.
Built with Llama.
This is not a new foundation model. It is a derivative of Meta's Llama 3.1 8B Instruct. The "Llama-3.1" prefix identifies the lineage as required by Meta's license; the "SLAI" suffix identifies this specific variant as the work of Secure Local AI, LLC.
What it does
The base Llama 3.1 8B Instruct, queried with no few-shot examples, solves GSM8K at 63.00% (flexible-extract) and effectively never produces the required answer format (0.00% strict-match). Reaching ~80% normally requires roughly 20 in-context exemplars and a tuned system prompt โ thousands of input tokens on every query.
This variant attains comparable accuracy at zero-shot, with no in-context exemplars and no system-prompt scaffolding โ the corrective patterns are trained into the weights, so the activation cost is paid once at build time instead of on every request.
Results โ GSM8K (Q4_K_M, via Ollama / lm-eval-harness)
| Configuration | Few-shots | Flexible-extract | Strict-match |
|---|---|---|---|
| Base Llama 3.1 8B Instruct (chat template) | 0 | 63.00% | 0.00% |
| Base + tuned system prompt + exemplars | 20 | 80.59% | 79.23% |
| Llama-3.1-8B-SLAI (this model) | 0 | 79.61% | 78.54% |
The zero-shot result of this model substantially equals the base model's 20-shot activated result, at zero runtime token overhead. Strict-match rising from 0.00% to 78.54% reflects that both answer correctness and output-format compliance were trained in.
Numbers are for the Q4_K_M quantization on an 8B base; full-precision and other quantizations may differ. Independent re-evaluation is encouraged โ the published weight hash and training data below make it reproducible.
What the score represents
This number is a demonstration, not a leaderboard claim. The point is not that an 8B model reaches ~80% on GSM8K โ the base model already can, if you hand it roughly 20 worked examples inside every prompt, a cost paid on every single query. The point is where the capability lives: this variant carries it in the weights, so the same result comes at zero-shot, with no exemplars and no prompt scaffolding, at zero runtime token cost. The strict-match jump from 0.00% to 78.54% means the model also learned to produce the answer in the required format, not just compute it.
It also represents a floor, not a ceiling. No hyperparameters were tuned โ learning rate, LoRA rank, iteration count, and batch size were left at sensible defaults. The result came from ~22 corrective examples and a single training run. How much further additional corrective data, a corrected epoch schedule, or any tuning would move it is an open question under active study.
What is notable is the method, not the magnitude. The corrections were discovered by capturing the base model's actual benchmark failures, clustering the recurring mistakes, and generating a small dataset aimed precisely at them โ then training that into the weights once. The benchmark was used as a diagnostic, not a target. Developed and trained on consumer hardware.
Cross-domain integrity (no measured regression)
A fair concern with any targeted fine-tune is whether teaching the model one thing degrades it at others โ the catastrophic-forgetting / alignment-tax problem. To check, this model was evaluated against the base on a custom 100-question benchmark spanning five domains (legal hearsay, legal contracts, financial reasoning, Python coding, and coding algorithms โ 20 questions each). No degradation was observed in any domain relative to the base model. Financial reasoning showed a slight improvement. The corrective activation training improved the targeted math reasoning without coming at the expense of the model's general capabilities.
Intended use
Local, on-device reasoning where supplying long few-shot prompts on every query is impractical (memory- or latency-constrained hardware). Drop-in replacement for Llama 3.1 8B Instruct in any OpenAI-compatible local stack (Ollama, llama.cpp, vLLM, MLX).
Limitations
- Corrective training targeted a defined set of arithmetic/reasoning failure modes (frequency misreads, relational-direction inversion, wrong-base percentage errors, off-by-one boundaries, and related). Failure modes outside that set are unaffected.
- Trained and evaluated primarily on English math reasoning. A five-domain check (above) found no regression elsewhere and a slight gain in financial reasoning; broader positive cross-domain transfer โ whether a math correction repairs a previously-wrong answer in another domain โ is under separate study and is not claimed here.
- Inherits all limitations and the Acceptable Use constraints of the Llama 3.1 base model.
Training procedure
- Base:
meta-llama/Llama-3.1-8B-Instruct - Method: LoRA (rank 8, ~16 layers), best checkpoint selected by validation
- Data: ~22 synthetic corrective examples (
train.jsonl, released alongside this model). These are newly authored problems demonstrating the reasoning pattern the base model fails on, annotated with explicit verification steps โ not GSM8K test items. Validation used held-out GSM8K questions the base model answered incorrectly. - Pipeline: base benchmark run โ capture full per-instance outputs (not just the score) โ LLM-assisted clustering of failure modes โ automated generation of corrective examples targeting those clusters โ LoRA fine-tune โ re-evaluate.
The corrective-activation methodology is the subject of a provisional patent (see below).
Provenance & authorship
- Author / distributor: Secure Local AI, LLC
- Release artifact SHA256:
9d0afaa4be7d5d2bd0bd527dc9082b7384826af3be1318d32c0b175925de67a6 - Internal GGUF metadata:
general.name = Llama-3.1-8B-SLAI - Released:
<06-11-2026>
To confirm an artifact is the authentic release, verify its SHA256 against the value above. The internal GGUF general.name field identifies this model independently of its filename.
License & attribution
This model is a derivative of Meta Llama 3.1 and is distributed under the Llama 3.1 Community License Agreement (the base model's license), a copy of which is included with these materials.
Notice:
Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright ยฉ Meta Platforms, Inc. All Rights Reserved.
Use of this model must comply with the Llama 3.1 Community License and the Llama 3.1 Acceptable Use Policy. "Llama" is a trademark of Meta Platforms, Inc.; no Meta trademark rights are granted beyond the limited use required for license compliance.
Additional terms on the Secure Local AI contribution. The corrective training data, model card, and the corrective-activation method embodied in this variant are the work of Secure Local AI, LLC. This release is free for personal and research use; commercial use of the corrective-activation method requires a separate license from Secure Local AI, LLC. These additional terms apply only to Secure Local AI's contribution and do not restrict any rights granted by Meta in the underlying Llama 3.1 base model.
(The interaction of these layered terms should be confirmed with IP counsel before release.)
Patent notice
The training methodology used to create this model โ capturing full benchmark outputs, analyzing failures with a language model, automatically generating corrective training data, and training the correction into the weights โ is covered by a provisional patent application filed by Secure Local AI, LLC. Patent pending.
Citation
@misc{slai_llama31_8b,
title = {Llama-3.1-8B-SLAI: Corrective Activation Training for Local Language Models},
author = {Secure Local AI, LLC},
year = {2026},
note = {Patent pending. Built with Llama. Derivative of Meta Llama 3.1 8B Instruct.},
url = https://huggingface.co/securelocalai/Llama-3.1-8B-SLAI
}
Contact
Secure Local AI, LLC โ contact@securelocal.ai
- Downloads last month
- 200
4-bit
Model tree for securelocalai/Llama-3.1-8B-SLAI
Base model
meta-llama/Llama-3.1-8B
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="securelocalai/Llama-3.1-8B-SLAI", filename="Llama-3.1-8B-SLAI-Q4_K_M.gguf", )