Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score88%
Downloads3/wk
Published3 weeks ago (0.1.0)

The core library for Vertana, an LLM-powered natural language translation library

@vertana/core

JSR npm

Caution

Vertana is currently in early development for proof of concept purposes, and is not yet ready for production use. The API is subject to change, and there may be bugs or missing features.

Core translation logic and utilities for Vertana. Contains chunking, context gathering, evaluation, refinement, selection, and translation orchestration.

Tip

Building an application? Consider @vertana/facade for a simpler API. This core package is for when you need fine-grained control over the translation pipeline.

When to use @vertana/core

Use @vertana/core when:

  • Building custom translation workflows
  • Need fine-grained control over each translation stage
  • Implementing custom chunking strategies
  • Working with streaming translation events

Use @vertana/facade when:

  • Want a simple async/await API
  • Standard translation with sensible defaults
  • Progress reporting with callbacks

Installation

deno add jsr:@vertana/core
npm  add     @vertana/core
pnpm add     @vertana/core

Quick example

import { translateChunks, chunkText } from "@vertana/core";
import { openai } from "@ai-sdk/openai";

const chunks = await chunkText("Your long document here...", {
  mediaType: "text/markdown",
});

for await (const event of translateChunks(chunks, {
  models: [openai("gpt-4o")],
  targetLanguage: "ko",
})) {
  if (event.type === "chunk") {
    console.log(event.translation);
  }
}

Key modules

  • Chunking: @vertana/core/chunking — Text splitting with media type awareness (plain text, Markdown, HTML)
  • Context: @vertana/core/context — Required and passive context sources for agentic workflows
  • Evaluation: @vertana/core/evaluation — Quality scoring across accuracy, fluency, terminology, style
  • Refinement: @vertana/core/refine — Iterative improvement with boundary coherence
  • Selection: @vertana/core/select — Best-of-N evaluation with multiple models
  • Glossary: @vertana/core/glossary — Dynamic term accumulation

For more resources, see the docs.

Built and signed on
GitHub Actions

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@vertana/core

Import symbol

import * as core from "@vertana/core";
or

Import directly with a jsr specifier

import * as core from "jsr:@vertana/core";

Add Package

pnpm i jsr:@vertana/core
or (using pnpm 10.8 or older)
pnpm dlx jsr add @vertana/core

Import symbol

import * as core from "@vertana/core";

Add Package

yarn add jsr:@vertana/core
or (using Yarn 4.8 or older)
yarn dlx jsr add @vertana/core

Import symbol

import * as core from "@vertana/core";

Add Package

vlt install jsr:@vertana/core

Import symbol

import * as core from "@vertana/core";

Add Package

npx jsr add @vertana/core

Import symbol

import * as core from "@vertana/core";

Add Package

bunx jsr add @vertana/core

Import symbol

import * as core from "@vertana/core";