-
Declare zai as a project dependency with
zig fetch
:# latest version zig fetch --save git+https://github.com/AdjectiveAllison/zai.git#main # specific commit zig fetch --save git+https://github.com/AdjectiveAllison/zai.git#COMMIT
-
Expose zai as a module in your project's
build.zig
:pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const opts = .{ .target = target, .optimize = optimize }; // 👈 const zai = b.dependency("zai", opts).module("zai"); // 👈 const exe = b.addExecutable(.{ .name = "my-project", .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); exe.root_module.addImport("zai", zai); // 👈 // ... }
-
Import Zig AI into your code:
const zai = @import("zai");