Skip to content

feat(alien): add finetune example - #227

Open
ab-alien-dev wants to merge 16 commits into
mainfrom
alan/alien-321-add-alienai-examples
Open

feat(alien): add finetune example#227
ab-alien-dev wants to merge 16 commits into
mainfrom
alan/alien-321-add-alienai-examples

Conversation

@ab-alien-dev

Copy link
Copy Markdown
Contributor

No description provided.

ItamarZand88 and others added 11 commits July 22, 2026 15:47
Introduce built-in AI: an `ai` resource that provisions keyless,
in-account model access through an embedded gateway. Adds the Rust
gateway engine and napi addon, the TypeScript SDK wrapper, the per-cloud
controllers and setup emitters (AWS Bedrock, GCP Vertex, Azure Foundry),
the ai/invoke permission sets, and quickstart examples.
- The napi error envelope now carries httpStatusCode and hint, so a gateway
  startup failure (e.g. BindingConfigInvalid at http_status_code 400) is no
  longer flattened to a 500 when it crosses into JS.
- parseSse preserves the malformed-chunk cause as a structured error source
  instead of folding it into the message string.
- Name the condition the anthropic-beta merge test enforces rather than the
  old bug it guards against.
The ai() client resolved its napi addon by filesystem lookup, which cannot
work inside a `bun build --compile` single-file binary — so a compiled Worker
calling ai() failed while kv/storage/queue/vault worked. Mirror the bindings
embedded-addon mechanism end to end:

- The ai-gateway loader gains an embedded slot (registerEmbeddedAddon); loadAddon
  prefers it over the filesystem/prebuild resolution that can't run in a binary.
- ai-gateway/native installEmbeddedAddon() registers the bun-embedded addon.
- @alienplatform/sdk/native installs both the bindings and ai-gateway addons; the
  SDK keeps both external so the compiled binary shares one module for each.
- alien-build stages the ai-gateway addon alongside bindings, best-effort: a
  Worker that resolves ai-gateway transitively through the SDK but never calls
  ai() still builds (a missing addon for the target is skipped, not an error).

Verified by the package-layout compile-smoke (a compiled binary resolves the
SDK's ai + storage after both staged .node files are removed) and a loader unit
test that loadAddon prefers the embedded addon.
The Postgres runtime binding (packages/bindings/src/postgres.ts,
getPostgresConnection, cloud secret-manager deps) and the AI+Postgres
chatbot example rode in from the shared source branch. main already
ships the Postgres resource and dials the DB directly, and
PACKAGE_LAYOUT.md keeps getPostgresConnection off the SDK root, so this
copy is superseded. Remove it so this PR stays AI-only.
# Conflicts:
#	.github/workflows/ci-fast.yml
#	Cargo.lock
#	Cargo.toml
@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown

Too many files changed for review. (207 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants