Expert guide

Private, Local AI for Microsoft Access Data

Classify, extract and summarise sensitive records without sending them to the cloud

Short answer: install a local model runner such as Ollama on a capable Windows PC or server, download a small open-weight model, and call its local HTTP API from Access VBA, the same way you would call a cloud AI API but at an internal address. Records never leave your network. Local models handle classification, field extraction and short summaries well; for complex reasoning, cloud models are still stronger. We design these setups within AI workflow automation projects.

Clinics, law firms, accountants, HR departments and government contractors often have the strongest reasons to use AI on their Access data and the strongest reasons not to send that data anywhere. Patient notes, case files, payroll records and client financials are exactly the text AI is good at summarising, and exactly what contracts and regulators restrict. Running the model yourself changes the trade-off.

How a Local Setup Works

  • Model runner

    Ollama, LM Studio or a similar tool runs on a PC or server and loads a model into memory.

  • Local API

    The runner listens on an address such as http://localhost:11434 or http://ai-server:11434 on your network.

  • Access VBA

    Your database posts a prompt to that address and receives the answer, just like a cloud call.

  • Firewall

    The AI machine does not need internet access once the model is downloaded.

Hardware: What Is Realistic

SetupModel size it handles comfortablyGood for
Office PC, 16 GB RAM, no GPUSmall models (around 3–4B parameters)Classification, short extraction, low volume; slow but workable
PC with 8–12 GB GPU7–8B parameter modelsMost per-record tasks at practical speed
Workstation with 24 GB+ GPULarger models (around 14–32B, quantised)Better summaries and longer documents
Dedicated server, multiple GPUsLarge modelsTeam-wide use, high volume

Model sizes and requirements change quickly. Treat these as starting points and test with your own documents; speed and accuracy on your data are what matter.

Setting Up Ollama on Windows

  • Install Ollama for Windows on the machine that will run the model.

  • Open a command prompt and pull a model, for example: ollama pull llama3.1:8b (choose a current model suited to your hardware).

  • Test it: ollama run llama3.1:8b and type a question.

  • For network use, set the OLLAMA_HOST environment variable to 0.0.0.0 so other PCs can reach it, and restrict access with Windows Firewall to your Access users' machines.

Calling the Local Model From Access VBA

Ollama offers an OpenAI-compatible endpoint, so the code is almost identical to a cloud call, minus the API key.

Option Compare Database
Option Explicit

Private Const LOCAL_AI_URL As String = "http://ai-server:11434/v1/chat/completions"
Private Const LOCAL_MODEL As String = "llama3.1:8b"

Public Function AskLocalAI(ByVal instruction As String, ByVal inputText As String) As String
    Dim http As Object, body As String
    body = "{""model"":""" & LOCAL_MODEL & """,""temperature"":0," & _
           """messages"":[{""role"":""system"",""content"":""" & JsonEsc(instruction) & """}," & _
           "{""role"":""user"",""content"":""" & JsonEsc(inputText) & """}]}"

    Set http = CreateObject("MSXML2.ServerXMLHTTP.6.0")
    http.setTimeouts 5000, 5000, 60000, 300000      ' local models can be slower
    http.Open "POST", LOCAL_AI_URL, False
    http.setRequestHeader "Content-Type", "application/json"
    http.send body

    If http.Status <> 200 Then
        Err.Raise vbObjectError + http.Status, "AskLocalAI", Left$(http.responseText, 200)
    End If
    AskLocalAI = ReadContent(http.responseText)
End Function

JsonEsc and ReadContent are the helper functions from connecting MS Access to the OpenAI API. Because the interface is the same, you can switch a given task between local and cloud by changing two constants, which makes side-by-side testing easy.

Getting Good Results From Smaller Models

  • Narrow the task

    One job per call: classify, or extract, or summarise. Not all three.

  • Constrain the answer

    Give a fixed list of categories or an exact output format and validate it in a query afterwards.

  • Shorten the input

    Send the relevant field, not the whole record. Smaller models degrade on long inputs.

  • Use temperature 0

    Consistency matters more than creativity for business data.

  • Give examples

    Two or three worked examples in the instruction raise accuracy noticeably on small models.

Local vs Cloud: Choosing Per Task

FactorLocal modelBusiness cloud API
Data leaves your networkNoYes, under contract terms
Quality on complex tasksLowerHigher
Setup and maintenanceHardware, updates, monitoringAPI key and billing
Cost modelUpfront hardware, near-zero per callPay per use
Works offlineYesNo
SpeedDepends on your hardwareGenerally fast

Typical Private Use Cases

  • Clinics: summarising visit notes or classifying referral letters in an Access patient tracker.

  • Law firms: tagging matter notes and extracting dates from correspondence.

  • HR: categorising exit interview comments without sending them out.

  • Finance: classifying transaction descriptions for entities with strict data agreements.

  • Labs: extracting values from internal result sheets.

Industry guides that pair with this: law firm matter tracking in Access and clinic no-show tracking. For the broader data-safety question, read is it safe to use ChatGPT with company data.

What Local AI Does Not Solve

Running the model locally removes the question of where data goes during processing. It does not replace access controls on the database, audit logging, backups, retention rules or the need for human review of AI output. A local model that any PC on the network can call with any data is a new risk, not a safeguard. Restrict who can reach it and log what it is asked.

FAQ

Local AI with Access FAQ

Hardware, quality and privacy

Yes. Tools such as Ollama or LM Studio run open-weight language models on a Windows PC or server and expose a local HTTP API. Access VBA can call that API exactly like a cloud API, using a localhost or internal server address, so no data leaves your network.

Small models in the 3 to 8 billion parameter range run on a modern PC with 16 GB of RAM, faster with a recent graphics card with 8 GB or more of video memory. Larger models need more memory and a capable GPU. For a team, one shared machine on the network is usually better than installing a model on every desktop.

For narrow tasks such as classification, extraction into fixed fields, short summaries and simple rewriting, small local models are often good enough. For complex reasoning, long documents and high-quality writing, the largest cloud models are still noticeably better. Test on your own data before deciding.

When data is too sensitive to leave the network under your contracts or regulations, when there is no reliable internet at the site, or when very high volumes of simple tasks would make cloud costs significant. Otherwise a business cloud plan is simpler to run.

No. Keeping data on-site removes one risk, but you still need access control, logging, retention rules and a lawful basis for processing. A local model running on a shared PC that everyone can reach is not a compliance strategy on its own.