Subpath exports
Consumers reach internals only through documented subpaths:| Subpath | Responsibility |
|---|---|
@gaussia/sdk | Core abstractions: Gaussia base class, Retriever and LanguageModel interfaces, Logger + silentLogger, and the exception hierarchy. |
@gaussia/sdk/schemas | Zod schemas and their inferred types. No business logic. |
@gaussia/sdk/adapters/ai-sdk | The Vercel AI SDK adapter. Depends only on core interfaces. |
@gaussia/sdk/generators | Synthetic dataset generation. |
@gaussia/sdk/prompt-optimizer | GEPA prompt optimization. |
Dependency direction
Cross-module dependencies flow downward only. Core defines interfaces; everything else depends on core, never the reverse.coredepends on nothing else in the package.schemasis standalone (used at the type level elsewhere).generatorsandprompt-optimizerdepend on core and schemas.adapters/*depend only on core’s interfaces.
ai peer.
Vendor isolation
zod and ai are peer dependencies, never direct dependencies. Vendor SDKs live only inside adapter subpaths. The core never imports a vendor SDK directly, so you can plug in a custom inference path by satisfying the LanguageModel contract without pulling in an ecosystem you do not use.
Isomorphic by default
The default and browser builds carry no Node-only built-ins. Node-only code (for example, the local Markdown loader in generators) is reachable only through the package’snode conditional export. In a browser build, those Node-only paths resolve to stubs that throw a clear error, so you choose an isomorphic alternative instead.
This keeps the path open to in-browser evaluation flows while still offering Node conveniences where the runtime supports them.
Related concepts
Evaluators
How the
Gaussia base class drives an evaluation.Schemas
The Zod-derived data model the SDK passes around.