@astrale-domains/ai-gateway
v0.4.3
Published
`ai-gateway.astrale.ai` exposes configured language models as permissioned Astrale graph nodes. Each `AIModel` pins its upstream Provider and model id. Holding authority on that node is required before inference crosses the Cloudflare AI Gateway boundary.
Readme
AI Gateway
ai-gateway.astrale.ai exposes configured language models as permissioned Astrale graph nodes.
Each AIModel pins its upstream Provider and model id. Holding authority on that node is required
before inference crosses the Cloudflare AI Gateway boundary.
Application model
- Declarative Core installs the six stable model nodes;
AIModel.registerremains the authorized operator path for an additional model. - The View reads the catalog through the projected
listVisibleAIModelsQuery directly. There is no list Function wrapper. AIModel.invokeperforms provider-native passthrough with caller credentials removed and long safety identifiers normalized to bounded hashes.- OpenAI Chat Completions, Anthropic Messages, Vercel UI messages, and provider-native passthrough each have one exact HTTP route and one receiver-bound Action.
- The provider-neutral
model-inferenceIntegration is explicitly unsafe to replay because an inference may bill or create provider-side effects. - Binary output is one semantic mode with buffered and streaming byte bodies. Status, media type, safe headers, cancellation, and incremental SSE delivery survive beneath that single result kind.
Anthropic tool calls and streaming events are translated to valid Anthropic protocol. Unsigned
OpenAI reasoning text is deliberately not emitted as an Anthropic thinking block because such a
block requires provider-authenticated signature evidence.
Development
Copy .env.example to .env.dev, configure Cloudflare and any optional Google/Azure credentials,
then run:
pnpm typecheck
pnpm test
pnpm lint
pnpm frontend:build
pnpm build
pnpm package