category
Disclosure: I maintain PRAXO-CORE. This article reflects the 2.10.0 source state; it is not a production or security certification.
The default answer for Lua and AI is a Python sidecar.
It is a familiar architecture. A Python service owns the agent loop, and the Lua
extension exposes a tool or an API. The AI team gets Python, the host team keeps
its runtime, and the boundary is a network call.
Sometimes that is the right answer. But in an embedded host, the sidecar may not
exist, may not be allowed, or may be too heavy. The host may be a game engine, a
network appliance, an IoT control plane, or an application with a Lua plugin
system. Adding a new process is not always an option.
PRAXO-CORE is testing a different answer: keep the host and put a governed agent
loop where the Lua extension already runs.
Not a bridge. Not a Python wrapper. A native Lua 5.4 implementation of the Core
agent contract.
The compatibility boundary
This is the most important paragraph in the article.
The SDK targets Lua 5.4. It uses the Lua standard library only.
It does not claim LuaJIT compatibility. It does not claim Lua 5.1 or 5.3
compatibility. It does not claim OpenResty or Redis compatibility.
That matters because many popular Lua embeddings use LuaJIT or older Lua
versions. A campaign that says “Lua” without saying “5.4” would be misleading.
The honest version is more useful: here is a native Lua 5.4 Core loop; if your
host is on a different Lua runtime, a portability evaluation is required.
What native Lua 5.4 means
The Lua SDK is implemented in Lua 5.4. It is not a bridge to Go, Python, C, or
another Core. The agent loop, models, runtime, tool calls, JSON Schema, plugin
manifests, and middleware are native Lua modules.
The dependency footprint is deliberately small: the Lua standard library only.
No Python host. No provider SDK. No compiled extension requirement for the core
loop.
The source tag is lua/v0.8.0, targeting SPEC_VERSION 0.2.0. It is published on
LuaRocks as praxo-core 0.8.0-1. The SDK is MIT-licensed.
Architecture
The core call is small:
package.path = "language/lua/?.lua;lua/?/init.lua;" .. package.path
local agent = require("praxo.agent")
local models = require("praxo.models")
local model = agent.static_model("hello")
local options = agent.agent_options(model)
local result = agent.run_agent(options, models.session({ id = "demo" }), "hello")
print(result.output)
Tools register on the options object:
local registry = agent.tool_registry()
agent.register_tool(registry, agent.func_tool("echo", "Echo arguments", function(arguments)
return arguments
end))
options.tools = registry
options.max_steps = 8
The surfaces include:
agent: loop, options, tool registry, function tools.models: messages, requests, responses, usage, sessions, events, decisions,
memory records, context budget, stream kinds.runtime: event sinks, path checker, memory store, checkpoint allowlist,
context budget, token estimation.toolcall: tool-call parsing and markup stripping.jsonschema: schema validation.plugin: manifest parsing.middleware: call limits, fallback, PII redaction, structured output, tool
selection.
The evidence is specific: all 11 vector groups pass, the core tests pass, and the
public API snapshot is checked. The lua-conformance CI job runs the vectors,
the API snapshot, and the tests.
The three partial surfaces
Three surfaces are explicitly partial in the parity inventory:
- Event sink. The vector behavior and common path are covered; not every
optional Go hook is. - Stream part. Stream kinds are represented, but this is not an async
runtime claim. - JSON Schema. The vector-defined behavior is covered; this is not full
JSON Schema.
The rest of the declared Core scope passes. The partial surfaces are named
because a multi-language claim without them is just a larger README.
The dependency story
Lua hosts often care about footprint. This SDK is deliberately small:
- Lua standard library only.
- No Python host.
- No provider SDK.
- No compiled extension requirement for the core loop.
That does not make it dependency-free in the abstract. It makes the dependency
surface small and auditable. In an embedded host, that is often the difference
between “can evaluate” and “cannot deploy.”
Governance
An embedded host does not need an agent that can talk about Lua. It needs an
agent that can participate in a host workflow without bypassing the controls
around that workflow.
That means:
- policy checks that see the final tool arguments;
- explicit tool authorization;
- checkpoints that support recovery;
- structured events for audit and telemetry;
- human-in-the-loop approval at the right boundary;
- a clear statement of what the framework does not own.
If the loop lives in the Lua host, the state, the credentials, and the policy
decision can stay closer together. That reduces one kind of boundary crossing.
It does not automatically make the host secure or compliant.
What it does not do
- It is not a LuaJIT, Lua 5.1, or Lua 5.3 implementation.
- It is not an OpenResty or Redis compatibility claim.
- It is not full Go feature parity. Event sink, stream part, and JSON Schema are
partial. - It is published on LuaRocks as praxo-core==0.8.0-1.
- It ships OpenAI-compatible, Anthropic, and Gemini adapters and SSE over caller-supplied transports; it is not a hosted provider runtime.
- It does not claim an async runtime.
- It does not provide a plugin host. Manifest parsing only.
- It does not claim a persistent session store.
- It does not provide general PII compliance.
- It does not claim production readiness or a security certification.
These limits are not footnotes. They are the boundary that makes the native claim
credible.
How to evaluate
Do not start with “AI in Lua.” Start with the Lua README and the matrix.
- Confirm the tier, tag, and current scope.
- Check that your host is Lua 5.4. If it is LuaJIT, 5.1, 5.3, OpenResty, or
Redis, treat it as a portability evaluation, not a supported target. - Run the conformance, API snapshot, and test commands.
- Check the three partial surfaces against your workload.
- Test the security behavior you depend on: policy ordering, path handling,
cancellation, and callback failure. - Decide whether a native loop, a bridge, or a sidecar is the right fit.
Repo: https://github.com/axisvela/praxo-core
Lua docs: https://axisvela.github.io/praxo-core/languages/lua/
Lua source: https://github.com/axisvela/praxo-core/tree/main/language/lua
Matrix: https://github.com/axisvela/praxo-core/blob/main/spec/languages.md
Invitation
The interesting question is not “Can Lua call a model?” It can.
The interesting question is whether a governed agent loop can fit inside an
embedded host without adding a sidecar or moving the host state — and whether the
Lua 5.4 compatibility boundary can be stated clearly enough that an operator
trusts the failure modes.
If you run Lua 5.4 hosts, I would value the hard questions. What would you test
first? Which boundary should be native, and which should stay behind a bridge?
What would you need to see before letting an agent call a host tool?
That conversation is more useful than another sidecar demo.
- 登录 发表评论
- 7 次浏览