Skip to main content
This release is 11 versions behind 2.0.0 — the latest version of @open-schemas/valibot. Jump to latest

Valibot schemas for the API of LLM providers.

Works with
This package works with Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score
47%
Published
3 weeks ago

@open-schemas/valibot

Valibot schemas for the API of LLM providers:

  • Anthropic
  • Ollama
  • OpenAI
  • Vertex AI

Installtion

From npm

deno add npm:@open-schemas/valibot
npm add @open-schemas/valibot
yarn add @open-schemas/valibot
pnpm add @open-schemas/valibot
bun add @open-schemas/valibot

From JSR

deno add @open-schemas/valibot
npx jsr add @open-schemas/valibot
yarn dlx jsr add @open-schemas/valibot
pnpm dlx jsr add @open-schemas/valibot
bunx jsr add @open-schemas/valibot

Usage

Anthropic

import { parse } from "valibot";
import { CreateMessageRequest } from "@open-schemas/valibot/anthropic";

parse(CreateMessageRequest, {});

OpenAI

import { parse } from "valibot";
import { CreateChatCompletionRequest } from "@open-schemas/valibot/openai";

parse(CreateChatCompletionRequest, {});