chatoyant weekly downloads statistics
OCaml-first SDK for LLM providers with a zero-dependency Melange-generated JavaScript package, streaming, structured outputs, and tool calling.
chatoyant has 935 recorded weekly downloads on npm, an increase of 48.2% over the past 30 days, ranking #2090 of 3,247 tracked listings.
About chatoyant
Chatoyant
<div align="center"> <img src="https://raw.githubusercontent.com/Anonyfox/chatoyant/main/assets/chatoyant-logo.png" alt="Chatoyant Logo" width="400" /> </div>OCaml-first SDK for LLM providers with an Eio native runtime and a zero-runtime-dependency JavaScript package generated by Melange. Chatoyant provides typed provider clients, structured outputs, tool calling, streaming, token/cost accounting, and root-only npm exports.
chatoyant /shuh-TOY-uhnt/ - having a changeable lustre.
Install
npm install chatoyant # JavaScript/TypeScript: Node 18+, no runtime dependencies
opam install chatoyant eio_main # OCaml 5.3+
Set the API key for the provider you call (OPENAI_API_KEY,
ANTHROPIC_API_KEY, XAI_API_KEY, META_API_KEY or OPENROUTER_API_KEY),
then make a first call:
import { genText } from "chatoyant";
console.log(await genText("Say hello in three words.", { model: "fast" }));
In OCaml, add (libraries chatoyant eio_main) to your dune stanza, plus
(preprocess (pps chatoyant.ppx)) for module%tool and derived codecs. Full
examples: OCaml Quick Start and
JavaScript Quick Start.
Highlights
- Native OCaml API built around Eio, result-returning calls,
.mlicontracts, and typed tool definitions. - Melange-generated npm package with one root import path, ESM and CommonJS
entrypoints, colocated
.d.tsand.d.ctsdeclarations, and no runtime npm dependencies. - Unified
Chatsession API, one-shot text/data/stream shortcuts, tool calling, streaming accumulation, JSON roundtrip, and token/cost accounting. - Raw provider clients for OpenAI, Anthropic, xAI, Meta (Muse Spark), OpenRouter, and local OpenAI-compatible servers.
- Standalone Draft 2020-12 JSON Schema parser/validator with OpenAI strict projection and typed OCaml codec generation.
- Production-derived JS usage tests, OCaml native tests, TypeScript declaration checks, package metadata checks, and the official JSON Schema suite against the bundled npm package.
Guides
Full API docs live at anonyfox.github.io/chatoyant. Start with one of these:
- Call GPT-6, Claude 5.5 and Grok 4.7 from OCaml (Eio): install, a first call per provider, tools, structured output and per-request cost.
- Structured LLM output with JSON Schema in OCaml and TypeScript: typed results that are validated before your code sees them.
- Smallest JavaScript LLM SDK: measured sizes: install and bundle sizes next to the openai, Anthropic, AI SDK and LangChain packages.
Package Size Next To Other JS LLM Libraries
Measured on 2026-11-10 with Node v24.22.1 and npm 11.21.1. Each case uses fresh production installs of registry latest versions. Install sizes count node_modules file bytes (1 MB = 1024 KB); bundles use a one-request script, esbuild 0.25 (minified ESM for Node 20), and gzip level 9.
| SDK | Versions | Installed packages | node_modules | Minified bundle | Gzip |
|---|---|---|---|---|---|
| chatoyant | chatoyant@0.17.2 | 1 | 0.6 MB | 218.0 KB | 54.9 KB |
| openai | openai@7.55.0 | 1 | 22.9 MB | 385.0 KB | 84.2 KB |
| @anthropic-ai/sdk | @anthropic-ai/sdk@1.7.0 | 8 | 17.6 MB | 413.5 KB | 97.3 KB |
| ai + @ai-sdk/openai | ai@7.0.166, @ai-sdk/openai@4.0.111 | 12 | 22.5 MB | 916.2 KB | 208.2 KB |
| langchain + @langchain/openai | langchain@1.6.3, @langchain/core@1.3.6, @langchain/openai@1.8.2 | 25 | 78.1 MB | 1520.6 KB | 356.1 KB |
Chatoyant has the smallest install and bundles in this sample; openai ties its installed package count. The openai and Anthropic cases each cover one provider; chatoyant includes all six provider adapters plus JSON Schema validation and token/cost tables. One root import still pulls all adapters into the bundle.
See Smallest JavaScript LLM SDK: measured sizes
for the method, source scripts, measured JSON and a typechecked example.
Rerun with node scripts/measure-sdk-size.mjs.
Provider Routing
| Provider | Env var | Detection |
|---|---|---|
| OpenAI | OPENAI_API_KEY | gpt-*, o1-*, o3-*, o4-*, chatgpt-* |
| Anthropic | ANTHROPIC_API_KEY | claude-* |
| xAI | XAI_API_KEY | grok-* |
| Meta | META_API_KEY (or MODEL_API_KEY) | muse-* |
| OpenRouter | OPENROUTER_API_KEY | Slash notation such as openai/gpt-4o |
| Local | LOCAL_BASE_URL | Explicit provider: "local" or local fallback |
Model presets are available for quick intent-based calls: fast, cheap,
balanced, best, and reasoning.
| Preset | OpenAI | Anthropic | xAI | Meta |
|---|---|---|---|---|
| fast / cheap | gpt-6-luna | claude-haiku-5-5 | grok-4.20-0309-non-reasoning | muse-spark-1.3 |
| balanced | gpt-6.2-sol | claude-sonnet-5-5 | grok-4.3 | muse-spark-1.3 |
| best / reasoning | gpt-6.2-astra | claude-fable-5-2 | grok-4.7 | muse-spark-1.3 |
Description from the npm listing.
- llm
- ai
- openai
- anthropic
- claude
- gpt
- chatgpt
- xai
- grok
- openrouter
- local-llm
- ai-sdk
- chat-completion
- text-generation
- ai-client
- llm-sdk
- json-schema
- structured-output
- function-calling
- streaming
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (135)Similar npm AI SDKs plugins
All 20 chatoyant alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/chatoyant. First seen Nov 21, 2026; last successful collection Dec 6, 2026. See the methodology.