A Complete Guide to Ollaya and Local Decision Models
Introduction
Chapter 1: What Is a Decision Model?
- The Problem LLMs Were Never Built to Solve
- Decision Models vs. Language Models: Different Jobs
- Why Structure Matters in AI Systems
- Enter the Jev Paradigm
- What You Will Learn From This Book
Chapter 2: Jev-Style Decision Models: From First Principles
- The Jev System: Origins and Purpose
- State, Questions and Choices: Core Primitives
- Typed Decisions and Probability Distributions
- Confidence, Calibration and Score Interpretation
- Single-Pass Inference and the No-Generation Constraint
- How Decision Models Avoid Hallucination by Design
Chapter 3: Architecture Comparison: Decision Models vs. LLMs
- Training Objectives and Loss Functions
- Output Spaces: Tokens vs. Typed Decisions
- Inference Behavior and Compute Patterns
- Latency, Throughput and Memory Usage
- Probability Interpretation and Calibration
- Hallucination, Determinism and Reliability
- Cost, Privacy and Operational Characteristics
- Summary: When to Use Each
Chapter 4: The Ollaya Project: Landscape and Positioning
- What Is Ollaya?
- Ollaya, Jev and TypeSafe: Mapping the Relationships
- Open Decision Models and Compatibility
- What “Jev-Style” and “Jev-Compatible” Actually Mean
- Project History, Community and Governance
- Getting Started Prerequisites
Chapter 5: Installing Ollaya
- Supported Operating Systems
- Hardware Requirements and Recommendations
- Installation via Install Script (Linux/macOS)
- Installation via Package Managers
- Docker and Containerized Installation
- Verifying Your Installation
- CPU vs. GPU Execution Setup
- Environment Variables and Server Configuration
- Troubleshooting Installation
- Next Steps
Chapter 6: Your First Local Decision Model
- Understanding the Model Registry
- Pulling Your First Model
- Running a Model with ollaya run
- Reading the Output: Decisions, Scores and Confidence
- Listing Installed Models
- Inspecting Model Details with show
- Stopping and Managing Running Models
- Interactive REPL Mode
- Removing Models
- Your First Custom Questions
Chapter 7: The Ollaya Command-Line Reference
- Command Overview
- The Pull Command: Fetching Models
- The Run Command: Inference Basics
- The List Command: Inventory Management
- The Show Command: Model Metadata
- The Ps and Stop Commands: Process Control
- The Create, Cp and Rm Commands: Lifecycle
- Environment Variables and Configuration
- Advanced Run Patterns
- Summary Table
Chapter 8: Modelfiles and Custom Model Configurations
- What Is a Modelfile?
- Modelfile Syntax and Structure
- Defining Question Sets and Choice Spaces
- Building a Custom Model from Scratch
- Model Presets and Inheritance
- Calibration Settings
- Parameter Settings
- Validation and Testing Your Custom Models
Chapter 9: Running a Local Ollaya Daemon
- Starting the Ollaya Server
- Server Configuration and Ports
- Authentication and Access Control
- Resource Limits and Process Management
- Health Checks and Monitoring
- Running Ollaya as a Systemd Service (Linux)
- Running Ollaya in Docker
- Security Considerations
- Next Steps
Chapter 10: The Local Decision Model API
- API Endpoints Overview
- The Generate/Run Endpoint
- Request Format: Questions, State and Options
- Response Format: Decisions, Scores and Metadata
- Streaming and Batch Requests
- Error Handling and Status Codes
- API Examples with curl
Chapter 11: Integrating with Python
- Setting Up a Python Project for Ollaya
- Making API Calls with requests and httpx
- Building a Typed Client Library
- Error Handling and Retries
- Batch Processing and Concurrency
- Production Python Integration Example
Chapter 12: Integrating with JavaScript and TypeScript
- Node.js Integration Patterns
- TypeScript Type Definitions for Decision Responses
- Browser-Based Calls to Local Ollaya
- Error Handling and Resilience
- Full Example: TypeScript Decision Service Client
- Express.js Integration Example
Chapter 13: The TypeSafe API and Jev Integration Patterns
- What Is the TypeSafe API?
- Cloud Jev vs. Local Ollaya: API Alignment
- Migrating from TypeSafe Cloud to Local Endpoints
- What Changes, What Stays the Same
- Configuration and Environment Management
- Type-Safe Decision Handling in Your Code
Chapter 14: Designing Good Decision Schemas
- Principles of Typed Question Design
- Label Space Construction and Granularity
- Score Ranges and Thresholds
- Decision Hierarchies and Multi-Stage Decisions
- Abstention and Human-in-the-Loop Patterns
- Schema Evolution and Versioning
Chapter 15: Real-World Application: Customer Support Triage
- Problem Statement and Requirements
- Decision Schema Design for Triage
- Building the Ollaya Modelfile
- Implementing the Application Backend
- Integration with Messaging and Routing
- Testing and Validation
Chapter 16: Real-World Application: Intent Classification and Routing
- Intent Classification as a Decision Problem
- Designing the Intent Schema
- Implementing the Router Service
- Tool Selection and Agent Integration
- Handling Ambiguity and Edge Cases
Chapter 17: Real-World Application: Moderation and Risk Signals
- Moderation as Structured Decision-Making
- Multi-Label Decision Schemas
- Confidence Thresholds and Escalation
- Combining Signals for Risk Assessment
- Audit Trails and Explainability
Chapter 18: Hybrid Architectures: LLMs and Decision Models Together
- Division of Labor: What Each Model Should Do
- Decision Models as Gatekeepers for LLMs
- LLMs Generating Candidates, Decision Models Scoring
- Architectural Patterns and Diagrams
- Cost and Latency Considerations
Chapter 19: MCP and Agent Integration
- Understanding MCP for Decision Models
- Ollaya as an MCP Server
- Integrating Decision Models into Agentic Workflows
- Tool Calling with Decision Outputs
- Practical Integration Examples
Chapter 20: Evaluation and Validation
- Evaluation Metrics for Decision Models
- Building a Golden Dataset
- Accuracy, Precision, Recall and Calibration
- A/B Testing Decision Schemas
- Continuous Evaluation Pipelines
Chapter 21: Performance, Benchmarking and Optimization
- Benchmarking Methodology
- Latency and Throughput Measurements
- CPU vs. GPU Performance
- Batching and Concurrency Strategies
- Memory Management and Model Loading
- Caching and Optimization Techniques
Chapter 22: Observability, Logging and Debugging
- Logging Decisions and Metadata
- Structured Logs and Observability Tools
- Debugging Decision Outputs
- Tracing Decision Paths
- Performance Monitoring Dashboards
Chapter 23: Security and Privacy
- Data Privacy Advantages of Local Execution
- Network Security and API Hardening
- Model Integrity and Supply Chain
- Input Validation and Abuse Prevention
- Compliance and Regulatory Considerations
Chapter 24: Production Deployment
- Deployment Architecture Patterns
- Kubernetes and Container Orchestration
- Autoscaling and Load Balancing
- Multi-Model Serving and Routing
- Backup, Recovery and Disaster Planning
Chapter 25: Conclusion: The Future of Local Decision Models
- What We Have Learned
- The Case for Decision Models in Modern AI
- Trends and Open Questions
- Next Steps for Practitioners