Knowledge · Tools

Run AI locally or through an API?

What both routes cost, what they demand of IT, and when each one fits.

All entries

What both routes cost, what they demand of IT, and when each one fits.

01 In short

Run AI locally or use it through an API: an AI model can be brought into a workflow in two ways. Through an interface (API): the model runs at the provider, the workflow sends it only the one step that has to understand language or documents, and you pay per use. Or locally, that is self-hosted: an open model runs on your own servers or with a hosting provider of your choice, and no data goes to a model provider. The API is the faster and usually cheaper route. Self-hosting is the route when no data may leave the building. The workflow tool itself raises the same question again, separately.

02 Two decisions, not one

A workflow has two parts that can run in different places:

  • The workflow tool, usually n8n for us. It connects the systems and runs the steps.
  • The model that takes the understanding step, such as Claude, ChatGPT, Mistral or an open model.

Both can be chosen independently. A self-hosted n8n can call a model through its API, and a hosted n8n can reach a self-hosted model if it is reachable. Which model does which job is a third question — see AI models and data residency.

03 The model through an API

The workflow sends a text or a document to the provider and gets the result back.

  • Cost: per use, billed by the amount of text processed. No hardware of your own. For most office processes the model costs are small compared with building and looking after the workflow.
  • IT effort: low. A business account with the provider, an API key, a data processing agreement.
  • Quality: access to the most capable models as soon as they are released.
  • Data residency: the models we use this way run in European regions. The provider remains a company with its own seat — in the US for Claude, ChatGPT and Gemini, in France for Mistral. What that means is covered in US providers and data residency.

04 Running AI locally: the model on your own servers

An open model whose weights are freely available runs on servers you control. Examples on our list are GLM, Qwen and Llama.

  • Cost: servers with graphics processors, in your own data centre or rented, plus power or rent and upkeep. They are incurred whether the model is working or not.
  • IT effort: high. Someone has to run the servers, update the model, watch the load and fix outages.
  • Quality: in 2026 open models are good enough for many tasks, such as sorting, summarising and extracting. For long, difficult documents the large commercial models are, in our experience, usually ahead.
  • Data residency: entirely with you. No model provider sees the data.

05 What hardware a local LLM needs

What decides it is the memory of the graphics processor. A model's weights need roughly parameters times bytes per parameter: two bytes at 16-bit precision, one at 8-bit, half a byte at 4-bit. A model with 70 billion parameters therefore needs around 140 GB at 16-bit and around 35 GB at 4-bit, plus memory for the text it is currently processing. Smaller models with 7 to 14 billion parameters run on a single graphics card; large ones need several, or a server with a lot of graphics memory. Reducing to 8 or 4 bits saves memory but can cost quality; we check that with your sample cases.

We do not quote hardware prices here. They depend on model size, volume and how the hardware is sourced, and they change quickly. For your workflow we calculate them in the analysis, against the cost of using an API.

06 The two routes side by side

Through an API Self-hosted
Getting started Days Weeks, depending on hardware
Type of cost Per use Fixed, for hardware and operation
In-house IT needed Hardly Yes, or an operations partner
Model quality The current top models Open models, sufficient for many tasks
Who sees the data The provider, under contract Nobody outside
Fits when Data protection is handled by contract and pseudonymisation No data may leave the building

07 The workflow tool: hosted or self-hosted

n8n offers both. n8n Cloud is run by the vendor, on Microsoft Azure in the European Union (as of 09.2026). Self-hosted, n8n runs on a server of your choice — in Switzerland, in Europe or in your own data centre. The Community Edition is free for internal use within your own business; features for larger organisations, such as single sign-on, need a licence.

Self-hosting is the choice when the workflow has to reach systems in your own network, such as a file server or an ERP without cloud access, or when Swiss data residency is required. Hosted is the choice when all systems are in the cloud anyway and nobody should have to look after a server. More about the tool in What is n8n.

08 When each route fits

  • The standard case: n8n on a server in Switzerland or Europe, model through the API in a European region, personal data replaced by placeholders before the call.
  • Everything in Microsoft: the environment sits in your Azure account, managed by your IT. The model comes from the same environment.
  • Nothing may leave: workflow and open model both run on your infrastructure. More effort, but no provider in the data path.

What data protection law requires for this is covered in Using AI under Swiss data protection law.

09 What we take on

If you wish, we run the workflow server for you and look after it in operation. If your IT wants to run it itself, we build so that it can, with documentation and hand-over. What ongoing support costs is on Services.

10 Frequently asked questions

Is a self-hosted model always more secure?

It is more independent, because no provider sees the data. It is only secure if your own operation is good: updates, access, monitoring. That is work a provider would otherwise do.

Can we start with the API and switch later?

Yes. The model step is one building block in the workflow. If it is switched to a self-hosted model, the rest of the workflow stays the same. Beforehand we check with your sample cases whether the open model does the job equally well.

What does a local LLM need in a company?

A server with enough graphics memory for the chosen model, someone to run and update it, and a workflow that calls the model only for the steps that have to understand language. Which hardware is covered above.

Can AI be hosted in Switzerland?

Yes. An open model can run on servers in Switzerland, in your own data centre or with a Swiss hosting provider, and so can n8n. Then neither the workflow nor the model calls leave Switzerland.

What does model use through the API cost?

That depends on the model, the document length and the volume. We do not quote prices here because they change often. In the analysis we calculate them for your workflow.

Sources

Describe a process. We will tell you whether automating it pays — even when the answer is no.

Book a call