Cloud Computing · AI HOSTING

AI model in the cloud or on your own server? Where to process company documents

Remote Admin SysOps Team·November 23, 2026·20 min read

Company documents can be processed by a model reached through an external provider’s API or by an open-weight model running on your own or a leased GPU server, and in many projects a combination of the two works best. An API lets you start quickly and pay for actual use, while self-hosted AI gives you control over where the content of your documents goes, in exchange for a fixed cost and the duty to maintain it. The choice is decided by the confidentiality of the data, the volume, the quality you need and who is to be responsible for keeping the whole thing running.

The question of self-hosted AI usually comes up when a project stops being an experiment and is about to cover real invoices, contracts, HR documents or correspondence with customers. That is a good moment, because the decision on where processing takes place affects the architecture, the budget and the contracts. We describe it from the perspective of a team that builds custom web and mobile applications with AI modules and, at the same time, operates the infrastructure such applications run on, in data centers in Poland. For a company anywhere in the EU that has one practical consequence: a model hosted there keeps its documents inside the EU. We leave hardware details out, because we have covered them in separate articles that we link to below.

Legal status as of November 2026. This article is for information only and is not legal or tax advice.

What are the options: an API, your own server or a hybrid setup?

There are three options to choose from: an external provider’s model reached through an API, an open-weight model running on a server controlled by the company, and a hybrid setup in which the application sends tasks to one or the other depending on the type of data.

A model through an API is what people commonly call “AI in the cloud”. The application sends the content of the task over the internet to the provider’s service and receives the result. The hardware, the model and its updates remain on the provider’s side, and the company does not need a single server with a graphics card.

A model on your own server is an open-weight model, that is one whose weights have been published and which you can run yourself. It runs on a GPU server that stands in the company’s server room or is leased or colocated in a data center. In conversations the terms “local AI model”, “private AI model” and “on-premise AI” are used interchangeably here. Strictly speaking, on-premise means hardware at your own premises, but in practice the point is the same: the model works in an environment the company controls, and requests do not go to an external AI service provider. “Your own” therefore does not have to mean “purchased”.

Option Where the content of documents is processed Who maintains the model Nature of the cost
External provider’s API In the provider’s infrastructure, in the location that follows from the contract The provider Variable, dependent on use
Open-weight model on your own or a leased GPU server In the company’s server room or in a data center of your choice The company, or a partner it entrusts with maintenance Fixed, independent of use within the server’s capacity
Hybrid setup Depends on the class of the document Both sides, each for its own part Fixed with a variable part

What leaves the company when an application uses a model through an API?

Everything the application puts into the request leaves the company: the text or image of the document, the instruction for the model, the attached context and the technical data of the connection. When an invoice is read, this is usually the whole page, including the supplier’s details, the amounts and the bank account number. With an assistant that answers employees’ questions, it is the question and the retrieved document passages, which we describe in our article on a company knowledge base with AI.

What happens to this data on the provider’s side depends on the terms of the specific service. Requests may be processed solely to produce the answer, or they may additionally be stored in logs for a period, for example to detect abuse. They may be excluded from model training, or not. They may be passed to the provider’s subcontractors. The terms can differ between the consumer and business offers of the same provider, so nothing should be assumed. The answers have to be found in the contract and in the account settings.

The application can limit this scope. Good practice is to send only the pages and fields needed for the task, to leave out attachments, and to replace personal data with identifiers before sending, if the task can be done without it. Such decisions are made when the architecture is designed.

Confidentiality and GDPR: what should you check before sending documents to an external provider?

Passing documents to an external API is not prohibited as such, but it requires checking several things: the data processing agreement, the place of processing, how long the data is kept, and whether it may be used to train models. Accounting and HR documents contain personal data: of sole traders, employees and signatories. They are therefore subject to the GDPR regardless of which tool reads them.

What to check Why it matters Where to look for the answer
Data processing agreement (Article 28 GDPR) A provider that processes personal data on the company’s behalf is a processor, and an agreement with it is required Terms of service for business customers, the data processing addendum
Place of processing The location determines which conditions have to be met; processing outside the European Economic Area requires a separate analysis Service documentation, the contract, consultation with the data protection officer
Retention period for requests and answers Data stored in the provider’s logs remains outside the company’s control until it is deleted Retention rules, account settings
Use of data for model training The content of company documents should not feed models made available to other customers Terms of service, account settings
Sub-processors The provider may use subcontractors who also gain access to the data The list of subcontractors in the contract
Security measures (Article 32 GDPR) The company remains responsible for the security of processing even when it takes place at the provider The description of safeguards and the documents made available to customers
Scope of the data sent (Article 5 GDPR) The minimisation principle: only what the task needs goes to the model The application design

