A decision-driven language for training, evaluating and governing AI models
A domain-specific language (DSL) designed for autonomous AI pipelines with built-in decision, control, monitoring and governance capabilities
OktoScript is a decision-driven language created by OktoSeek AI to design, train, evaluate, control and govern AI models end-to-end.
It goes far beyond a simple training script. OktoScript introduces native intelligence, autonomous decision-making and behavioral control into the AI development lifecycle.
OktoScript uses the file extension .okt and is executed by the OktoEngine, which is integrated into the OktoSeek IDE. This allows you to define complete AI training pipelines with built-in decision logic using a simple, declarative syntax.
Currently in version 1.2, OktoScript is the official language of the OktoSeek ecosystem, used by OktoSeek IDE, OktoEngine, VS Code Extension, and various AI development tools.
Get started with OktoScript in just 5 minutes. Follow these simple steps:
Create a file named train.okt:
Create dataset/train.jsonl:
That's it! Your model will be trained and exported automatically. Read the full guide →
OktoScript is a decision-driven language created by OktoSeek AI to design, train, evaluate, control and govern AI models end-to-end.
It allows you to define:
All using clear, readable and structured commands, built specifically for AI engineering.
Traditional AI development is reactive.
You manually monitor metrics, fix problems and restart training.
OktoScript is proactive.
It allows the model to:
In other words, OktoScript doesn't just train models — it governs intelligence.
OktoScript is perfect for various AI development scenarios:
Create intelligent chatbots for customer service, support, or entertainment.
Build vision models for object detection, image classification, or visual understanding.
Fine-tune LLMs with checkpoint resume, custom callbacks, and advanced configurations.
See: finetuning-llm.okt example
Build QA systems with embeddings and similarity search for semantic retrieval.
See: qa-embeddings.okt example
Create recommendation engines for e-commerce, content platforms, or personalized experiences.
Every OktoScript file (.okt) follows this general structure:
Required blocks: PROJECT, DATASET, MODEL, TRAIN
Optional blocks: EVALUATE, INFER, EXPORT, DEPLOY
The PROJECT block defines your project metadata, including name, description, author, and version.
Available fields:
PROJECT - Project name (required)DESCRIPTION - Project description (optional)VERSION - Version string (optional)AUTHOR - Author name (optional)TAGS - List of tags (optional)The DATASET block defines your training data, including paths, format, type, and language.
Supported formats: JSONL, CSV, TXT, Parquet, Image+Caption, QA, Instruction, Multi-modal
Supported types: classification, generation, qa, chat, vision, regression
Supported languages: en, pt, es, fr, multilingual
The MODEL block defines your base model, architecture, parameters, and precision settings. It can optionally include an ADAPTER sub-block to apply parameter-efficient fine-tuning methods such as LoRA, QLoRA, PEFT, or other adapters.
Available fields:
name - Model name (optional)base - Base model name (required)architecture - transformer, cnn, rnn, diffusion, vision-transformerparameters - Model size (e.g., 120M, 7B)context_window - Maximum context lengthprecision - fp32, fp16, int8, int4device - cuda, cpu, mps, autoADAPTER - LoRA/PEFT adapter configuration (optional)ADAPTER types: lora, qlora, adapter, peft
The TRAIN block is one of the most important blocks. It defines all training hyperparameters, optimizer settings, and training strategy.
Key parameters:
epochs - Number of training epochsbatch_size - Batch size for traininglearning_rate - Learning rateoptimizer - adam, adamw, sgd, rmspropscheduler - linear, cosine, stepdevice - cpu, cuda, mpsearly_stopping - Enable early stoppingThe EVALUATE block defines which metrics to calculate during evaluation.
Supported metrics: loss, accuracy, perplexity, precision, recall, f1, bleu, rouge, mae, mse, cosine_similarity, token_efficiency, response_coherence, hallucination_score
The CONTROL block enables logical, conditional, event-based, and metric-based decisions during training and inference. It introduces a cognitive-level abstraction that allows AI models to take decisions, self-adjust, and self-regulate in a declarative and clean way.
OktoScript enables true declarative AI governance. CONTROL blocks can contain nested conditions and nested event triggers, making it a unique declarative decision-making language in the market.
on_step_end - Executed at the end of each training stepon_epoch_end - Executed at the end of each epochvalidate_every - Execute validation every X stepson_memory_low - Triggered when GPU/RAM is lowon_nan - Triggered when NaN values are detectedon_plateau - Triggered when loss is stagnantIF, WHEN, EVERY, SET, STOP, LOG, SAVE, RETRY, REGENERATE, STOP_TRAINING, DECREASE, INCREASE
The MONITOR block tracks ANY available training or system metric. It supports all native and custom metrics, including loss, accuracy, GPU usage, throughput, latency, confidence, and more.
The GUARD block defines safety rules during generation and training. The engine knows exactly what to prevent, how to detect violations, and what action to take.
Detection methods: classifier, embedding, regex, rule_engine, ml_model
The BEHAVIOR block defines how the model should behave in chat/inference. It sets personality, verbosity, language, and content restrictions.
Personality types: professional, friendly, assistant, casual, formal, creative
The INFERENCE block defines how the model behaves during inference, prediction, or interactive chat. It supports multiple modes, format templates, and nested CONTROL logic.
Supported modes: chat, intent, translate, classify, custom
Format variables: {input}, {context}, {labels}
Note: The INFER block has been replaced by the more powerful INFERENCE block in v1.2. See INFERENCE Block above.
The EXPORT block defines which formats to export your trained model to.
You can export to multiple formats simultaneously. The model will be saved in the specified path directory.
The DEPLOY block defines deployment targets for your model. The engine will create the server, generate routes, export in the required format, and configure limits and authentication.
Supported targets: local, cloud, edge, api, android, ios, web, desktop
Protocols: http, https, grpc, ws
Formats: onnx, tflite, gguf, pt, okm
The SECURITY block defines security measures for input validation, output validation, rate limiting, and encryption.
OktoScript supports multiple export formats for different use cases:
| Format | Purpose | Compatibility |
|---|---|---|
.onnx |
Universal inference, production-ready | All platforms |
.gguf |
Local inference, Ollama, Llama.cpp | Local deployment |
.safetensors |
HuggingFace, research, training | Standard ML tools |
.tflite |
Mobile deployment | Android, iOS (future) |
| Format | Purpose | Benefits |
|---|---|---|
.okm |
OktoModel - Optimized for OktoSeek SDK | Flutter plugins, mobile apps, exclusive tools |
.okx |
OktoBundle - Mobile + Edge package | iOS, Android, Edge AI deployment |
.okm and .okx formats are optional and optimized for the OktoSeek ecosystem. They provide better integration with OktoSeek Flutter SDK, mobile apps, and exclusive tools. You can always export to standard formats (ONNX, GGUF, SafeTensors) for universal compatibility.
Why use OktoModel (.okm)?
The OktoEngine CLI is minimal by design. All intelligence lives in the .okt file. The terminal is just the execution port.
Initialize project:
Validate syntax:
Train a model:
Evaluate a model:
Export model:
Convert model formats:
Direct inference (single input/output):
Automatically respects BEHAVIOR, GUARD, INFERENCE, and CONTROL blocks.
Interactive chat mode:
Opens an interactive loop. Uses prompt_style from BEHAVIOR, enforces GUARD rules, and supports session context. Type '/exit' to quit.
Compare two models:
Compares latency, accuracy, loss, and resource usage. Perfect for A/B testing.
View historical logs:
Shows loss per epoch, validation loss, accuracy, CPU/GPU/RAM usage, and decisions made by CONTROL block.
Auto-tune training:
Uses CONTROL block to auto-adjust training parameters (learning rate, batch size, early stopping). This is unique in the market.
List resources:
System diagnostics:
Other commands:
Here's a complete, working OktoScript v1.2 example demonstrating all new features:
To execute this file:
The OktoEngine will automatically:
This example demonstrates: CONTROL with nested blocks, MONITOR with notify_if, GUARD with multiple detection methods, BEHAVIOR with prompt_style, INFERENCE with nested CONTROL, SECURITY with validation, and DEPLOY with full configuration.
For experienced developers, here are complex examples demonstrating advanced features:
New examples demonstrating CONTROL blocks, nested logic, and autonomous decision-making:
Complete example with checkpoint resume, custom hooks, and multiple export formats:
Features demonstrated:
Production-ready vision system with augmentation and ONNX export:
Question-answering system with semantic search capabilities:
For the complete formal grammar specification with all constraints, validation rules, and advanced features:
inheritReady to start using OktoScript? Check out our examples and documentation:
OktoScript is developed and maintained by OktoSeek AI.
Note: OktoScript is designed for advanced users, engineers, and researchers. For no-code AI creation, use the OktoSeek IDE visual interface.