EN PL

AI agent and local model - practical comparison

Local LLM assistant - comparison of perspectives

LLM agent as support for working with documentation

Language models are increasingly used to support work with procedures, instructions, and organizational knowledge. In practice, there are two main deployment approaches: cloud-based and local. In a lab environment where privacy, control, and flexibility are priorities, the local variant appears better aligned with the goals at hand, even though it is not always the optimal choice in every case.

Category: LLM / privacy / GRC Published: 25.08.2026 Updated: 29.08.2026 10 min read

Why compare two variants?

Working with documentation naturally raises questions about AI automation and support. In practice, at least two approaches appear:

  • cloud variant - an agent in an external service, easy to start, document integration, billing tied to the service model and its token-based limits,
  • local variant - a model running on my own computer (here: Ollama and Mistral 7B), generation without vendor token limits, but with hardware, time, and energy costs.
The goal was not to select one universal solution, but to show that in practice the local variant can offer stronger control over the environment, greater privacy of processing, and greater independence from third-party service providers. This is relevant from the perspective of experimentation and operational needs.

I selected the technology only after defining the comparison question and objective. In my laboratory, the critical factors are data privacy, control over the environment, and the ability to work without an external provider. This does not mean the cloud is bad; it simply is not always the best fit for a given context or set of requirements.

Cloud and local variant - quick comparison

This comparison reflects the typical trade-offs of both approaches from the perspective of a practical deployment. It is not a universal statement of technical truth, but rather an illustration of the compromises that arise when privacy, control over the environment, and independence from external services are priorities.

Area Cloud agent Local model
(Ollama + script)
Knowledge base Library of documents, procedures, instructions Limited context from local content - I chose HTML
Generation limit Tokens, plan, provider limits No vendor limit; constrained by hardware and time
Data With the service provider On my own computer (default setup)
Ongoing cost Subscription / usage Electricity, hardware wear, maintenance time
Convenience High Lower (installation, model, script)
Internet dependency Usually required Not by default; network access is a separate decision
Response time Usually shorter, depending on infrastructure, network, and plan Usually longer, depending on CPU/GPU, context, and demand
Responsibility for the result Human Human

Locality does not automatically mean “safer in every respect.” It means a different trust boundary: less dependence on an external API and more responsibility for your own system. Cloud remains important when the objective is convenience, scalability, or enterprise integration, and it must be governed with proper controls such as ISO/IEC 27001:2022 clauses A.5.23 and A.8.1.

Risk and requirement analysis depend on the actual context of AI use.
Context / environment Private use Business / work use
Local AI (e.g. Ollama) Full control and privacy: data stays on the device; risk is mainly tied to physical security and configuration mistakes. Full control and traceability: no external transmission of business data. Yet it requires managing your own infrastructure, backups, and resources.
Cloud AI (generic agent platform) Privacy risk: free versions may process entered data for model training or monitoring, depending on the service terms. Strict control requirements (ISO / GDPR): free versions should not be used for business data; enterprise or API models, DPA agreements, EU residency, and MFA are typically required.

Business use and compliance with ISO 27001 and legal requirements

Key requirements and controls when using cloud AI for business purposes:

  • Business / Enterprise / API only: avoid free AI tools when company data is involved.
  • Confidentiality clause in the contract: a formal agreement with the AI provider that protects prompts and input data.
  • Employee policy: clear rules on what may or may not be pasted into AI, including customer data, source code, or financial information.
  • Location control (GDPR): know where data is processed and stored, and whether it is within the EU.
  • Secure access: mandatory MFA for AI accounts and clear administrative ownership.
  • Exit plan: a process for data recovery, moving to another vendor, and business continuity.

That is not everything, but it is the minimum that should be verified before using AI tools with company data.

Fine-tuning, RAG, and limited context

When adding knowledge to a model, it is easy to confuse three different approaches:

  • Fine-tuning - modifying model weights using your own data. Expensive and complex; if processes change significantly, the process must be repeated. I did not do this in this project.
  • RAG (Retrieval-Augmented Generation) - the system retrieves the most relevant document fragments for a question and adds them to the prompt. Useful for large documentation sets, but requires indexing and pipeline work. There is no full RAG here.
  • Limited context + local generation. In this project, I build a narrow knowledge base from HTML, Python passes it to Ollama together with the prompt, the result is written to JSON, and the page only displays it. This is the approach used here.
I did not fine-tune the model. The weights remained unchanged. The knowledge enters as working context - simpler than RAG, with a clear character limit.

A limit of roughly 12,000 characters of context comes from practical experience. As the documentation grows, the natural next step would be RAG, not necessarily fine-tuning immediately.

