v0.1.0 — Early Preview

Transform LLM Interactions with Type Safety

Alchemy is a TypeScript framework for building structured, type-safe LLM pipelines. Define recipes, transform multimodal inputs, and get validated outputs — all with full type inference.

ts
import { Alchemist } from "@edv4h/alchemy-node";
import { OpenAITransmuter } from "@edv4h/alchemy-plugin-transmuter-openai";
import { JsonRefiner } from "@edv4h/alchemy-core";
import { z } from "zod";

const alchemist = new Alchemist({
  transmuter: new OpenAITransmuter({ apiKey: "sk-..." }),
});

const result = await alchemist.transmute({
  recipe: {
    spell: { output: "Summarize this text in 3 bullet points" },
    refiner: new JsonRefiner(z.object({
      bullets: z.array(z.string()).length(3),
    })),
  },
  materials: [{ type: "text", text: "Your long document here..." }],
});

console.log(result.output.bullets);
// → ["Point 1", "Point 2", "Point 3"]  ✓ Fully typed!

Why Alchemy?

Built for developers who demand structure and reliability from LLM interactions.

🔒

Type-Safe Output

Define output schemas with Zod. Get fully typed, validated responses from any LLM. No more parsing JSON strings by hand.

🎨

Multimodal Input

Text, images, audio, video, documents, data — all as first-class Material types. Build rich, multi-input pipelines with ease.

🔌

Pluggable Architecture

Swap LLM providers via Transmuters. Add preprocessing with Transforms. Customize output parsing with Refiners.

Packages

A modular architecture — use what you need.

core

@edv4h/alchemy-core

Type definitions, Refiners (Text, JSON/Zod), Material utilities, and Transform helpers. Zero runtime dependencies beyond Zod.

node

@edv4h/alchemy-node

The Alchemist orchestrator class with core re-exports. Provides the main entry point for Node.js server-side usage.

react

@edv4h/alchemy-react

React hooks — useAlchemy, useTransmute, useGenerate — for building interactive LLM-powered UIs with full state management.

plugin

@edv4h/alchemy-plugin-transmuter-openai

OpenAI transmuter plugin — connects Alchemy to GPT-4o, GPT-4o-mini and other OpenAI models.

plugin

@edv4h/alchemy-plugin-transmuter-anthropic

Anthropic transmuter plugin — connects Alchemy to Claude models via the Anthropic SDK.

plugin

@edv4h/alchemy-plugin-transmuter-google

Google transmuter plugin — connects Alchemy to Gemini models via the Google Generative AI SDK.

plugin

@edv4h/alchemy-plugin-transforms-node

Node.js transform helpers — imageUrlToBase64, documentToText, and other server-side material transforms.

The Transmutation Pipeline

Every request flows through a clear, composable pipeline.

Material
Transform
Spell
Transmuter
Refiner
Output