Skip to content

Repository files navigation

ngx-ai

RxJS-friendly Angular client for OpenAI-compatible chat APIs (OpenAI, xAI Grok, or your own proxy) with first-class streaming.

CI npm version License: MIT

This is the monorepo for the ngx-ai Angular library. 📦 Full library documentation and usage →

✓ Streaming        ✓ Angular Signals   ✓ RxJS-first
✓ Structured JSON  ✓ Tool calling      ✓ Type-safe
✓ OpenAI · Grok · custom proxies       ✓ Safe-by-default keys

Why

Wiring an LLM into an Angular app usually means hand-rolling fetch, parsing server-sent events by hand, and leaking API keys into the browser. ngx-ai turns that into a one-line provider and an injectable, RxJS-first service — with streaming and a safe-by-default key policy built in.

Repository layout

Path Description
projects/ngx-ai The publishable library source.
projects/demo A runnable Angular app showcasing the library.
dist/ngx-ai Build output (generated).

Demo

A small Angular app in projects/demo exercises the library — streaming chat via injectAiChat(), cancellation, live error handling, and a runtime provider/model/key switcher. Run it locally:

npm run build    # build the library the demo consumes
npm start        # serve the demo at http://localhost:4200

Point Base URL at your own OpenAI-compatible proxy, or pick a provider and paste a key (the demo opts into a browser key for convenience; the library is safe-by-default and refuses this unless you explicitly opt in).

Development

npm install      # install dependencies
npm run build    # build the library to dist/ngx-ai
npm run build:demo   # build the demo app to dist/demo
npm test         # run the unit tests
npm run format:check  # check formatting

Publishing

npm run build
cd dist/ngx-ai
npm publish --access public

Contributing

See CONTRIBUTING.md. Issues and PRs welcome.

License

MIT © Arul Cornelious

About

RxJS-friendly Angular client for OpenAI-compatible chat APIs (OpenAI, xAI Grok, or your own proxy) with first-class streaming.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages