Skip to content

Antfarm Zig Updates - #85

Merged
ajroetker merged 9 commits into
mainfrom
antfarm_zig
May 22, 2026
Merged

Antfarm Zig Updates #85
ajroetker merged 9 commits into
mainfrom
antfarm_zig

Conversation

@timkaye11

Copy link
Copy Markdown
Contributor

Summary

Makes the Zig Antfly runtime the default Antfarm path and removes the old Cloudflare R2 registry
assumptions from the Antfarm model experience. Antfarm now reads live model inventory from the
embedded Termite /ml/v1/models API, while the Go binary remains available only through the explicit
build-go target.

Changes

  • Switches top-level make build to build the Zig antfly binary by default.
  • Keeps the legacy Go binary build behind make build-go.
  • Embeds/serves Antfarm from the Zig swarm runtime.
  • Adds Termite-compatible /ml/v1 and /termite/ml/v1 routing in the Zig runtime.
  • Updates Antfarm model loading to use live Termite model data instead of the old /registry/ index.json registry.
  • Removes Antfarm-facing R2 registry proxy/config compatibility surface, including the deprecated
    registry_url config field.
  • Updates Antfarm UI model cards and playground links to work with live Termite model identifiers.
  • Gates MLX autodetection on required MLX symbols so default builds work on machines without a
    compatible local MLX install, while explicit -Dmlx=true fails early with a clear error.

Validation

  • make -C ./zig build
  • zig build lib-common-config-test
  • GOEXPERIMENT=simd go test ./src/common
  • make -C ./zig openapi-check
  • make -C ./zig build ZIG_BUILD_FLAGS=-Dmlx=true verified the intentional early MLX compatibility
    failure path
  • Local Antfarm smoke-tested against the Zig antfly runtime, without Docker

timkaye11 added 4 commits May 20, 2026 09:46
Build Zig antfly by default while keeping build-go for the legacy Go binary.

Serve Antfarm from the Zig swarm runtime, wire /ml/v1 and /termite/ml/v1 model APIs, and remove the R2 registry proxy/UI flow.

Deprecate registry_url compatibility fields and rebuild the embedded Antfarm assets.
@ajroetker

ajroetker commented May 21, 2026

Copy link
Copy Markdown
Contributor
# github.com/antflydb/antfly/src/metadata
Error: src/metadata/antfarm.go:57:17: undefined: url
Error: src/metadata/antfarm.go:62:12: undefined: httputil
Error: src/metadata/antfarm.go:63:20: undefined: httputil
Error: src/metadata/antfarm.go:65:16: undefined: strings
Error: src/metadata/antfarm.go:69:21: undefined: path
Error: src/metadata/antfarm.go:78:32: undefined: time
Error: Process completed with exit code 1.

real failures

Comment thread zig/pkg/antfly/src/swarm/runtime.zig Outdated
Comment thread zig/pkg/antfly/src/swarm/runtime.zig Outdated
Comment thread zig/pkg/termite/build.zig
return true;
}

fn mlxRootAvailable(b: *std.Build, target: std.Build.ResolvedTarget, root: []const u8) bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw i turned off mlx and onnx binding by default, don't know if that's applicable here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated both Zig build surfaces so MLX and ONNX are opt-in instead of auto-enabled

Comment thread Makefile Outdated
@ajroetker
ajroetker merged commit e676db9 into main May 22, 2026
14 checks passed
@ajroetker
ajroetker deleted the antfarm_zig branch May 22, 2026 18:21
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