Why run Onion AI with a local LLM
Analysts want Onion AI help with alert triage and investigation, but a security or compliance team will not accept event data leaving the network. A local OpenAI-compatible model keeps prompts inside your infrastructure, because Onion AI sends requests to an endpoint you host rather than to a hosted provider. The trade-off is that you take on the hardware, the model quality and the operations work that a hosted service would otherwise carry for you.
Onion AI is a feature of Security Onion Pro, so the licensing and the console setup come first, and the local model is an additional decision on top of that. Onion AI can point at any OpenAI-compatible endpoint, and the Security Onion docs recommend a context window of at least 128k tokens. That window size matters because investigation prompts carry alert details, event fields and case history, and a small window forces the assistant to drop context that an analyst may need. Confirm with your Security Onion representative which Pro version and which Onion AI configuration your grid supports before you size anything.
Treat the model as a production service from day one. Plan who patches the inference server, who rotates its API key, how TLS is terminated, and where request logs are kept, since those logs may hold the same sensitive event data you are trying to protect. Your compliance team will ask how the model is governed, so document the model source, its license, and the change process before the first analyst relies on it. Ask the Security Onion team and your hardware vendor to confirm the memory and accelerator requirements for the specific model you choose, because the tested models in the docs need substantial GPU memory.
How Onion AI requests reach a local model
The request starts with an analyst asking a question in the Security Onion Console, which hands it to Onion AI. Onion AI calls an OpenAI-compatible endpoint, such as llama-server, that runs on a GPU host inside your network, so the prompt and events stay within that boundary. Check where API key authentication and TLS are enforced on the hop between Onion AI and the endpoint, and confirm that the hosted-model path is disabled if prompts must never leave the network.
Onion AI requests stay inside the network when a local endpoint is configured.
Which model hosting path fits your environment
A hosted endpoint is any OpenAI-compatible service run by a provider outside your infrastructure. Onion AI can call it, so the Security Onion side of the setup stays the same, but prompts and the event data included in them leave your network and are processed under the provider's terms. Your hardware bill is small, and the provider runs the model, scaling and patching. The work moves to contracts, data handling reviews and usage monitoring.
- Data residency: Prompts, retrieved events and conversation content are sent to the provider. Confirm where data is processed, retained and used for training, and whether a contract covers those points.
- Memory needs: None on your side. The provider's hardware carries the load, so VRAM figures from the local paths do not apply.
- Model availability: Model names, context windows and versions change at the provider. Confirm the current model list and the context length you can actually use before you rely on it.
- Operating load: Low for infrastructure, but you still manage API keys, spending limits, outages and changes the provider makes to a model.
- Cost pattern: Usage is typically billed per request or per token, so cost grows with analyst activity. Ask for a quote that states the billing unit and any minimum commitment.
Before choosing this path, check whether your data rules allow security event content to leave the network at all.
A local model on a large NVIDIA or AMD GPU host keeps inference inside your network. Security Onion calls a llama.cpp or other OpenAI-compatible server on hardware you run, so prompts and event data stay in your environment. The docs list GPT OSS 120B, Kimi 2.5, GLM 5 and Qwen 3.5 as tested models and note that the larger ones need at least 96 GB of VRAM. Those figures set the minimum hardware class for this path.
- Data residency: Prompts and results stay on hosts you control, which makes this path easier to document for internal and external reviews.
- Memory needs: The docs state at least 96 GB of VRAM for the larger tested models. Smaller models may fit on less, but test the exact model and context size you plan to use.
- Tested models: Use the names listed in the Onion AI docs. Confirm the current list, since tested models change over time.
- Operating load: You own driver and GPU runtime updates, model file storage, capacity planning, monitoring, and restarts after failures.
- Hardware cost: The GPU host is a one-time purchase or lease, plus power, cooling and rack space. Ask any integrator for a quote that separates hardware, installation and support.
Confirm that the chosen GPU and driver stack is supported by your llama.cpp build before you buy the hardware.
A unified-memory system, such as the AMD Strix Halo reference build in the Security Onion local LLM guide, shares one memory pool between the CPU and GPU. The guide uses 128 GB of unified memory with ROCm and the Gemma 4 26B A4B model, recommending Unsloth's Q8_0 GGUF build of 26.9 GB. This path keeps data local at a lower hardware footprint than a multi-GPU server, but the model and context choices must fit the memory you have.
- Data residency: Same as a GPU host. Inference and prompts stay inside your network on a machine you control.
- Memory needs: The reference build pairs 128 GB of unified memory with a 26.9 GB quantized model file. The 96 GB VRAM figure in the docs applies to the larger tested models, so a smaller model with a more modest footprint may suit a system like this.
- Tested models: The local LLM guide uses Gemma 4 26B A4B. Other models in the Onion AI list may not be validated on this hardware, so confirm each one before use.
- Operating load: Lower hardware count and simpler rack footprint, but you still manage ROCm versions, model file updates and llama.cpp builds.
- Platform fit: The guide targets AMD hardware with ROCm. Confirm support for your exact system before you buy it.
Check the exact model, quantization and context length against the memory you have, and test response quality on your own event data.
Choosing a context window and a tested model
Start with the context window, because it sets the floor for the model you can use. The Onion AI documentation recommends at least a 128k token context window. Onion AI sends the material an analyst asks about (alert details, event results, case notes and tool output) to the model in one request, so a short window forces you to trim that material and can cut answers off mid-investigation. The documentation lists GPT OSS 120B, Kimi 2.5, GLM 5 and Qwen 3.5 as tested models and notes that the larger ones need at least 96 GB of VRAM. Treat that figure as a minimum for the model weights and cache, then confirm the exact memory your chosen build needs with the model publisher and the Onion AI docs before you buy hardware.
Quantization and context length compete for the same memory. A lower-bit quantized build of a model uses less memory and leaves more room for a long context, but it can lose accuracy on the tasks where precision matters most, such as reading a Suricata signature, reasoning about a Zeek connection log or keeping track of IP addresses across a long answer. Llama.cpp supports quantization from 1.5-bit to 8-bit integer formats, and the Security Onion local LLM guide uses Unsloth's Q8_0 build of Gemma 4 26B A4B, which is a higher-precision choice that trades memory for quality. Longer contexts also slow each response and use more memory for the key-value cache as conversations grow, so set a context size you can actually sustain for concurrent analysts, not only for a single test prompt.
Validate the model against your own work before rollout. Build a short test set from the questions your analysts ask: alert triage summaries, OQL-style hunt questions, case summaries and questions about detections that already fired in your environment. Score each answer against the source events, record latency and memory use at the context size you plan to run, and repeat the test with the quantization you intend to deploy. Re-run the same set whenever you change the model, the quantization, the context size or the llama.cpp build, because each change can alter answer quality. Keep the results with your change records so your security and compliance reviewers can see how the model was chosen.
How to set up a local model for Onion AI
This sequence takes you from hardware and GPU checks through a llama.cpp endpoint with authentication and TLS, ending with Onion AI pointed at a model that stays on your internal network.
Confirm hardware and Pro licensing
Confirm that the host runs on x86-64, which is the only processor architecture Security Onion supports, and that you have enough GPU VRAM or unified memory for the model size and context window you plan to use. The Onion AI docs recommend at least a 128k token context window and note that the larger tested models need at least 96 GB of VRAM. Confirm that your Security Onion deployment holds a Security Onion Pro license, because Onion AI is a Pro feature and the local model setup does not work without it. Check: you have a written list of the GPU, memory, OS and license facts, and each one matches the requirement before you move on.
Install the GPU compute stack
Install the ROCm stack for AMD hardware or the CUDA stack for NVIDIA hardware, matching the backend you will build llama.cpp against. The Security Onion local LLM guide uses an AMD Strix Halo system with 128 GB unified memory and ROCm, so an AMD build is the reference path. Confirm the vendor driver and compute runtime versions against the vendor's own compatibility matrix for your kernel and distribution, because those versions are not set by this page. Check: the vendor's detection tool lists the GPU, and a small test workload runs on it without errors.
Build llama.cpp and obtain a GGUF model
Build llama-server from the ggml-org llama.cpp repository (MIT licensed) with the backend that matches your GPU, such as HIP for AMD or CUDA for NVIDIA. llama.cpp publishes numbered builds continuously, so record the build tag you compile so you can reproduce it during upgrades. Download a GGUF model file from a source you trust and verify its checksum against the publisher's listing. The Security Onion reference build uses Unsloth's Q8_0 GGUF build of Gemma 4 26B A4B, which is 26.9 GB. Check: the build finishes, the binary reports its version, and the model file's checksum matches the publisher's value.
Start llama-server with the chosen context size
Start llama-server with the model path and a context size of at least 128k tokens to match the Onion AI guidance, and bind it to the internal address of the host rather than all interfaces. Confirm the GPU offload settings with the build's startup log, which shows how many layers went to the GPU and what memory the model used. Check: the server log reports the model loaded and the context size you set, and a request to the local health endpoint returns a successful response.
Enable API key authentication and TLS
Require API key authentication by starting llama-server with --api-key or an API key file, and enable TLS by pointing it at a PEM certificate and key file issued by your internal certificate authority. Store the key file with restricted permissions and keep it out of shell history and configuration shared with other teams. Do not enable the optional Prometheus-compatible metrics endpoint until you have decided who can read it. Check: a request without the key is rejected, a request with the key succeeds over HTTPS, and the certificate chain validates from a Security Onion node.
Point Onion AI at the OpenAI-compatible endpoint
In the Security Onion Console, configure Onion AI to use an OpenAI-compatible endpoint, entering the HTTPS base URL of your llama-server host and the API key you created. Use the internal address and the port you bound in the earlier step, and confirm the model name the console sends matches what the server reports. The exact settings screen depends on your Security Onion version, so confirm the field names in the Onion AI docs for your release. Check: the console saves the configuration without a connection error and the test connection reports success.
Verify with a test prompt and traffic checks
Send a test prompt through Onion AI that asks a question answerable from a known alert or event in your grid, and confirm the response is relevant and the model is the one you loaded. Then check where the traffic goes: on the Security Onion node and the llama-server host, confirm that connections to the model endpoint use the internal address only and that no outbound connection to a hosted model provider is configured. Record the results with the build tag, model file checksum and certificate details so an auditor or reviewer can repeat the check. Check: the test prompt returns a relevant answer, and the network capture or connection listing shows the model traffic staying on the internal network.
Securing the local endpoint and prompt data
A local model server keeps prompts off hosted services, but it also becomes a network service that holds sensitive investigation context. The cards below cover the llama-server settings and host controls you must decide on and confirm before Onion AI sends its first prompt.
API key handling
Onion AI authenticates to llama-server with a key, and llama-server can require one through the --api-key flag or an API key file. Decide which method your team can rotate and audit, keep the key out of shell history and general configuration files, and confirm how the Onion AI settings store it. Test that an unauthenticated request to the model endpoint is rejected before you rely on it.
TLS with PEM certificate and key files
llama-server can serve HTTPS using PEM certificate and key files. Decide whether traffic between the Security Onion console and the model host crosses only a segment you control or a routed network, and issue a certificate that matches the hostname Onion AI uses. Confirm that the Onion AI client trusts your internal certificate authority, and plan how the key file is permissioned and renewed.
Firewall rules for Security Onion nodes
Limit inbound access to the model port so only the Security Onion nodes that run Onion AI can connect. Identify which manager or console address makes the request, block all other sources, and keep administrative access to the model host on a separate path. Verify the rules from a node that should be denied, because a reachable endpoint with a leaked key is the most direct exposure.
Metrics exposure through --metrics
The optional --metrics flag exposes a Prometheus-compatible endpoint. Metrics can reveal request volume, timing and model activity, so decide whether your monitoring stack needs it at all. If you enable it, restrict it to your monitoring server and confirm whether it sits behind the same API key and firewall controls as the inference routes before the model goes live.
Log and prompt retention on the model host
Prompts contain alert details, hostnames, IP addresses and case notes, so the model host's logs and any saved conversation data are sensitive records. Ask your team which logs llama-server writes on your build, where they go, who can read them and how long they are kept. Set a retention period in writing, confirm that deleted logs are removed from backups, and check that the host's disk encryption covers them.
Common questions about a local LLM for Onion AI
What does it cost to run Onion AI with a local LLM?
Cost comes from three places: the hardware that runs the model, the labor to plan, install and test it, and the ongoing work to keep it running. Hardware is usually the largest one-time item, and the Onion AI docs note that the larger tested models need at least 96 GB of VRAM, so memory capacity drives the price more than anything else. Recurring costs include power, support and retesting after model changes. Ask any partner for a quote that separates hardware, implementation labor, and retainer or support fees, and that states which model and context window the quote assumes.
How long does a local LLM deployment for Onion AI take?
Duration depends mostly on hardware availability and internal approvals, not on the install commands themselves. Delivery time can be set by how long servers, GPUs or unified-memory systems take to arrive, and by security review of the model source, the inference server and the network path. Model download size also matters: the reference build in the Security Onion local LLM guide is a 26.9 GB Q8_0 GGUF file. Ask for a written timeline that lists hardware lead time, the approval steps you need, and the testing window before the model goes into use.
What must our team provide before a local LLM deployment starts?
Your team typically provides the hardware or cloud accounts, network placement, the Security Onion grid and its console access, identity settings for any SSO or API access, and a named owner who can approve model choices. You also need to decide the context window you require, which the Onion AI docs recommend at least 128k tokens, and who is allowed to use the assistant. Confirm these inputs in the written scope so that hardware, access and approvals are not discovered late.
Can our internal team run a local LLM for Onion AI without a partner?
Yes, if your team has Linux administration experience, has GPU or accelerator operations skills, and can test model behavior against security tasks. The inference server, llama.cpp, is MIT licensed and exposes an OpenAI-compatible API, so the integration itself is not unusual. The harder work is sizing memory for the model you pick, configuring API keys and TLS, keeping logs, and retesting after updates. Teams with limited GPU or security review capacity often bring in a partner for planning and hardening, then operate the system themselves.
What happens if the local model is weaker than a hosted model?
A smaller local model may answer less accurately, follow long instructions less reliably, or handle long event histories less well than a hosted frontier model. The tested models listed in the Onion AI docs include larger models that need at least 96 GB of VRAM, so the capability you get depends on the memory you buy. Plan for this trade-off by defining the tasks the assistant must perform, testing those tasks on your own events before rollout, and keeping analysts responsible for final decisions. Confirm with the model's documentation how it performs on the tool calls you plan to use.
How are model updates handled for a local LLM?
Model updates are a planned change, not an automatic one. A new model file or a new llama.cpp build can change output quality, memory use or API behavior, so each update should be tested against a fixed set of analyst prompts before it replaces the current version. llama.cpp publishes numbered builds frequently, so pin the build you tested and record the model file hash. Ask a partner for a written update process that covers testing, rollback, and who approves a change, and confirm how the Security Onion release you run interacts with the assistant.
Does keeping prompts local protect the data sent to the model?
Running the model inside your network keeps prompts and event data within infrastructure you control, but it does not by itself secure the service. The llama-server documentation describes API key authentication, TLS through certificate files, and an optional metrics endpoint, and each of these must be enabled and restricted on purpose. Limit which hosts can reach the endpoint, log access, and review what the assistant is allowed to query. Ask for a review of these settings as part of the scope.
Limits to confirm before you commit
Each check guards a different point of failure in a self-hosted Onion AI setup: the inference engine build, the model's terms and tested status, the Onion AI integration, and the memory left for your context window. Clear all four before you buy hardware or let analysts rely on the assistant for investigations.
Pin the llama.cpp build
llama.cpp publishes numbered builds continuously, so the release page lists new builds often. Record the exact build tag you deploy, the backend you compiled for (ROCm, CUDA, Vulkan or Metal), and the binary or container image digest. Rerun your chat, streaming and tool-calling tests after every upgrade, because a newer build can change how a model's output or function calls behave. Keep the llama-server flags, the API key file and the TLS settings in version control alongside the build.
llama.cpp releasesConfirm model license and tested status
The inference engine and the model carry separate licenses. llama.cpp is MIT licensed, but each GGUF model file carries terms set by its publisher, so read the model card before you pull it into your environment. Check whether your chosen model appears in Security Onion's tested list, which names GPT OSS 120B, Kimi 2.5, GLM 5 and Qwen 3.5, and confirm that the quantized file you plan to run matches the build that was tested. Ask your legal team to approve those terms before production use.
Onion AI docsMatch the Onion AI version to your endpoint
Onion AI accepts any OpenAI-compatible endpoint, but the supported behavior depends on the Security Onion release you run. Confirm in the Onion AI documentation that your version supports a local OpenAI-compatible endpoint, and check which API routes it calls so they match what llama-server exposes. Then test a full assistant session, including tool calls that query events, cases and detections, before analysts depend on it. Onion AI is part of Security Onion Pro, so confirm your license covers the feature.
Security Onion ProPlan memory for the context window
Security Onion recommends a context window of at least 128k tokens, and its larger tested models need a substantial VRAM floor. Memory use depends on the model file, the quantization level and the context length you configure, so the file size alone understates what you need. Ask for measured usage at your target context length and parallel request count, since llama-server serves several users at once. Leave headroom for the operating system, the Security Onion services and concurrent analyst sessions.
Local LLM guideThe trade-off against hosted models
The local path buys control over where prompts and event data go. When Onion AI points at an OpenAI-compatible endpoint on your own GPU host, alert details, case notes and query results stay inside your network, and your team can review the model host like any other system holding sensitive data. The costs are real and mostly fall on your side: the GPU host and its memory, the power and cooling, the people who patch the inference server and the operating system, and the time spent re-validating answers after a model change. Each of these recurs for as long as the assistant runs, so the comparison with a hosted subscription should be made over the full operating life, not the purchase date.
The local path also gives up quality headroom and update speed. The Onion AI docs list GPT OSS 120B, Kimi 2.5, GLM 5 and Qwen 3.5 as tested models and note that the larger ones need at least 96 GB of VRAM, so the models you can run on modest hardware will often answer less well on hard triage or long investigative chains than the largest hosted models. Do not assume parity. Ask your SOC to run a set of their own past investigations against the candidate model and score the answers, and confirm the current model list in the Onion AI docs before buying hardware. New model releases also reach you on your schedule, which is slower but gives you a chance to test each change before analysts use it.
Whether this trade-off is worth it depends on three things: the classification of the data the assistant will see, the SOC's tolerance for variation in answers between model versions, and who will operate the GPU host. If your alerts and cases fall under handling rules that forbid third-party processing, the local path may be the only option. If the data can leave your boundary under your existing contracts and the team cannot staff GPU operations, a hosted or gateway option may serve better. Settle these questions in writing before the build, and record which model version each analyst used when reviewing an assistant-supported decision.
How DeployOpen scopes and delivers a local Onion AI model
DeployOpen plans, builds and documents self-hosted Security Onion setups inside infrastructure you control. For a local Onion AI model, we start from your network, data handling rules and hardware, then deliver a model endpoint your security and compliance teams can review.
How we scope
- Confirm which Onion AI features your analysts need and which must stay inside your network.
- Record the OpenAI-compatible endpoint, context window target and tested model choices in the written scope.
- Size GPU or unified memory against the model and expected concurrent analyst use before hardware is ordered.
- Agree in writing how the Security Onion Pro edition, licensing and API access are handled for your grid.
How we build
- Install and configure the local model server with the GPU stack your hardware supports, such as ROCm or CUDA.
- Set API key authentication, TLS certificates and network access rules so only approved Onion AI clients connect.
- Test prompt handling, context window limits and response quality against your own analyst questions.
- Enable metrics and logging where your monitoring policy requires them, and record what leaves the network, if anything.
How we hand over
- Deliver a written configuration record covering model files, versions, service settings and network paths.
- Provide evidence for your compliance team, such as access control settings, TLS configuration and data flow notes.
- Walk your platform and SOC staff through restart, model replacement and llama.cpp upgrade procedures.
- Document the fallback plan if the local endpoint is down, including whether any hosted provider is permitted.
How we support
- Fixed-scope engagements have written deliverables and timelines agreed before work starts.
- Ongoing upgrades, model changes and retesting can be covered by a retainer agreed in writing.
- Re-test the endpoint after Security Onion or llama.cpp upgrades that change the integration.
- Ask any partner to confirm support terms, response expectations and exit arrangements in the quote.

