AgentenCode · Field guide

Local AI Agents: Models, Hardware, Privacy and Safe Execution

Understand local inference, tool execution, hardware constraints and hybrid deployment choices.

AgentenCode Editorial · November 25, 2026 · Expanded technical reference

Original AgentenCode conceptual editorial illustration: Local AI agents
Original editorial illustration; not a vendor image or documentary screenshot.

Local does not mean offline

Separate the model server, orchestrator, document storage and tools. A model may run on a laptop while calling a cloud search service. A self-hosted orchestrator may use an external language model. For sensitive workflows a data-flow diagram matters more than the local label. Inspect network egress, downloads, telemetry, external embeddings and logging individually.

Four deployment models often confused

On-device means inference runs on an endpoint such as a laptop or workstation. On-premises means an organization's own server environment, potentially shared by employees. Private cloud means controlled cloud infrastructure; it is not automatically offline or purely local. Hybrid deployments distribute steps across local and external models. Data flows and permissions determine what can leave a location.

A local model server is also not a local agent by itself. An agent additionally needs runtime, tools, session state, possibly a retrieval index and verification. The runtime can operate on the same machine or a separate server. Document for each component who administers it, what it stores and whether it works without external connections.

Plan hardware realistically

Model weights account for only part of memory consumption. Context windows, KV cache, concurrent requests and runtime overhead also consume resources. Quantization reduces memory requirements but may affect quality. Actual acceleration depends on hardware, model format and runtime. Benchmark your own workload, including long documents and tool loops, rather than relying on universal RAM recommendations.

Hardware: calculating weights, cache and throughput

For dense models, four bits per parameter imply approximately 4 GB for eight billion parameters, 7 GB for fourteen billion and 16 GB for thirty-two billion. These decimal GB figures cover idealized weights only. Actual quantization formats add metadata; runtime, activations and KV cache increase memory needs. For mixture-of-experts models, active parameters per token do not automatically equal the weights that must be loaded.

A conventional transformer's KV cache grows roughly with token count, layers, KV heads, head dimensions and bytes per cache element. For a hypothetical model with 32 layers, eight KV heads, 128 dimensions and two bytes per element, keys and values together require approximately 128 KiB per token. At 8,192 tokens that is 1 GiB; at 32,768 it is 4 GiB per sequence. Different architectures, cache quantization, windowing and offloading change this calculation. Treat the formula as a planning model, not a specific product guarantee.

Documentation: Ollama – Context length and memory

Model weight memory compared. Theoretical lower bound for weights in decimal GB. Excludes cache, runtime and metadata.
Model weight memory compared
Theoretical lower bound for weights in decimal GB. Excludes cache, runtime and metadata.
KV cache grows with context. Hypothetical transformer: 32 layers, 8 KV heads, head size 128, FP16 cache; per sequence.
KV cache grows with context
Hypothetical transformer: 32 layers, 8 KV heads, head size 128, FP16 cache; per sequence.

From model to agent

Ollama's tool-calling documentation illustrates how a model returns structured function calls. The application still executes the function, validates arguments and supplies results. A local model alone is not a full agent. Orchestration also needs an allowed tool set, state management, budgets and controlled failure handling. Reliable tool use must be evaluated for the actual model version.

Runtime selection: Ollama, llama.cpp and servers

Ollama provides a local model API and documents tool calling. llama.cpp is one possible inference engine for supported quantized models; hardware and model support depends on version. An inference engine alone does not enforce business permissions or execute application tools. Simple local APIs may suffice for a single workstation; for concurrent workloads examine scheduling, GPU memory, authentication and queue behavior separately.

The choice between unified memory, dedicated GPU memory and CPU execution influences feasible model sizes and prefill or generation times. An agent often processes similar long contexts repeatedly. A system that responds quickly to a short chat may become too slow over ten sequential tool rounds. Measure complete tasks rather than tokens per second on the first call alone.

Documentation: Ollama – Tool calling · llama.cpp – Inference runtime

Example: internal document archive

A company wants to search PDF policies. A local parser extracts text and a local index retrieves relevant passages. The model answers with document identifiers, sections and citations. The agent has read-only rights, no email function and no network access. It asks for clarification when evidence is missing. Test conflicting document versions before opening access to additional user groups.

Reference architecture for confidential documents

An employee authenticates to an internal portal. Access control determines allowed document collections. Retrieval searches only those collections and returns passages with document ID, version and section. A local model creates an answer and may propose another search. Verification checks that citations exist and are accessible to the employee. Only then is the answer displayed.

When a document changes, update index entries and caches consistently. For conflicting policies the agent should state date and status instead of blending versions. Retrieval must not place unauthorized results into model context even if the agent promises to ignore them later. Fifty representative questions are sufficient for an initial proposed pilot, including missing sources, old versions and deliberately manipulated document text. This is a suggested test size, not a measured benchmark.

Data stays within the local system. Example architecture of a read-only offline document agent with ACL checks before retrieval.
Data stays within the local system
Example architecture of a read-only offline document agent with ACL checks before retrieval.

Security on your own machine

A local agent with shell access can be as risky as a cloud agent. Use separate user accounts or containers, explicit read paths, no unnecessary secrets in context and restricted networking. Documents and web pages may contain manipulative instructions. Enforce permissions outside the model. Model licenses, package updates and the origin of downloaded weights also deserve review.

Costs and hybrid operation

Local execution shifts costs toward hardware, energy, maintenance and administration. An existing GPU may make a pilot attractive but does not prove lower total cost. For infrequent difficult tasks, an explicitly authorized cloud step may make sense. The routing policy must account for data classification and must not automatically send confidential content to an external provider.

