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-lang
# 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 = truefor specific modules inLumina.toml. The agent generates and runs tests. - Dual Build Modes:
monolithproduces a single process with in-memory message routing.microservicegenerates Dockerfiles anddocker-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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lumina_lang-0.1.3.tar.gz.
File metadata
- Download URL: lumina_lang-0.1.3.tar.gz
- Upload date:
- Size: 84.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa65fd8a85a272c2cc8dea5f94979da7c1b3c01d0ac2d20599498763a70cbbc8
|
|
| MD5 |
e765696eaa568233fbcedd6a9fac4d8a
|
|
| BLAKE2b-256 |
6a2f477ec3603c1b1af41d697575be92a097af5bd5e2216c50b30b6b21a70fbe
|
File details
Details for the file lumina_lang-0.1.3-py3-none-any.whl.
File metadata
- Download URL: lumina_lang-0.1.3-py3-none-any.whl
- Upload date:
- Size: 35.1 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edbdc26882d50d09e6501b50b52cd0bc52d9e50f4b78a197e708ba3ed422e87f
|
|
| MD5 |
305e5021e4156eebe7e16ff2e1e760a1
|
|
| BLAKE2b-256 |
67ee139d6d7d8a29f106358f291f71d4923244cb80ef22c7c08db87660af5f1d
|