Two provisions apply wherever the model runs. If the processing is likely to result in a high risk to the people the data concerns, a data protection impact assessment is needed (Article 35). If the system were to make decisions about people based solely on automated processing and producing legal or similarly significant effects, Article 22 applies. Details we do not discuss here, including the rules on transferring data outside the EEA, have to be confirmed with your data protection officer or a lawyer.

Beyond the GDPR, contractual obligations and trade secrets count as well. Customer contracts and confidentiality clauses often restrict passing documents to third parties, and calculations, offers and technical documentation may be protected whether or not they contain personal data. In Poland, essential and important entities under the National Cybersecurity System Act (the KSC Act), which transposes NIS2, also have a duty to look after the security of the ICT supply chain, and the model provider becomes a link in that chain.

Your own server does not release you from the obligations

A model running locally simplifies some of these questions, but it does not remove them. Article 32 still applies, except that securing the server, access control and the logs are now the company’s job. If the server is leased in a data center, the operator may also be a processor, and a data processing agreement with it is needed. Its scope is different, however: the operator supplies infrastructure, not a service that analyses the content of documents.

The same goes for the AI Act, that is Regulation (EU) 2024/1689. The classification of a system is decided by its use, not by the place where the model runs. Typical back-office automation, such as reading invoices, classifying documents or searching a knowledge base, is as a rule not a high-risk use. Recruitment, employee evaluation and credit scoring are examples of high-risk areas, for which the obligations under Annex III apply from 2 December 2027. The classification is checked separately for each use case. A broader discussion is in our article on AI and company data in the EU.

How much does AI through an API cost, and how much does self-hosted AI cost? The cost logic without a price list

We do not quote amounts, because they depend on the project, but the logic is constant: an API is a variable cost that grows with every document processed, and your own server is a fixed cost, incurred whether the model is working or waiting for tasks.

What makes up the cost with an API

Providers usually bill for the amount of content processed, counted in tokens, which are units of text, separately for input and output. The bill is therefore affected by the length of the documents, the sending of page images, the length of the instruction and of the context attached to every request, and the number of repetitions. If the application reads a document twice to be sure, or retries a request after an error, the cost grows in proportion. It also grows with the company: more documents mean a higher bill, with no upper ceiling. The price list and the terms are set by the provider, who can change them.

What makes up the cost of your own server

Here the components are the lease of the server or its purchase with depreciation, power and cooling or a colocation fee, the administrator’s work, updates, monitoring and, if downtime is unacceptable, redundancy. The cost does not depend on the number of documents as long as the server keeps up with the work. Once its capacity is exceeded, another one is needed, so spending grows in steps.

When each option comes out ahead

The unit cost on your own server falls as utilisation rises. A server that works for most of the day processes a document cheaply. A server that waits for most of the time processes it expensively. That is why an API usually wins with a small or irregular volume, and your own machine with a large and steady stream. Being able to shift work in time helps: an archive can be processed at night, when the server is not serving users.

An illustrative scenario shows the relationship. The first company processes few documents, with a clear peak at the end of the month, and is only just checking whether automation will take hold. The fixed cost of a server would largely be money paid for idle time, so it is more sensible to start with an API. The second company has an even, large stream of documents throughout the month and an archive of several years to process once. Here the usage bill would grow with every page, and a server would work almost without a break.

To do your own calculation you need a few inputs: the number of documents and pages per month, their distribution over time, the number of readings per document, the required response time, the expected growth, and the cost of the people who will maintain the solution. The model is also only one line in the application’s budget. We describe the others in our article on what drives the quote for an application.

Does an open-weight model on your own server match the quality of API models?

It depends on the task, which is why quality has to be measured on your own documents and not assumed in advance. In narrow, well-defined tasks, such as reading fields from a document, classifying correspondence or answering on the basis of retrieved passages, open-weight models running on your own GPU server are often sufficient. In tasks that require broad reasoning over long and varied content, the largest models available through an API may have the edge. The balance shifts with every generation of models, which is one more reason to rely on a current measurement.

The final result, however, is decided by the whole application, not by the model alone: the preparation of the input data, the instructions, the control rules and the involvement of a person. In one of our deployments, an AI application processes very large volumes of accounting documents and indexes them with 100% accuracy, where classic OCR still makes mistakes. It does so because it does not trust a single reading: it combines AI reading with control rules and sends every uncertain field to a person, so nothing unverified enters the accounting system. Such a result depends on the documents and the rules, so in every project we measure accuracy on the client’s own documents in a pilot. The architecture of such a solution is presented in our article on automated accounting document processing.

