Skip to main content

Overview

The offline engine provides a lightweight inference interface without the HTTP server and inter-process communication overhead. It’s ideal for:
  • Batch processing
  • Benchmarking
  • Integration into larger applications
  • Jupyter notebooks and scripts

Basic Usage

Key Differences from Server Mode

The offline engine runs entirely in-process with no HTTP server or separate scheduler processes.

Configuration

Minimal Setup

Production Setup

Batch Inference

Same Parameters

All prompts use the same sampling parameters:

Different Parameters

Each prompt can have its own parameters:

Token-Based Input

For maximum control, pass pre-tokenized inputs:

Streaming

Output Information

The engine returns rich metadata:

Embeddings

Structured Output

JSON Mode

Regex Mode

Multimodal Models

Single Image

Batch with Images

Performance Tuning

Memory Optimization

Throughput Optimization

Quantization

Advanced Features

Logprobs

Custom Stop Sequences

LoRA Adapters

Benchmarking

Memory Management

Flush Cache

Context Manager

Error Handling

See Also