Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
The core library for Vertana, an LLM-powered natural language translation library
@vertana/core
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.
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.
Add Package
deno add jsr:@vertana/core
Import symbol
import * as core from "@vertana/core";
Import directly with a jsr specifier
import * as core from "jsr:@vertana/core";
Add Package
pnpm i jsr:@vertana/core
pnpm dlx jsr add @vertana/core
Import symbol
import * as core from "@vertana/core";
Add Package
yarn add jsr:@vertana/core
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";