Skip to content
← Blog
2026-06-09 · Updated 2026-09-22

Which LLM for TIA Portal?

There is no single best LLM for TIA Portal: complex blocks and refactorings go to a strong reasoning model (Claude, GPT or Gemini in their large variants), completion while you type to a fast coder model, confidential plants to a local model via Ollama. AnyAutomation Studio is therefore built multi-provider: you pick per message which model answers, instead of handing that decision to a vendor once.

Something else matters more than the model, though. The same model writes far better SCL when it can see the real tag names and data types of your project. Context decides, the model polishes.

Four ways to a model

Route Examples Requirement Where inference runs Good for
Sign-in at the provider Anthropic (Claude), OpenAI (ChatGPT), xAI (Grok), Qwen An existing subscription, browser login The provider's cloud Anyone who has the subscription anyway
Your own API key Google Gemini, OpenRouter, Mistral, Groq, DeepSeek and more A key from the provider's console The provider's cloud, billed by usage Free model choice, visible cost
Enterprise cloud Azure OpenAI, Google Vertex AI, AWS Bedrock Your company's own cloud account In your own cloud tenant Corporate IT with an existing contract
Local server Ollama, LM Studio, vLLM, SGLang Hardware with enough video memory On your own machine Confidential projects, working without a cloud

All four routes work from the Basic plan, and no request travels through an AnyAutomation server: you talk directly to the provider you chose, or to your own server.

Which model for which job

Models differ in reasoning power, speed, cost and privacy, and none leads everywhere. Three roles have settled in practice.

The strong model for hard cases. Designing a sequence, refactoring a grown FB, converting legacy STL to SCL, tracing a fault across several blocks: a large reasoning model pays off here, and so does a higher thinking level. On models that support it you set that level right next to the model name, from Off to High.

The fast model for typing. Inline completion offers grey ghost text as you write, which you accept with Tab. Latency counts here, not depth. Worth knowing: only providers with fill-in-the-middle code completion qualify, such as Mistral Codestral, DeepSeek or a local coder server. Chat-only subscriptions like ChatGPT, Claude or Gemini do not appear in that list, because they have no dedicated completion mode. So you run a chat model and a completion model side by side.

The local model for confidential plants. Via Ollama, LM Studio, vLLM or SGLang, inference runs entirely on your hardware. No key, no cloud, no project data leaving the building. Local models are usually weaker on complex logic than the large cloud models, but often perfectly sufficient for documentation, explanations and standard blocks, and for some approvals they are the only option.

Context window: bigger is not always better

Claude models with a very large context window let you choose between 1M and 200K next to the model name. The large window holds very long sessions in one piece, the smaller one caps usage because the conversation is summarized earlier. A long analysis across many blocks is worth the large window, everyday short tasks rarely are.

Why context beats the model

Research on PLC code generation consistently shows that the guardrails around the model matter more than the model name. The LLM4PLC pipeline put grammar checkers, compilers and verification around the model and raised the success rate from 47 to 72 percent, and expert-rated code quality from 2.25 to 7.75 out of 10. AutoPLC generates SCL for TIA Portal and ST for CODESYS, validates directly against the vendor IDE and reports over 90 percent compilation success on a 914-task benchmark. Agents4PLC builds the same closed loop of generation and verification with several agents.

Translated to daily work: a mid-sized model with project context, a diff preview, a compile and a unit test delivers more usable code than the strongest model in a browser tab with no project access. Studio reads the project over the official Openness API (TIA Portal V15 to V21) and carries generated code back into the project over the same API, only after your confirmation.

Privacy often decides before the model does

In many companies the approval comes before the choice. Three answers are common: cloud under your own contract with the provider, enterprise cloud in your own tenant (Azure OpenAI, Vertex AI, AWS Bedrock), or fully local. Anyone working for pharma, food or a machine builder with a strict NDA often ends up with the local model, which is why the question of the best LLM cannot be answered without the question of data flow.

Limits, whatever the model

No model replaces the review. Language models occasionally invent system blocks or parameters, assumptions about cycle time and peripherals belong checked, and safety-related logic is not generated: F-logic stays manual work with formal acceptance. A diff belongs in front of every import, a test behind it. More in the guide to AI in PLC programming; how the tools around the models differ is in the comparison of AI tools for PLC programming.

Frequently asked questions

Which LLM is best for TIA Portal?

None wins everywhere. For complex blocks and refactorings a strong reasoning model such as Claude, GPT or Gemini in its large variant, for completion while typing a fast coder model with fill-in-the-middle support, for confidential projects a local model via Ollama, LM Studio, vLLM or SGLang. More decisive than the model is that it sees the project context.

Can I use Claude, GPT and Gemini at the same time?

Yes. You set up several providers and pick per message in the model picker. On top of that, individual features can run on their own model, for example a fast one for inline completion and a strong one for chat.

Does an LLM for TIA Portal also run locally?

Yes, via Ollama, LM Studio, vLLM or SGLang on your own hardware. You enter the server address, and its models appear in the model picker. No API key is needed, and project data never leaves the machine.

Do I need a separate subscription for every model?

No. You can connect an existing subscription by signing in, use your own API key and pay by usage, or work locally with no key at all. For sign-in subscriptions Studio shows the usage and the next reset in the status bar.

What does the AI chat in Studio cost?

AI chat is included from the Basic plan, CHF 10 per month or CHF 110 per year; Pro is CHF 30 or 330, Pro+ CHF 50 or 550. The model provider's cost comes on top and runs directly through your key, a local model costs nothing extra. 30 days free to try.