Trialfold

Advanced · Beta

Connect an AI model on your own computer

Let a model on your own computer, instead of a cloud AI, read pasted text and tables into form values.

About this feature

What it is
Trialfold's AI data entry can use a model that runs on your own computer through LM Studio or Ollama. Our server cannot reach your computer directly, so you open a secure tunnel to it and give Trialfold the tunnel address.
It is a beta
This is an advanced beta feature. It is used only to pull values out of pasted text and tables. AI form design always uses the model Trialfold provides.
Who it suits
Teams with a capable computer they can leave on, some comfort with a command line, and a wish to pick the model themselves.

What you need

Your computer
LM Studio or Ollama installed, with one model downloaded. A recent model that supports structured JSON output works best, for example qwen2.5 or llama3.1.
A tunnel service
A free ngrok account and its command-line program. Similar tunnel services can also work.
Trialfold
An account where AI data entry is available. To send patient data, your organization administrator must allow it.

How to connect

1. Start the model server
In LM Studio, start the local server from the developer view; it opens on port 1234. Ollama runs in the background on port 11434 once installed. Load the model you want and check that it answers inside the app first.
2. Make a tunnel with ngrok
Sign in to ngrok and claim the free static domain from its dashboard. With a static domain your address stays the same after restarts. Add the static-domain option the dashboard shows to the command. LM Studio: ngrok http 1234. Ollama: ngrok http 11434 --host-header="localhost:11434". The --host-header="localhost:11434" part on the Ollama line rewrites the request's host name so Ollama accepts it.
3. Put a password on the tunnel (required)
Add --basic-auth "user:password" to the same command, choosing your own user name and a long password. LM Studio: ngrok http 1234 --basic-auth "user:password". Ollama: ngrok http 11434 --host-header="localhost:11434" --basic-auth "user:password". If you skip this step, anyone who learns the address can use the model on your computer.
4. Paste it into Trialfold
Copy the https address ngrok prints. In Trialfold, go to Settings, then Account, then the own-computer AI model section. Paste the address, enter the same user:password you set on the tunnel in the authentication field, and press the connection test button. When it passes, pick the model from the list and save. Button names follow your display language.

If it does not work

The test says it cannot reach the address
Check that the ngrok window is still running, that the LM Studio or Ollama server is on, and that the port is right. The tunnel also drops when the computer goes to sleep, so turn sleep mode off.
The test says authentication failed
The user:password you used in the ngrok command and the value in Trialfold's authentication field must match character for character.
The test says the model does not support structured output
The model has to support JSON-schema structured output. Switch to a recent qwen2.5 or llama3.1, which do.
It fails on a hospital or company network
Some institutional networks block tunnel services. Use a computer on another connection, or ask your IT staff.
The results are not accurate
Small models can misread or miss values. A person must always review and confirm what the AI filled in.

Privacy and support

Where patient data travels
With this feature, patient data passes through the tunnel provider (for example ngrok) on its way to your computer. Patient data can be sent only if your organization administrator has allowed AI use, and the computer must stay on.
Support scope
On personal plans, support covers this guide and the connection test. Institution plans may include setup help in the quote.