Skip to main content

Actor Model architecture definition language compiler — define systems as actors with JSON message interfaces, let AI agents implement them

Project description

Lumina

Actor Model architecture language for the AI era.

Define your system as a set of actors that communicate through JSON messages. Each actor is a black box — you describe what it does in natural language, and AI agents implement how it works. The compiler wires everything together.

.lm source  →  LMC compiler  →  AI agents  →  working code
                     (parser)       (LLM / Claude)   (Python monolith or Docker microservices)

Why Lumina?

AI is great at writing isolated functions with clear contracts. AI fails when it has to understand global system topology, complex control flow, and implicit dependencies.

Lumina solves this: every module is an independent actor with exactly two entry points — run() and invoke(). The AI only needs to satisfy a JSON interface contract. It never sees the global system. The compiler handles wiring, message routing, and deployment.

Erlang OTP architecture × LLM code generation.


Quick Example

// types.lm — shared type definitions
type DataPacket = {
    "id": Int("unique timestamp ID"),
    "payload": List<Float>("sequence of floats to process")
}("standard data stream packet")

// worker.lm — an actor module
import "types.lm" as t

module Sorter {
    setup: "allocate a memory pool for high-frequency sorting"

    interface: {
        "do_sort": { "raw": t.DataPacket } -> { "sorted": t.DataPacket }
    }

    logic: "implement a non-recursive quicksort on payload, keep id unchanged"
}

// main.lm — system composition
import "worker.lm" as worker

module Controller {
    actor sorter: worker.Sorter

    setup: "start a background coroutine that generates 100 random floats every second"

    logic: "pipe generated DataPackets to sorter.do_sort, output sorted results"
}

Every string in () is not a comment — it's a first-class semantic description that gets compiled into the Task JSON sent to AI agents.


Quick Start

# Install
pip install lumina          # coming soon
# or: git clone + uv sync

# Create a project
lumina init hello-world
cd hello-world

# See what will be generated
lumina build --dry-run

# Build with LLM agent (needs OPENAI_API_KEY)
lumina build

# Build with Claude Code (needs claude CLI)
lumina build --agent claude_code

Project Structure

my-project/
├── Lumina.toml         # project manifest
├── src/
│   ├── main.lm     # entry point
│   └── types.lm    # shared types
├── .lm/            # build cache (gitignored)
└── .gitignore

Key Features

  • Semantic Types: types carry natural-language descriptions that AI agents use as context. Not comments — compiler-verified metadata.
  • Actor Modules: every module is an isolated actor with run() + invoke(). No shared state, no global imports.
  • Pluggable AI Backends: use OpenAI-compatible LLMs for generation, or Claude Code CLI for generation + automated testing.
  • Per-Module Testing: enable test = true for specific modules in Lumina.toml. The agent generates and runs tests.
  • Dual Build Modes: monolith produces a single process with in-memory message routing. microservice generates Dockerfiles and docker-compose.yml.
  • Incremental Builds: unchanged modules are cached and skipped.

Agent Configuration

Agent settings live in environment variables, not in the project manifest:

export LUMINA_AGENT=llm              # "llm" (default) or "claude_code"
export OPENAI_API_KEY=sk-xxx         # for LLM agent
export LUMINA_MODEL=gpt-4o           # optional model override

Per-module testing in Lumina.toml:

[modules.Sorter]
test = true   # Claude Code agent will generate + run tests for this module

How It Works

┌─────────────┐     ┌──────────────┐     ┌─────────────┐     ┌──────────┐
│ .lm     │ ──► │ LMC Parser   │ ──► │ Task JSON   │ ──► │ AI Agent │
│ source      │     │ (Lark EBNF)  │     │ (per actor) │     │ (LLM/CC) │
└─────────────┘     └──────────────┘     └─────────────┘     └─────┬────┘
                                                                   │
                                                              generated code
                                                                   │
                                              ┌────────────────────┘
                                              ▼
┌──────────┐     ┌──────────────┐
│ Output   │ ◄── │ LMC Builder  │
│ ./build  │     │ mono/micro   │
└──────────┘     └──────────────┘

Status

Pre-release. The compiler pipeline is implemented (parser, analyzer, task generator, agent backends, builders). CLI commands init, build, parse are functional. SDK base classes and runtime are in progress.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lumina_lang-0.1.0.tar.gz (81.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lumina_lang-0.1.0-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file lumina_lang-0.1.0.tar.gz.

File metadata

  • Download URL: lumina_lang-0.1.0.tar.gz
  • Upload date:
  • Size: 81.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lumina_lang-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff13cec4c11536edfc20092232aceaaac858625797f82f27e9250a675886fec3
MD5 2d980b7a58e7dd2b67fc9a6eb119c462
BLAKE2b-256 a1dac359b6f9b3766248468b79a2de0f45eadd0b42eb739d52b6999f3471e08b

See more details on using hashes here.

File details

Details for the file lumina_lang-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lumina_lang-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lumina_lang-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 944927ca69a5728a3706cf86fa94455b3b106a8cd4c03bfcc766fa30640f58f8
MD5 4d6a5b52d9a5aba797c945e9631fb2ac
BLAKE2b-256 6beedb6202ff69080b170f7151b2879b9dbb67c7c51f7af8d3f18d172db5624e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page