Architecture

Documentation limited context Ollama Python JSON verification SecureHaveNET

The public site does not connect to the model. Generation is local, and the demonstrator reads a prepared cache. That means I do not expose Ollama to the internet and I do not build a public generation API.

Terminal with a local LLM agent generating answers via Ollama
A local Python script sends questions to Ollama and stores responses in a JSON cache.

Environment and model

  • Hardware - AMD Ryzen 7 7435HS, 16 GB RAM, NVIDIA GeForce RTX 4060 GPU (8 GB)
  • Model: mistral:latest in Ollama (typically Mistral 7B; the exact version depends on the tag downloaded at the time)
  • Temperature: 0.2 - lower randomness, more predictable responses; this is not a measure of risk or compliance
  • Context in the script: num_ctx = 8192, timeout 300 s, atomic JSON write after each response

How does the demonstrator work?

Select a question to see a response generated locally. The page interface only loads a prepared JSON file - without connecting to Ollama in the browser.

Local assistant - questions about comparing variants

Loading questions...

Select a question above.

What can we conclude from the demonstrator?

Generation times come from measurements in the script.

Generation times from the current JSON cache

Note: the shorter the response time for a question, the better - as long as correctness, consistency, and factual alignment are preserved.

Question Time What is worth noticing
Advantages and limitations of the local model vs cloud agent 22.38 s The model accurately addresses privacy, environment control, and real costs (hardware, time, energy), along with typical limitations: smaller knowledge reach, slower response, and no ready-made cloud integrations.
No token limit ≠ free generation 10.81 s Short and on point: the cost is computational time and energy on the device.
Privacy of local execution 11.33 s Locality helps, but it does not guarantee privacy by itself (workstation access, network exposure, and access control still matter).
What is a ~7B model good for? 12.49 s The answer is often cautious without enough power or data; conversely, it can become too broad or generic.
Role of temperature 0.2 4.92 s Temperature controls randomness: 0.2 produces more predictable responses, but it is not a measure of risk or security. This is a good example of why AI answers need verification.
Separation of Python/JSON from the web layer 14.48 s Consistent with the project architecture: smaller attack surface, better process control, and a public read-only layer.
Risks in quality documentation 11.51 s Important caution: precision, timeliness, ownership of the content, and the risk of treating the answer as an approved procedure.

Average time for this set: about 12.56 s per question (from about 4.92 s to about 22.38 s). This gives a realistic picture of local model performance in this specific pipeline and on this hardware.

Quality conclusion (Check): the measurements show that response time depends on query complexity and prompt structure. However, a fast answer does not automatically mean substantive correctness. Questions about technical parameters, such as the role of temperature 0.2, require critical review because the model can be too cautious or imprecise. The verification phase must therefore cover not only hardware parameters but also business and audit validation of the content.

No vendor token limit does not mean free and endless generation. It means a different cost profile: hardware, computation time, and energy instead of provider charges.

Risks that local execution does not eliminate

  • access to the computer and account running Ollama,
  • quality and timeliness of the knowledge base,
  • inaccurate or overconfident model responses,
  • the temptation to treat responses as approved procedures,
  • logs, cache, and JSON files containing sensitive content,
  • future connection to the internet or internal systems without a renewed risk analysis.

Human-in-the-Loop

LLM proposal verification human decision

The model can speed up organization of knowledge and help identify risks. It does not bear responsibility for procedure compliance, quality decisions, or security. The answer about temperature in the demonstrator shows that even with a simple setup the model can be imprecise - which is why verification is not decorative, but essential.

How I built the solution

Define the problem risk architecture aligned with the objective implementation testing correction my decision

  • Plan - compare the local variant and the cloud variant in terms of generation limits, privacy, and costs.
  • Do - Ollama, Mistral 7B, Python, limited HTML context, JSON, and a static page.
  • Check - solution operation, generation times, the quality of the demonstrator responses, and their qualitative verification.
  • Act - including a 300 s timeout, context limit, atomic cache writes after each response, and a review procedure for generated content before it is accepted as binding guidance.

Comparison: Ollama (Mistral 7B), Gemini, and Grok

The same seven questions, similar system profile (SecureHaveNET, GRC, local inference). Local measurements come from the script and Ollama on the project hardware. Cloud results (Gemini, Grok) are separate runs used as a benchmark.

Dimension Ollama
Mistral 7B (local)
Gemini
(cloud)
Grok
(cloud)
Total time (7 questions) about 85.9 s fractions of a second to a few seconds* about 2-4 s per set*
Average time / question about 12.3 s about 0.32 s (declared) well below local time
Total answer characters usually longer lists (often 800-1500+ per question) 2,905 2,030
Average characters / answer higher than in cloud tests about 415 about 290
Where generation happens own hardware provider infrastructure provider infrastructure

