Software-Defined PLC Code Generator with AI SDK and Vercel AI Gateway
Translating operational logic into IEC 61131-3 Structured Text requires domain expertise and slows commissioning. Develop a software-driven automation generator using Vercel AI Gateway and the AI SDK to produce validated PLC code from plain text specifications. Reduce syntax errors to under 2% and streamline simulation validation.
What you are building
The core problem, expected build, and operating context for this challenge.
Build a web-connected software-defined automation generator with the Vercel AI SDK and AI Gateway to write and validate IEC 61131-3 Structured Text.
How work is evaluated
Test generated Structured Text PLC code against an IEC 61131-3 syntax parser and functional state transition tests.
Challenge datasets
Public datasets, plus the private datasets you have access to.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
syntax_validity
Code contains no syntax or missing keyword errors
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
error_rate
Percentage of invalid ST constructs • target: 0.02 • range: 0-1
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
What you should walk away with
Configure Vercel AI SDK with Vercel AI Gateway for robust LLM routing
Implement prompt templates for standard IEC 61131-3 Structured Text generation
Build automated syntax validation harnesses for PLC logic execution
Deploy interactive streaming interface for control engineers
Reference links and supporting material
Prompts detailing standard industrial control routines (conveyor, mixer, batching valve, pump sequencing).
Challenge setup
Test generated Structured Text PLC code against an IEC 61131-3 syntax parser and functional state transition tests.
Challenge input
Natural language prompt detailing operational logic requirements
AI SDK
TypeScript framework for generative AI apps.
Vercel AI Gateway
Routing and fallback gateway for model access.
Evaluated output
String containing valid IEC 61131-3 Structured Text code
- Code contains no syntax or missing keyword errors
- Percentage of invalid ST constructs • target: 0.02 • range: 0-1
- Benchmark: PLC Code Generation Benchmark
- Error Rate target: 2%
- 1 public reference case
- JavaScript execution harness
- javascript sandbox (unavailable on Versalist)
Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.
View technical recipe
Configured tools
- Vercel AI SDK · Optional
- Vercel AI Gateway · Required
- Vercel AI Gateway · Required
- Vercel AI SDK · Optional
Evaluation contract
- syntax_validity · Weight 1
- error_rate · Weight 1
Metrics
- error_rate · Target 0.02
Benchmarks
- PLC Code Generation Benchmark
- general
Reference cases
- 1 public reference case
Workflow tasks
- Task 1
Input: Natural language prompt detailing operational logic requirements
Output: String containing valid IEC 61131-3 Structured Text code
Execution harness: JavaScript
Evaluation tools
- AI SDK · Application Framework
- Vercel AI Gateway · API Gateway
Recipe freeze marker
No recipe freeze time is recorded.