Comparing the options only makes sense on the same test set. You prepare a sample of real documents with the correct results, run both models on it and compare three things: the correctness of the reading, the share of cases sent to manual verification, and the processing time. A slightly weaker model surrounded by good control rules is, in practice, sometimes a better choice than a stronger model that may not be used for the given type of data.

Response time, availability and model version changes

With an API, response time is made up of sending the data over the internet, the current load on the service and the request limits set by the provider. The limits make themselves felt at peaks, for example at month-end close, when the application wants to process many documents at once. On your own server there are no limits imposed from outside, but there is a capacity limit: with many simultaneous tasks a queue forms. For batch work this matters little, but for an assistant whose answer an employee is waiting for, it is noticeable.

Availability looks different in each option. An application that uses an API depends on the provider’s service and on the internet connection. An application with a local model depends on its own hardware, and a single server is a single point of failure. In both cases you have to design the behaviour for when the model is unavailable: documents wait in a queue and nothing is lost.

The third matter is version stability. Providers retire older model versions and replace them with new ones on their own schedule. A new version may respond differently to the same documents, so every such change has to be preceded by regression tests. On your own server the version stays the same until the company decides to change it, which is an advantage in accounting processes. The price is the duty to track new releases and security patches yourself. We write about supervising AI quality over time in our article on application maintenance after launch.

Who maintains the model? The division of responsibilities in both options

With an API the provider maintains the model, and on your own server that duty passes to the company or to a partner it entrusts with the job. The application, the integrations and the data need maintenance in both options, so the difference concerns the model and hardware layer.

Area Model through an API Model on your own server
Hardware, drivers, model-serving software The provider The company or a maintenance partner
Choosing and changing the model version The provider determines the available versions and their retirement dates The company decides when to change and to what
Performance and scaling The provider, within the account limits The company: capacity planning, additional servers
Monitoring and incident response The provider on the service side, the company on the application side The company or a partner, preferably around the clock
Security of the environment The provider; the company protects the access keys and outbound traffic The company: network, access, system updates, logs
Logs of requests and answers Partly at the provider, on its terms Entirely under the company’s control
Contracts and compliance A data processing agreement with the model provider, an assessment of its terms A contract with the data center operator, if the server is leased

Choosing hardware is a separate topic that we do not repeat here. The general picture is given in our guide to hosting your own large language model (LLM). Graphics card memory is covered in the article on how much VRAM a language model needs, and the choice of accelerator in our comparison of GPUs for LLMs. A company that does not want to buy hardware or build a team can lease instead: we offer GPU servers in Polish Tier III data centers together with 24/7 server administration. For a company based elsewhere in the EU the effect is the same as for a Polish one: its documents are processed on a dedicated machine and stay in the EU.

A server with a model is one more system to secure, and an application with AI has its own classes of threats wherever the model runs. We discuss instructions injected through the content of documents and data leaking in answers in our article on AI application security.

The hybrid setup: how do you split work between a local AI model and an API?

The split is based on data classification: sensitive documents are processed by the local model, and tasks free of confidential data may go to an API. The rule is written into the application, so that it does not depend on the user’s judgement. Where a document is routed is decided by its type, its source or its confidentiality label, and every such decision goes into a log.

Several patterns are used in practice:

  • Split by data class. Purchase invoices, payroll and contracts stay with the local model. Translating a publicly available offer or editing a product description can use an API.
  • Pseudonymisation before sending. The application replaces personal data and identifiers with placeholders, sends the content to the API and restores the original values once it has the result. This works only where the task does not need the data itself.
  • Split by stage. The local model reads the document, and the external one receives only a task that no longer contains the source content.
  • Fallback. The API takes over the work when the server is overloaded or fails, but only for the data classes that have been cleared for it.

The precondition is an intermediate (abstraction) layer in the application: the rest of the system talks to the model through one interface and does not know which model performed the task. This means the model can be replaced without rebuilding the whole, which protects against dependence on a single provider and makes it easier to move from an API to your own server when the volume grows. The hybrid setup has its price too. Two paths are maintained and tested, and the routing rule has to be simple enough to be audited.

Decision table: which option should you choose?

Choose the option that most of your answers in the table below point to, and if the result is unclear, start with a pilot designed so that the model can be replaced later.