* Cloud time is not a perf_counter measurement on an Ollama workstation, so these are not identical laboratory conditions. The local measurements are hard technical readouts produced on my hardware, while cloud times are based on external vendor responses. This is an intentional comparison of extreme environments, not a processor benchmark under the same conditions.

Conclusion: the cloud variant wins on latency and often produces shorter, more condensed answers. The local variant wins on control and privacy of document and query processing. “Faster” does not automatically mean “better,” and a longer local answer does not automatically mean higher precision.

Conclusions

  1. It is possible to build a local assistant using your own content without a public model API.
  2. The local variant and the cloud variant solve a similar need, but in my case the local solution has the advantage in privacy, full control, cost predictability, and independence from subscriptions.
  3. No vendor token limit does not mean free generation: the hardware, computation time, energy, and responsibility for the execution environment remain.
  4. In this project, I did not fine-tune the model and did not build full RAG - I used a limited context. This was a conscious trade-off between simplicity and control.
  5. Model responses can be helpful but also imprecise. That is why Human-in-the-Loop remains necessary, whether the model is cloud-based or local.
  6. This is a demo project, not a complete system for all organizational documentation. However, in my lab, the local variant remains a practical and sensible choice.
  7. Deploying a local agent is not only a technical decision (GPU, Ollama), but also a Governance, Risk and Compliance (GRC) decision - transferring responsibility for log security, continuity of operation, and result verification to the internal team.

Summary

Each approach has its strengths and limitations. In cloud conditions, the agent typically wins on ease of use, integration scalability, and a lower entry barrier. However, in my usage model - lab environment, privacy, full control over the environment, independence from subscriptions, and the ability to influence each part of the process - the local path is more practical and better aligned with the requirements.

  • control over data and queries - generation remains on my own hardware,
  • predictability of generation limits - instead of provider tokens, the machine resources and time apply,
  • ability to run an end-to-end mechanism - from prompt and context through timing to a deliberate separation of generation from the public layer,
  • simpler exposure boundary - the public page only reads JSON without exposing the model to the network,
  • flexibility for experimentation - control over model, temperature, context, and the generation start time.

The limitations of the local variant are also clear: slower response time, environment maintenance, lack of ready-made cloud integrations, and the responsibility for keeping knowledge up to date and information secure.

The key lesson remains common to both paths and aligned with the GRC mindset:

Technology should support the process and the human. It does not replace responsibility for decisions or content approval.

Sources and reference documents

  • Ollama - local runtime environment for large language models.
  • mistral:latest - the Mistral 7B model in the Ollama library.
  • Regulation (EU) 2024/1689 (AI Act) - EU legal framework for AI systems, including transparency and risk management.
  • Large language model - encyclopedia overview of language models.
  • NIST AI Risk Management Framework (AI RMF 1.0) - AI risk management framework from NIST.
  • ISO/IEC 27001:2022 - Information security, cybersecurity and privacy protection - Information security management systems - Requirements
  • ISO/IEC 27002:2022 - Information security, cybersecurity and privacy protection - Information security controls.

The responses in the demonstrator were generated automatically by a local language model. In line with transparency principles, AI-generated content requires human verification and does not constitute an independent legal, quality, or decision-making recommendation. The reference to the AI Act concerns EU regulatory frameworks; this demonstration project is not an assessment of compliance for any specific system under the regulation.

Questions and answers

How is the local variant different from a cloud agent?

Both can support work with documentation, but they have different operating assumptions. Cloud LLMs are convenient and easy to integrate, while the local variant keeps generation on your own hardware, with a different privacy profile and different costs in hardware, time, and energy.

Did I fine-tune the model on procedures?

No. The model weights were not changed. The questions are answered using a limited context from local HTML files. This is neither fine-tuning nor full RAG.

How is this project different from RAG?

RAG first searches for the fragments most relevant to the question. Here, a limited and pre-prepared set of content is provided up front. This is simpler to build, but less scalable for very large documentation sets.

Why are responses not generated directly on the page?

Generation happens locally in Python via Ollama. The results are stored in JSON, and the browser only displays them. The public page does not need to connect to a live model endpoint.

Does a local model mean no cost?

No. Instead of paying the provider per token, you still pay in hardware, computation time, and energy. No token limit does not mean free and endless generation.

Does an AI agent replace an expert or procedure owner?

No. The model prepares a working draft. Interpretation of requirements, risk assessment, and approval remain with the human.

Was this project useful?