Orbit – Minimalist LLM framework for Lua

English | 中文 | Español | 日本語 | Deutsch | Русский | Português | Français | 한국어

License: MIT Docs

<img src="https://img.shields.io/discord/1346833819172601907?logo=discord&style=flat">

Orbit is a ~160-line minimalist LLM framework for Lua.

  • Lightweight: Just ~160 lines. Zero bloat, zero dependencies, zero vendor lock-in.

  • Expressive: Everything you love—(Multi-)Agents, Workflow, RAG, and more.

  • Agentic Coding: Let AI Agents (e.g., Cursor AI) build Agents—10x productivity boost!

Get started with Orbit: - To install, just copy orbit.lua or main.lua into your project. - To learn more, check out the documentation and cookbook - Examples: To run examples, first install LDE: luarocks install lde (or local dependency manager). Then navigate to the example directory and run lua main.lua. - 🎉 Join our Discord to connect with other developers building with Orbit!


Note: This is the Lua port of the original Orbit. The core logic is contained in a single file orbit.lua (also available as main.lua).

Quick Start

local pf = require("orbit")

local fetch = pf.node(function(shared)
    shared.value = 42
    return "ok"
end)

local process = pf.node(function(shared)
    if shared.value > 40 then return "large" end
    return "small"
end)

fetch >> process
pf.run(fetch, {})

Why Orbit?

Current LLM frameworks are bloated... You only need 160 lines for LLM Framework!

| | **Abstraction** | **App-Specific Wrappers** | **Vendor-Specific Wrappers** | **Lines** | **Size** | |----------------|:-----------------------------: |:-----------------------------------------------------------:|:------------------------------------------------------------:|:---------------:|:----------------------------:| | LangChain | Agent, Chain | Many
(e.g., QA, Summarization) | Many
(e.g., OpenAI, Pinecone, etc.) | 405K | +166MB | | CrewAI | Agent, Chain | Many
(e.g., FileReadTool, SerperDevTool) | Many
(e.g., OpenAI, Anthropic, Pinecone, etc.) | 18K | +173MB | | SmolAgent | Agent | Some
(e.g., CodeAgent, VisitWebTool) | Some
(e.g., DuckDuckGo, Hugging Face, etc.) | 8K | +198MB | | LangGraph | Agent, Graph | Some
(e.g., Semantic Search) | Some
(e.g., PostgresStore, SqliteSaver, etc.) | 37K | +51MB | | AutoGen | Agent | Some
(e.g., Tool Agent, Chat Agent) | Many [Optional]
(e.g., OpenAI, Pinecone, etc.)
| 7K
(core-only) | +26MB
(core-only) | | **Orbit** | **Graph** | **None** | **None** | **~160** | **+10KB** |

How does Orbit work?

The ~160 lines capture the core abstraction of LLM frameworks: Graph!


From there, it's easy to implement popular design patterns like (Multi-)Agents, Workflow, RAG, etc.


✨ Below are basic tutorials (more coming soon!):

| Name | Difficulty | Description | | :-------------: | :-------------: | :--------------------- | | [Hello World](cookbook/orbit-hello-world) | ☆☆☆ *Dummy* | A simple hello world flow | | [Chat](cookbook/orbit-chat) | ☆☆☆ *Dummy* | A basic chat bot with conversation history | | [Batch](cookbook/orbit-batch) | ☆☆☆ *Dummy* | A batch processor that translates markdown into multiple languages |

👀 Want to see other tutorials ported to Lua? Create an issue!

How to Use Orbit?

🚀 Through Agentic Coding—the fastest LLM App development paradigm-where humans design and agents code!


<img src="assets/orbit4.png" width="700" alt="IMAGE ALT TEXT" style="cursor: pointer;">


✨ Check out the documentation for more advanced patterns:

| Topic | Description | | :-------------: | :-------------: | | [Agent](docs/design_pattern/agent.md) | Autonomous agents that use tools | | [Workflow](docs/design_pattern/workflow.md) | Structured multi-step processes | | [RAG](docs/design_pattern/rag.md) | Retrieval-augmented generation | | [Map-Reduce](docs/design_pattern/mapreduce.md) | Parallel processing of large datasets | | [Multi-Agent](docs/design_pattern/multi_agent.md) | Collaborative agent systems |
  • Want to learn Agentic Coding?

  • Check out my YouTube for video tutorial on how some apps above are made!

  • Want to build your own LLM App? Read this post! Start with this template!


Development

LDE (Lua Development Environment)

To run examples or manage dependencies, ensure you have LDE installed:

powershell -c "irm https://lde.sh/install.ps1 | iex"

Running Examples

Navigate to any cookbook example directory and execute:

lua main.lua

Running Tests

Orbit uses a simple unified test runner. To run all tests:

lua tests/run_all.lua

Test Coverage

To check test coverage, you'll need luacov:

luarocks install luacov
lua -lluacov tests/run_all.lua
luacov

Check luacov.report.out for the results.

Generating Documentation

Documentation is generated using LDoc:

luarocks install ldoc
ldoc .

The output will be in docs/api.

generated by LDoc 1.5.0 Last updated 2026-05-14 19:30:16