Orator converts between OpenAI-like APIs (OpenResponses, ChatCompletion) and ActivityPub federation protocol, enabling AI agents to communicate via ActivityPub.
#+name: orator
require "translator"
require "translator/registry"
settings do
data.adapter = "memory"
port = 8080
end
struct InputSchema
include Api::OpenResponses::Request
include Api::ChatCompletionAPI::Request
include Api::Models
end
struct OutputSchema
include Api::OpenResponses::Response
include Api::ChatCompletionAPI::Response
end
@[Container(static)]
@[Load(".env")]
@[Validate(InputSchema, OutputSchema)]
workflow "orator" do
follow ["@actra@lefine.pro"]
send_to_inbox
recevie_from_outbox
end┌─────────────────┐
│ OpenAI Request │ (POST /v1/responses or /v1/chat/completions)
│ OpenResponses │
│ ChatCompletion │
└────────┬────────┘
│
▼
┌─────────────────┐
│ send_to_inbox │ Convert to ActivityPub Create{Ticket}
└────────┬────────┘
│
▼
┌─────────────────┐
│ ActivityPub │ ForgeFed Ticket via Aptok
│ Inbox/Outbox │
└────────┬────────┘
│
▼
┌─────────────────┐
│ receive_from_ │ Convert back to OpenAI format
│ outbox │
└────────┬────────┘
│
▼
┌─────────────────┐
│ OpenAI Response │
│ OpenResponses │
│ ChatCompletion │
└─────────────────┘
** translators/
converters.cr- OpenAI ↔ ActivityPub conversion logictranslators.cr- Ocawe node kind implementations (SendToInbox, ReceiveFromOutbox)registry.cr- Registers custom node kinds withOcawe::RegistryApi.node_kind()
Uses Aptok helpers: Aptok.forgefed_ticket() and Aptok.create()
cd orator
ocawe upThen send requests to:
GET http://localhost:8080/v1/models- List available modelsPOST http://localhost:8080/v1/responses- OpenResponses formatPOST http://localhost:8080/v1/chat/completions- ChatCompletion format
- Ocawe framework (workflows, federation, node registry)
- Aptok library (ActivityPub helpers)
** Container
The project includes GitHub Actions CI/CD to build and publish containers:
# Pull from GitHub Container Registry
docker pull ghcr.io/lefinepro/orator:latest
# Run the container
docker run -p 8080:8080 ghcr.io/lefinepro/orator:latest** Building Locally
# Build with ocawe CLI
ocawe build --release --output build/ocawe
# Build Docker image
docker build -t orator:latest .** CI/CD
The .github/workflows/container.yml workflow automatically:
- Builds multi-platform containers (linux/amd64, linux/arm64)
- Publishes to GitHub Container Registry
- Creates tags for branches, PRs, and semantic versions