How the TIA Portal
AI Copilot Works
A transparent look at the architecture behind T-IA Connect's AI assistant. Understand how your messages become TIA Portal actions through intelligent tool selection and LLM orchestration.
Overview
The T-IA Connect Copilot is an integrated AI assistant that controls TIA Portal via tools (function calling). You send a message in natural language, the LLM decides which tools to call, and T-IA Connect executes the corresponding actions in TIA Portal.
The entire process runs locally on your machine. Your API keys are encrypted via Windows DPAPI, never logged, and never transmitted to third parties. T-IA Connect contacts LLM providers directly with no proxy or relay server.
Data Flow
User
Sends a natural language message
T-IA Connect
Builds context, selects tools, calls LLM
LLM Provider
Analyzes and returns tool calls
TIA Portal
Executes actions via Openness API
Supported LLM Providers
T-IA Connect is provider-agnostic. Bring your own API key and choose your preferred provider.
| Provider | Default Model | Authentication |
|---|---|---|
| OpenAI | gpt-4o | Bearer token |
| Claude (Anthropic) | claude-sonnet-4-20250514 | x-api-key header |
| Gemini (Google) | gemini-1.5-flash | API key in query |
| Groq | llama-3.3-70b-versatile | Bearer token |
| Custom | Ollama, vLLM, etc. | Optional Bearer token |
API Key Security
- ✓Keys stored locally, encrypted via Windows DPAPI
- ✓Direct connection to providers, no proxy or relay
- ✓Keys are never logged or transmitted to third parties
- ✓Custom endpoints supported (Azure OpenAI, enterprise proxies)
Smart Tool Selection
With ~400 tools available, sending all of them to every request would be costly and counterproductive. T-IA Connect solves this with contextual category selection.
The Challenge
- ⚠Each tool definition consumes ~50 input tokens
- ⚠Some providers limit tools to 128 max (OpenAI)
- ⚠Too many tools can confuse the LLM
The Solution: Contextual Categories
T-IA Connect analyzes your message and activates only the relevant tool categories.
Always Included
Core (~34 tools): project management, devices, export/import
Knowledge (~21 tools): documentation, tips, analysis, memory
| Category | Tools | Trigger Keywords |
|---|---|---|
| Blocks | ~31 | block, fb, fc, ob, db, scl, lad, compile, program, code... |
| Tags | ~16 | tag, watch, force, variable, address, diagnostic... |
| HMI | ~51 | hmi, screen, panel, wincc, display, visualization... |
| Hardware | ~24 | hardware, module, rack, cpu, slot, profinet, gsd... |
| Simulation | ~23 | plcsim, simul, runtime, power_on, instance... |
| Security | ~21 | security, password, protection, opcua, webserver... |
| UDT | ~23 | udt, type, struct, data_type... |
| Online | ~10 | online, offline, download, upload, go_online... |
| Advanced | ~66 | fds, graph, sfc, safety, blueprint, motion, alarm... |
| Infrastructure | ~54 | report, vcs, git, test, library, codesys... |
Concrete Examples
"Create a FB Motor"
core + knowledge + blocks
~86 tools
"Configure PLCSim"
core + knowledge + simulation
~78 tools
"Add an HMI screen"
core + knowledge + hmi
~106 tools
Sticky Context
If your message contains no keywords (e.g. "yes", "continue", "do it"), T-IA Connect reuses the categories from the previous message. This enables natural conversations without losing context.
Execution Loop
The Copilot works in a loop: the LLM can call multiple tools successively before responding to the user.
Anti-Infinite Loop Protections
| Protection | Threshold | Behavior |
|---|---|---|
| Identical consecutive calls | 2 | Stops the loop |
| Consecutive failures (same tool) | 3 | Stops the loop |
| Max absolute iterations | 200 | Safety net |
| LLM error retries | 2 | Then failure |
| Empty response retries | 3 | Then failure |
Token Consumption
Understand what consumes tokens and how T-IA Connect optimizes costs.
| Component | Estimated Tokens | Frequency |
|---|---|---|
| System prompt (instructions) | ~2,000-3,000 | Each message |
| Project context (devices, blocks) | ~500-2,000 | Each message |
| Tool definitions (128 max) | ~5,000-8,000 | Each message |
| Conversation history | ~1,000-10,000 | Growing |
| User message | ~50-500 | Each message |
| Typical total input | ~10,000-20,000 | Per message |
| LLM response | ~200-2,000 | Per message |
Cost Estimate
For a typical message with GPT-4o (OpenAI pricing, April 2026):
A full exchange with tool calling (2-3 LLM iterations) costs approximately $0.10-0.15.
Automatic Optimizations
- Contextual selection: only relevant tools are sent (not all 400)
- Auto-compaction: when history exceeds ~200,000 characters, old messages are automatically summarized
- Limited history: max 20 messages and 32,000 characters kept in context
- 128 tool cap: limits the fixed cost of tool definitions
Multimodal Support
The Copilot can process images and PDF documents alongside text.
Images
Images sent to the Copilot are transmitted to the LLM in base64 (vision format). Useful for analyzing program screenshots, identifying visual errors, or describing schematics.
PDFs (Design Specification)
PDFs are processed via the CDC (Custom Design Companion) system: text extraction, chunking (1,500 chars with 200 overlap), table of contents injected into the prompt, and on-demand chunk access via dedicated tools. This avoids sending the entire PDF into context.
Autonomous Mode
The autonomous mode allows the Copilot to execute action sequences without user confirmation.
| Aspect | Interactive | Autonomous |
|---|---|---|
| Confirmations | Required before destructive actions | Skipped |
| System prompt | Full (rules, formatting, interactive) | Compact (rules, scope) |
| Early stop detection | No | Yes (max 3 retries) |
Rate Limiting
T-IA Connect applies separate quotas for each access channel.
Free Tools (Not Counted)
Read-only tools do not consume quota: list_*, get_documentation, get_llm_tips, discovery and status tools.
Real-Time Communication
The Copilot uses SignalR for live updates during execution.
onAssistantResponseChat displayonToolExecution"Thinking..." indicatoronTokenUsageToken counteronStatusUpdated"Sending to Claude..."Compatible Models
Detailed compatibility per provider.
OpenAI
Recommended: gpt-4o, gpt-4o-mini, gpt-4-turbo
Not compatible: o1, o3-mini (use Responses API, not Chat Completions)
Claude (Anthropic)
Recommended: claude-sonnet-4-20250514, claude-haiku-4-5-20251001, claude-opus-4-6
All Claude models are compatible
Gemini (Google)
Recommended: gemini-1.5-pro, gemini-1.5-flash, gemini-2.0-flash
Auto-filter excludes non-chat models (embedding, vision-only)
Groq
Recommended: llama-3.3-70b-versatile, mixtral-8x7b
Note: free tier may be insufficient for 128 tools
Custom (Ollama, vLLM)
Any model supporting OpenAI-format function calling
Automatic detection of "fake tool calls" (models returning JSON as text)
Dual Model Routing
For Custom providers, T-IA Connect supports two models: a reasoning model for analysis/planning and a code model for SCL/LAD generation. The switch is automatic based on the tool type being executed.
Key Figures
Frequently Asked Questions
Does T-IA Connect send my PLC code to the cloud?
Only when you use a cloud LLM provider (OpenAI, Claude, Gemini). Your messages and project context are sent to the provider you chose. For maximum privacy, use Ollama with a local model and nothing leaves your machine.
How much does the AI cost per message?
With GPT-4o, a typical message costs about $0.04 and a full exchange with tool calling costs $0.10-0.15. You pay the LLM provider directly using your own API key.
Can the Copilot damage my TIA Portal project?
In interactive mode, the Copilot asks for confirmation before destructive actions. Anti-loop protections prevent runaway tool execution. You can also stop execution at any time.
Which LLM model should I choose?
For best results, use GPT-4o or Claude Sonnet. For budget-conscious usage, GPT-4o-mini or Gemini Flash work well for simpler tasks. For full privacy, use Ollama with a local model like Llama 3.
Related Pages
TIA Portal AI Assistant
Discover all the capabilities of the integrated AI assistant.
Read moreAI PLC Code Generation
Learn how AI generates SCL, LAD, and STL code for Siemens PLCs.
Read moreMCP Server for TIA Portal
Use T-IA Connect as an MCP server with Claude Desktop or Cursor.
Read morevs Siemens Industrial Copilot
Compare T-IA Connect with Siemens' official AI solution.
Read more