Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/follgad/zig-ai
OpenAI client with streaming support for Zig
https://github.com/follgad/zig-ai
openai zig zig-package
Last synced: 21 days ago
JSON representation
OpenAI client with streaming support for Zig
- Host: GitHub
- URL: https://github.com/follgad/zig-ai
- Owner: FOLLGAD
- Created: 2024-11-30T21:23:56.000Z (22 days ago)
- Default Branch: main
- Last Pushed: 2024-11-30T22:43:09.000Z (22 days ago)
- Last Synced: 2024-11-30T23:28:46.818Z (22 days ago)
- Topics: openai, zig, zig-package
- Language: Zig
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zig-ai
A simple OpenAI API client for Zig with streaming support.
Find examples in the [`examples`](./examples) directory.
## Installation
```bash
$ zig fetch --save git+https://github.com/FOLLGAD/zig-ai
```and add `zig-ai` to your `build.zig` file:
```zig
const std = @import("std");pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});const exe = b.addExecutable(.{
.name = "stream-cli",
.root_source_file = b.path("examples/stream-cli.zig"),
.target = target,
.optimize = optimize,
});const module = b.dependency("zig-ai", .{
.root_source_file = b.path("src/llm.zig"),
});
exe.root_module.addImport("zig-ai", module.module("zig-ai"));
}
```## Usage
See the `examples` directory for usage examples.