Tool calling in detail: from JSON to safe action

The runtime sends model and tool schemas to the local inference service. Model output may contain a function argument such as document_id and query. The executor verifies schema, permitted documents and request limits. It calls search and returns only needed results. The model can then produce a cited answer. A function call is a proposed action, not automatic execution by the model.

A read-only document agent should not receive freely parameterized shell access. If writes are needed, add narrowly scoped interfaces with separate authorization. Reject unknown tool names, incorrect types and empty mandatory fields. Validate citation output too: a plausible document identifier does not establish that the document exists or was quoted correctly.

Documentation: Ollama – Tool calling

Estimate memory requirements

A rough lower bound for weights is parameter count multiplied by bits per parameter and divided by eight. Eight billion parameters at four bits would amount to around four billion bytes for weights alone; metadata, cache and runtime overhead add to that. This is illustrative arithmetic, not a hardware requirement for any particular model. Long context or multiple concurrent agents can significantly increase actual usage.

Measure token throughput, time to first response and tool latency as well as memory. A smaller model with robust tool calling may outperform a larger one for a document workflow if total duration and error rates are lower. Use representative inputs rather than one demonstration.

A local data flow with an enforceable boundary

One design uses a local document store, parser, retrieval index, model server and separate tool gateway. The index supplies only relevant excerpts; the agent cannot directly open arbitrary directories. The gateway logs allowed calls without copying unnecessary document content into logs. Do not expose the model server to public networks without suitable controls.

List every service with its data classification, network destination and storage location. Run the pilot with external networking blocked and compare results. If key functions fail, document those dependencies before describing the system as offline.

An economics calculation instead of a free-computing promise

Assume €1,800 of additional workstation hardware amortized over three years. That is €50 per month before financing. At 120 watts of additional average power and 120 operating hours, consumption is 14.4 kWh; at an assumed €0.35 per kWh, around €5. Add two hours of administration at €60 and illustrative monthly costs total approximately €175. Different hardware, load and electricity prices can change the calculation substantially.

At 500 successfully completed tasks per month that means about €0.35 per result; at 2,000 tasks about €0.09 if the same capacity suffices. Model quality, manual rework, depreciation and downtime risk need separate consideration. A cloud service may be cheaper at low utilization; local operation may offer other advantages for sensitive data or predictable heavy usage. The calculation does not establish a universally cheapest deployment model.

Model selection and maintenance

Choose models against your task rather than public benchmark position alone. Test multilingual inputs, structured tool arguments, long context and whether the model refrains from guessing when evidence is absent. Model upgrades may alter output formats; pin and document the tested version. Obtain weights and runtime packages from trusted sources and review licensing independently of deployment location.

Assign ownership of updates, backups, access control and error reporting. A single-user local pilot does not need to become a platform for a hundred employees immediately. When different users require distinct data rights, tenant isolation and central administration become more important.

From pilot to stable operation: evaluation checklist

Test complete tasks in the required language, representative context lengths and identical tool schemas. Measure accepted outcomes, end-to-end latency, peak memory, invalid arguments, retries and manual corrections. A network monitor or restrictive firewall must establish reachable destinations; avoid unnecessary storage of sensitive prompts during testing.

Before release, clarify model licensing, verification of new weights, update ownership, access control and backup testing. Pin model and runtime versions, rerun the same evaluation after changes and define a rollback to the last verified configuration. A local agent is an operated software system; work does not end after its first successful chat.

AgentenCode assessment

We recommend starting locally with bounded repeatable tasks and controllable data. The key is not the largest model, but the share of accepted results within the available time budget. Compare local and hybrid variants using identical tasks, network logs and failure cases. An offline-tested agent is stronger evidence than a generic privacy assertion.

Decision matrix

Model size4-bit (idealized)8-bit (idealized)16-bit (idealized)
8B4 GB8 GB16 GB
14B7 GB14 GB28 GB
32B16 GB32 GB64 GB
70B35 GB70 GB140 GB

Additional practical decision guide

DeploymentBenefitCheck
OfflineLocal dataBlocked network
Self-hostedOperational controlAccess rights
HybridFlexible capabilityData routing
CloudLess maintenanceContract and scope

Frequently asked questions

Does local mean open source?

No. Licensing, model weights and deployment location are separate properties.

Is a GPU required?

No. CPU inference is possible; suitability depends on model and latency.

Can a local agent access the web?

Yes if allowed. Offline operation must be enforced.

Are local agents free?

No. Hardware, power and maintenance may cost money.

How do I test data egress?

Inspect network connections and all model, tool and telemetry endpoints.

What is a good starting task?

A read-only document agent with citations and blocked network egress.

Did AgentenCode lab-test the named products?

No. Our assessment combines public vendor documentation with original conceptual examples and calculations. Suitability must be tested in the specific environment.

Primary sources and methodology

Claims are grounded in the linked primary sources and original editorial analysis. Examples are illustrative; AgentenCode has not independently tested products, certified security or measured keyword volume. Sources reviewed November 25, 2026.

  1. Ollama – Tool calling
  2. Ollama – Context length and memory
  3. Microsoft – Model clients and agent framework
  4. OpenAI – Guardrails
  5. llama.cpp – Inference runtime

Our evidence methodology

NEWSLETTER · FREE · GERMAN EDITION

More signal. Less AI noise.

Our source-backed German-language digest of major AI developments, agent updates and knowledge articles. The weekly edition is being prepared.

Double opt-in: Subscription starts only after email confirmation. Your details are sent to Brevo when you submit.