OktoScript
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.
Built by OktoSeek AI for the OktoSeek ecosystem
OktoSeek Homepage β’ Hugging Face β’ Twitter β’ YouTube
Table of Contents
- What is OktoScript?
- Quick Start
- Official Folder Structure
- Basic Example
- Supported Dataset Formats
- Supported Metrics
- CLI Commands
- Training Pipeline
- OktoSeek Internal Formats
- Integration Targets
- VS Code Extension
- Documentation
- FAQ
- License
- Contact
π Quick Start
New to OktoScript? Get started in 5 minutes:
- Install VS Code Extension: Install OktoScript Extension (recommended for best experience)
- Read the guide:
docs/GETTING_STARTED.md - Try an example:
examples/basic.okt - Validate:
okto validate examples/basic.okt - Train:
okto train examples/basic.okt
π Full documentation: docs/grammar.md
π Validation rules: VALIDATION_RULES.md
π What is OktoScript?
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.
It allows you to define:
- How a model is trained
- How it should behave
- How it should react to problems
- How and when it should stop, adapt or improve itself
All using clear, readable and structured commands, built specifically for AI engineering.
Designed to be:
- β Human-readable β Intuitive syntax that engineers and non-engineers can understand
- β Decision-driven β Built-in CONTROL logic (IF, WHEN, SET, STOP, LOG, SAVEβ¦)
- β Strongly structured β Validated, deterministic and reproducible pipelines
- β Dataset-centered β The data is the starting point of all intelligence
- β Training-aware β Created specifically for AI training and optimization
- β Behavior-aware β Control personality, language, restrictions and style
- β Self-monitoring β Tracks metrics, detects anomalies and adapts automatically
- β Safe by design β Integrated GUARD and SECURITY layers
- β Expandable β Extensible through OktoEngine and custom modules
OktoScript is the official language of the OktoSeek ecosystem and is used by:
- π― OktoSeek IDE β Visual AI development and experimentation
- βοΈ OktoEngine β Core execution and decision engine
- π OktoScript Web Editor β Online editor with syntax validation and autocomplete (Try it now β)
- π VS Code Extension β Official VS Code extension with syntax highlighting, autocomplete, snippets, and validation (Install now β)
- π Autonomous pipelines β Training, control, evaluation and inference
- π€ AI agents β Controlled, monitored intelligent systems
- π± Flutter / API deployments β Cross-platform model integration
Why OktoScript is different
Traditional AI development is reactive.
You manually monitor metrics, fix problems and restart training.
OktoScript is proactive.
It allows the model to:
- Detect instability
- Reduce or increase learning rate automatically
- Adapt batch size based on GPU memory
- Stop when performance drops
- Save only the best checkpoints
- Apply rules when patterns are detected
In other words, OktoScript doesn't just train models β it governs intelligence.
π Official Folder Structure
Every OktoScript project must follow this structure:
/my-awesome-model
βββ okt.yaml
βββ dataset/
β βββ train.jsonl
β βββ val.jsonl
β βββ test.jsonl
βββ scripts/
β βββ train.okt
βββ runs/
β βββ my-model/
β βββ checkpoint-100/
β β βββ model.safetensors
β βββ tokenizer.json
β βββ training_logs.json
β βββ metrics.json
βββ export/
βββ model.gguf
βββ model.onnx
βββ model.okm
v1.1 Optional Folders:
/runs/
βββ my-model/
βββ logs/
β βββ system.json # MONITOR output (v1.1+)
βββ lora/ # LoRA adapters (v1.1+)
βββ adapter.safetensors
π§ OktoScript β Basic Example
Example (v1.0 - Standard Training):
PROJECT "PizzaBot"
DESCRIPTION "AI specialized in pizza restaurant service"
ENV {
accelerator: "gpu"
min_memory: "8GB"
precision: "fp16"
backend: "oktoseek"
install_missing: true
}
DATASET {
train: "dataset/train.jsonl"
validation: "dataset/val.jsonl"
}
MODEL {
base: "oktoseek/pizza-small"
}
TRAIN {
epochs: 5
batch_size: 32
device: "auto"
}
EXPORT {
format: ["gguf", "onnx", "okm"]
path: "export/"
}
Example (v1.1 - LoRA Fine-tuning with Dataset Mixing):
# okto_version: "1.1"
PROJECT "PizzaBot"
DESCRIPTION "AI specialized in pizza restaurant service"
ENV {
accelerator: "gpu"
min_memory: "8GB"
precision: "fp16"
backend: "oktoseek"
install_missing: true
}
DATASET {
mix_datasets: [
{ path: "dataset/base.jsonl", weight: 70 },
{ path: "dataset/extra.jsonl", weight: 30 }
]
dataset_percent: 80
sampling: "weighted"
}
MODEL {
base: "oktoseek/pizza-small"
}
FT_LORA {
base_model: "oktoseek/pizza-small"
lora_rank: 8
lora_alpha: 32
epochs: 3
batch_size: 16
learning_rate: 0.00003
device: "auto"
}
MONITOR {
level: "full"
log_metrics: ["loss", "accuracy"]
log_system: ["gpu_memory_used", "cpu_usage"]
refresh_interval: 2s
dashboard: true
}
EXPORT {
format: ["okm", "onnx"]
path: "export/"
}
π Full grammar specification available in /docs/grammar.md
π What's New in v1.2
OktoScript v1.2 adds powerful new features while maintaining 100% backward compatibility with v1.0 and v1.1:
- β Nested CONTROL Blocks - Support for nested IF/WHEN/EVERY statements inside event hooks
- β
Enhanced BEHAVIOR - Added
modeandprompt_stylefor better control - β
Enhanced GUARD - Added
detect_usingand additional prevention types - β
Enhanced DEPLOY - Added
host,protocol, andformatoptions - β Enhanced SECURITY - Added input/output validation, rate limiting, and encryption
What's New in v1.1
OktoScript v1.1 adds powerful new features while maintaining 100% backward compatibility with v1.0:
- β
LoRA Fine-tuning - Efficient fine-tuning with
FT_LORAblock - β Dataset Mixing - Combine multiple datasets with weighted sampling
- β
System Monitoring - Advanced telemetry with
MONITORblock - β Version Declaration - Specify OktoScript version in your files
- β MODEL Adapters - LoRA/PEFT adapter support in MODEL block
- β Enhanced INFERENCE - Rich inference configuration with format templates and nested CONTROL
- β CONTROL Block - Cognitive-level decision engine for training and inference
- β GUARD Block - Safety and ethics protection
- β BEHAVIOR Block - Model personality and behavior configuration
- β EXPLORER Block - AutoML-style hyperparameter exploration
- β STABILITY Block - Training stability and safety controls
- β Boolean Support - Native true/false values throughout the language
π More examples and use cases: See /examples/ for complete examples including:
Basic Examples:
basic.okt- Minimal examplechatbot.okt- Conversational AIcomputer_vision.okt- Image classificationrecommender.okt- Recommendation systems
Advanced Examples:
finetuning-llm.okt- Fine-tuning LLM with checkpoints and hooksvision-pipeline.okt- Complete vision pipeline with augmentationqa-embeddings.okt- QA system with embeddings
v1.1 Examples:
lora-finetuning.okt- LoRA fine-tuning with dataset mixingdataset-mixing.okt- Training with multiple weighted datasets
Complete Projects:
pizzabot/- Complete project example with full structure
π Supported Dataset Formats
- β JSONL - Line-delimited JSON
- β CSV - Comma-separated values
- β TXT - Plain text files
- β Parquet - Columnar storage
- β Image + Caption - Vision datasets
- β Question & Answer (QA) - Q&A pairs
- β Instruction datasets - Instruction-following
- β
Custom Field Names (v1.2+) - Define
input_fieldandoutput_fieldfor any column names - β Multi-modal - (future support)
Example (JSONL):
{"input":"What flavors do you have?","output":"We offer Margherita, Pepperoni and Four Cheese."}
{"input":"Do you deliver?","output":"Yes, delivery is available in your region."}
Custom Field Names (v1.2+)
OktoScript now supports custom field names in datasets, allowing you to work with any column names:
DATASET {
train: "dataset/train.jsonl"
input_field: "question" # Custom input column name
output_field: "answer" # Custom output column name
}
If not specified, OktoEngine automatically detects input/output or input/target fields.
π Learn more about custom fields β
π Supported Metrics
- β Accuracy - Classification accuracy
- β Loss - Training/validation loss
- β Perplexity - Language model perplexity
- β F1-Score - F1 metric
- β BLEU - Translation quality
- β ROUGE-L - Summarization quality
- β MAE / MSE - Regression metrics
- β Cosine Similarity - Embedding similarity
- β Token Efficiency - Token usage optimization
- β Response Coherence - Response quality
- β Hallucination Score - (experimental)
Define custom metrics:
METRICS {
custom "toxicity_score"
custom "context_alignment"
}
π₯οΈ CLI Commands
The OktoEngine CLI is minimal by design. All intelligence lives in the .okt file. The terminal is just the execution port.
π Web Editor Command
Open OktoScript files in the web editor:
# Open editor with a specific file
okto web --file scripts/train.okt
# Open empty editor
okto web
The okto web command opens the OktoScript Web Editor in your browser. When you provide a file path, it automatically loads the file content for editing. The editor features:
- Smart Autocomplete β Context-aware suggestions based on the current block (ENV, DATASET, MODEL, TRAIN, etc.)
- Real-time Syntax Validation β Detects errors like nested blocks (e.g., PROJECT inside DATASET) and missing braces
- Auto-save to Local β When you load a file, it saves back to the same location automatically
- Full Integration β Seamlessly connects with OktoEngine for validation and training
Perfect for quick edits, syntax testing, and experimenting with OktoScript configurations!
Core Commands
Initialize a project:
okto init
Validate syntax:
okto validate script.okt
Train a model:
okto train script.okt
Evaluate a model:
okto eval script.okt
Export model:
okto export script.okt
Convert model formats:
okto convert --input <model_path> --from <format> --to <format> --output <output_path>
Supported formats:
| From / To | Usage |
|---|---|
pt, bin |
PyTorch |
onnx |
Web / Interoperability |
tflite |
Mobile (Android / iOS) |
gguf |
Local LLMs (llama.cpp) |
okm |
Okto Model Format |
safetensors |
Safe and fast |
Convert examples:
# PyTorch β GGUF (local inference)
okto convert --input model.pt --from pt --to gguf --output model.gguf
# PyTorch β TFLite (mobile)
okto convert --input model.pt --from pt --to tflite --output model.tflite
# PyTorch β ONNX (web)
okto convert --input model.pt --from pt --to onnx --output model.onnx
List resources:
okto list projects
okto list models
okto list datasets
okto list exports
System diagnostics:
okto doctor
# Shows: GPU, CUDA, RAM, Drivers, Disks, Recommendations
Inference Commands
Direct inference (single input/output):
okto infer --model <model_path> --text "<input>"
Example:
okto infer --model models/pizzabot.okm --text "Good evening, I want a pizza"
Automatically respects:
BEHAVIORblockGUARDblockINFERENCEblockCONTROLblock (if defined)
Interactive chat mode:
okto chat --model <model_path>
Opens an interactive loop:
π’ Okto Chat started (type 'exit' to quit)
You: hi
Bot: Hello! How can I help you?
You: what flavors do you have?
Bot: We have...
You: exit
π΄ Session ended
This command:
- Uses
prompt_stylefrom BEHAVIOR - Uses
BEHAVIORsettings - Respects
GUARDrules - Can use MEMORY in the future
Advanced Commands
Compare two models:
okto compare <model1> <model2>
Example:
okto compare models/pizza_v1.okm models/pizza_v2.okm
Expected output:
Latency: V2 - 23% faster
Accuracy: V1 - 4% better
Loss: V2 - lower
Recommendation: V2
Perfect for A/B testing.
View historical logs:
okto logs <model_or_run_id>
Example:
okto logs pizzabot_v1
Shows:
- Loss per epoch
- Validation loss
- Accuracy
- CPU/GPU/RAM usage
- Decisions made (CONTROL block)
Auto-tune training:
okto tune script.okt
Uses the CONTROL block to auto-adjust training based on metrics. Can:
- Adjust learning rate
- Change batch size
- Activate early stopping
- Balance classes
This is unique in the market.
Exit interactive mode:
okto exit
Used to exit chat, interactive mode, or session context.
Utility Commands
okto upgrade # Update OktoEngine
okto about # Show about information
okto --version # Show version
Quick Examples
# Validate and train
okto validate examples/basic.okt
okto train examples/chatbot.okt
# Evaluate and export
okto eval examples/recommender.okt
okto export examples/computer_vision.okt
# Inference
okto infer --model models/bot.okm --text "Hello"
okto chat --model models/bot.okm
π Training Pipeline
- Load dataset - Parse and validate input data
- Tokenize & validate - Prepare data for training
- Initialize model - Load base model and configuration
- Train loop - Execute training epochs
- Calculate metrics - Evaluate model performance
- Export selected models - Generate output formats
- Generate final report - Create training summary
Each run generates logs at:
runs/my-model/training_logs.json
runs/my-model/metrics.json
π Export Formats
Standard Formats
| 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) |
OktoSeek Optimized Formats
| 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 |
π‘ Note:
.okmand.okxformats 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)?
- β Optimized for OktoSeek Flutter SDK
- β Better performance on mobile devices
- β Access to exclusive OktoSeek tools and plugins
- β Seamless integration with OktoSeek ecosystem
- β Support for iOS and Android apps
See /examples/ for examples using different export formats.
βοΈ Integration Targets
- β Flutter - Mobile applications
- β REST API - Web services
- β Edge AI - Edge devices
- β Desktop - Native applications
- β Web - Browser-based
- β Mobile - iOS/Android
- β IoT - Internet of Things
- β Robotics - Robotic systems
π¦ VS Code Extension
Official OktoScript extension for Visual Studio Code is now available!
Features
- β¨ Syntax Highlighting - Beautiful color-coded OktoScript syntax for all blocks, keywords, and values
- π Smart Autocomplete - Context-aware suggestions based on the current block (ENV, DATASET, MODEL, TRAIN, etc.)
- π Code Snippets - Quick templates for all OktoScript blocks (PROJECT, MODEL, TRAIN, CONTROL, INFERENCE, FT_LORA, etc.)
- β
Syntax Validation - Validate your
.oktfiles using OktoEngine directly from VS Code - π Web Editor Integration - Open files directly in the OktoScript Web Editor with one command
- π― Intelligent Suggestions - Autocomplete triggers automatically on typing or pressing space
- π Block Templates - Selecting a block from autocomplete generates a complete template (e.g.,
MODEL { })
Installation
From VS Code Marketplace:
- Open VS Code
- Press
Ctrl+Shift+X(orCmd+Shift+Xon Mac) to open Extensions - Search for "OktoScript"
- Click "Install"
Or use command line:
code --install-extension OktoSeekAI.oktoscript
Direct Link: Install OktoScript Extension
Usage
- Syntax Highlighting: Open any
.oktfile and enjoy beautiful syntax highlighting - Autocomplete: Start typing a block name (e.g.,
MODEL,TRAIN) and see contextual suggestions - Snippets: Type block names and press
Tabto insert complete templates - Validation: Press
Ctrl+Shift+Pβ "OktoScript: Validate current file" (requires OktoEngine) - Web Editor: Press
Ctrl+Shift+Pβ "OktoScript: Open in Web Editor" (requires OktoEngine)
π‘ Tip: The VS Code extension works seamlessly with the π OktoScript Web Editor. Both provide context-aware autocomplete, real-time syntax validation, and full integration with OktoEngine via the
okto webcommand!
π Documentation
Complete documentation for OktoScript:
- π Grammar Specification - Complete formal grammar with all constraints (v1.0 & v1.1)
- π Getting Started Guide - Your first 5 minutes with OktoScript
- β Validation Rules - Complete validation reference (updated for v1.1)
- β FAQ - Frequently Asked Questions - Common questions and detailed answers
- π‘ Examples - Working examples from basic to advanced
- π Changelog v1.1 - Complete list of v1.1 features
Advanced Topics
- π Model Inheritance - Reuse model configurations
- π Extension Points & Hooks - Custom Python/JS integration
- π Troubleshooting - Common issues and solutions
- βοΈ Complex Examples - Advanced use cases:
finetuning-llm.okt- Fine-tuning with checkpointsvision-pipeline.okt- Production vision systemsqa-embeddings.okt- Semantic search and retrievallora-finetuning.okt- LoRA fine-tuning (v1.1)dataset-mixing.okt- Dataset mixing (v1.1)
β Frequently Asked Questions (FAQ)
Have questions about OktoScript? Check out our comprehensive FAQ covering common questions from beginners to advanced users:
Common Questions:
- Why do I need MODEL and DATASET blocks with FT_LORA?
- What's the difference between FT_LORA and TRAIN?
- Does OktoScript replace Python?
- How do I use multiple datasets with weights?
- Can I use custom Python code?
- Is OktoScript a programming language or a DSL?
- And 15+ more detailed answers...
π Read the complete FAQ β
The FAQ covers technical details, design decisions, use cases, and best practices for using OktoScript effectively.
π§βπ Vision
"Knowledge must be shared between people so that we can create solutions we could never imagine."
β OktoSeek AI
π― Design Principles
OktoScript is built on the principle that AI development should be:
- Declarative - Describe what you want, not how to do it
- Self-aware - Models can monitor and adjust themselves
- Safe - Built-in guards against harmful outputs
- Adaptive - Automatic optimization and exploration
- Transparent - Clear, readable configuration files
- Powerful - Complex capabilities with simple syntax
The language evolves to support increasingly sophisticated AI behaviors while maintaining its core simplicity.
π Powered by OktoSeek AI
OktoScript is developed and maintained by OktoSeek AI.
- Official website: https://www.oktoseek.com
- GitHub: https://github.com/oktoseek
- Hugging Face: https://huggingface.co/OktoSeek
- Twitter: https://x.com/oktoseek
- YouTube: https://www.youtube.com/@Oktoseek
- Repository: https://github.com/oktoseek/oktoscript
π License
OktoScript is available for personal and commercial use at no cost.
However, OktoScript is a proprietary language owned by OktoSeek AI and may not be modified or used to create derivative languages, tools or interpreters.
See OKTOSCRIPT_LICENSE.md for complete license terms.
π€ Contributing
Contributions are welcome! We welcome bug reports, feature suggestions, documentation improvements, and example contributions. Please see CONTRIBUTING.md for guidelines.
Note: OktoScript is a proprietary language owned by OktoSeek AI. While we welcome contributions, you may not create derivative languages, tools, or interpreters based on OktoScript.
π§ Contact
If you have any questions, please raise an issue or contact us at service@oktoseek.com.
Made with β€οΈ by the OktoSeek AI team