Situation in the company What it points to
Documents contain sensitive data or trade secrets, or are covered by confidentiality clauses towards customers Your own server or a hybrid setup
The volume is small or irregular, and the project is still testing the idea API
The stream of documents is large and steady, or a large archive has to be processed once Your own server
The task is narrow and well defined (reading fields, classification) Your own server is often enough; confirm by measurement
The task requires broad reasoning over long, varied content API or a hybrid setup; confirm by measurement
The company has no team for maintenance and does not want to build one API, or a leased server administered by a partner
The budget has to be predictable over a year Your own server
Results have to be stable over a long time, without unannounced model changes Your own server
Customers or auditors ask about the ICT supply chain and data location Your own server, or an API with well-documented terms

The decision itself is best made in six steps:

  1. Classify the documents. Establish which types of documents the application is to process, which contain personal data and which are covered by contractual obligations.
  2. Estimate the volume. Count documents and pages per month and check how they are spread over time.
  3. Define the task and the quality measure. Write down what the model is to return and how you will tell that the result is correct.
  4. Run a pilot. Run the options under consideration on the same sample of your own documents and compare the results.
  5. Calculate the total cost. Include not only the model but also maintenance, staff time and managing the contracts.
  6. Record the decision and the conditions for changing it. State at what growth in volume, or at what change in the provider’s terms, you will come back to the subject.

Common mistakes when choosing where to process documents

Poor decisions usually come from simplifications that sound good in a meeting but do not hold up on real documents.

  • Judging by a demo. A handful of clean sample invoices say nothing about how the model will cope with the scans, corrective invoices and foreign documents in your archive.
  • Equating your own server with security. A poorly secured machine in your own server room can be a greater risk than a service with a sound contract. Security is decided by the specific protective measures.
  • Leaving out the maintenance cost. Comparing the bare price of a server with an API bill, without the administrator’s work, updates and monitoring, understates the cost of your own solution and leads to misleading conclusions.
  • Tying the application to one model. When calls to a specific service are scattered throughout the code, every change of provider or version becomes a project of its own.
  • No rules for employees. Before a company application exists, documents tend to be pasted into publicly available tools on private accounts, outside any contract. The architecture decision should go hand in hand with a simple rule on what may be used.
  • Expecting the location of the model to solve the problem of errors. Both a local and a remote model make mistakes, so verification of results is needed in every option.

FAQ: frequently asked questions

Is sending company documents to an AI model through an API GDPR compliant?

It can be, as long as the conditions that follow from the regulation are met. You have to conclude a data processing agreement with the provider, check the place of processing, the retention period and the rules on using data to train models, and limit the scope of the data sent to what is necessary. The assessment of a specific service is best carried out with your data protection officer.

What is a local AI model?

A local AI model is an open-weight model running in an environment controlled by the company: on a server in its own server room or on a dedicated server in a data center. Requests and documents then do not go to an external AI service provider. The company is responsible for maintaining it or entrusts that to a partner.

Does on-premise AI mean you have to buy a GPU server?

No. In the strict sense, on-premise means hardware at your own premises, but leasing a dedicated server in a data center gives the same effect, namely a model running on a machine intended solely for your company. Buying hardware is therefore not a condition for starting a project.

Is a private AI model less accurate than a cloud model?

It depends on the task. For reading fields from documents, classification and answering on the basis of retrieved passages, open-weight models are often sufficient, while for complex reasoning the largest models available through an API may have the edge. What settles it is a measurement on your own documents, done on the same sample in both options.

When does self-hosted AI pay off more than an API?

Usually when the volume is large and steady and the server works most of the time. The cost of the server is fixed, so the more documents it processes, the lower the unit cost. With a small or irregular volume, paying for use tends to be the better deal.

Can you start with an API and move the model to your own server later?

Yes, if the application has been designed with an intermediate layer that separates the rest of the system from the specific model. The move then requires connecting the new model and running the tests again on the same set of documents. Without such a layer, the change means rebuilding a large part of the code.

Does self-hosted AI release a company from GDPR and AI Act obligations?

No. Personal data is still subject to the GDPR, and the company itself is responsible for securing the server and controlling access. Classification under the AI Act depends on the use of the system, not on the place where the model runs.

How we can help: a free quote for an application with AI

We design and build web and mobile applications that use AI to read and index documents, classify them, search company knowledge and automate repetitive steps. We match the place where the model runs to the data and the volume: it can be our GPU server in a Polish Tier III data center, so that your documents stay in the EU, your own infrastructure, or an API, if you prefer. As a single partner we provide design and development, hosting, 24/7 administration and monitoring, backups, and security testing carried out by our own penetration testers. You receive the source code and the documentation, and the terms on copyright, licence and repository access are set out in the contract.

We start with a conversation about the process, the documents and the goals, and then prepare an estimate of scope, schedule and budget. The quote is free and without obligation. You will find the details on our web and mobile app development page, and you can send your questions through the contact form.