npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@decartai/ai-sdk-provider

v0.0.3

Published

The **Decart provider** for the [AI SDK](https://ai-sdk.dev/docs) contains support for [Decart](https://decart.ai)'s image and video generation models.

Readme

AI SDK - Decart Provider

The Decart provider for the AI SDK contains support for Decart's image and video generation models.

Setup

The Decart provider is available in the @decartai/ai-sdk-provider module. You can install it with:

npm i @decartai/ai-sdk-provider

Provider Instance

You can import the default provider instance decart from @decartai/ai-sdk-provider:

import { decart } from '@decartai/ai-sdk-provider';

If you need a customized setup, you can import createDecart and create a provider instance with your settings:

import { createDecart } from '@decartai/ai-sdk-provider';

const decart = createDecart({
  apiKey: 'your-api-key', // optional, defaults to DECART_API_KEY environment variable
  baseURL: 'custom-url', // optional
  headers: {
    /* custom headers */
  }, // optional
});

You can use the following optional settings to customize the Decart provider instance:

  • baseURL string

    Use a different URL prefix for API calls, e.g. to use proxy servers. The default prefix is https://api.decart.ai.

  • apiKey string

    API key that is being sent using the X-API-KEY header. It defaults to the DECART_API_KEY environment variable.

  • headers Record<string,string>

    Custom headers to include in the requests.

  • fetch (input: RequestInfo, init?: RequestInit) => Promise<Response>

    Custom fetch implementation. You can use it as a middleware to intercept requests, or to provide a custom fetch implementation for e.g. testing.

Image Models

You can create Decart image models using the .image() factory method. For more on image generation with the AI SDK see generateImage().

Basic Usage

import { decart } from '@decartai/ai-sdk-provider';
import { generateImage } from 'ai';
import fs from 'fs';

const { image } = await generateImage({
  model: decart.image('lucy-pro-t2i'),
  prompt: 'Three dogs playing in the snow',
});

const filename = `image-${Date.now()}.png`;
fs.writeFileSync(filename, image.uint8Array);
console.log(`Image saved to ${filename}`);

Model Capabilities

Decart currently offers:

| Model | Description | | -------------- | ------------------------------------------- | | lucy-pro-t2i | High-quality text-to-image generation model |

The model supports the following aspect ratios:

  • 16:9 (landscape)
  • 9:16 (portrait)

Image Model Settings

You can customize the generation behavior with optional settings:

const { image } = await generateImage({
  model: decart.image('lucy-pro-t2i'),
  prompt: 'Three dogs playing in the snow',
  aspectRatio: '16:9',
  seed: 42,
});

Supported settings:

  • aspectRatio string

    Control the aspect ratio of the generated image. Supported values: 16:9 (landscape) and 9:16 (portrait).

  • seed number

    Set a seed value for reproducible results.

Video Models

You can create Decart video models using the .video() factory method. For more on video generation with the AI SDK see experimental_generateVideo().

Text-to-Video

import { decart } from '@decartai/ai-sdk-provider';
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'fs';

const { videos } = await generateVideo({
  model: decart.video('lucy-pro-t2v'),
  prompt: 'A man is riding a horse in a field',
});

fs.writeFileSync('video.mp4', videos[0].uint8Array);

Image-to-Video

Pass an image to animate it into a video:

const { videos } = await generateVideo({
  model: decart.video('lucy-pro-i2v'),
  prompt: {
    image: imageData,
    text: 'The subject begins to walk forward slowly',
  },
});

Motion Control

Use lucy-motion with a trajectory to control camera or subject movement:

const { videos } = await generateVideo({
  model: decart.video('lucy-motion'),
  prompt: {
    image: imageData,
    text: 'The subject moves along the specified path',
  },
  providerOptions: {
    decart: {
      trajectory: [
        { frame: 0, x: 0.5, y: 0.5 },
        { frame: 12, x: 0.7, y: 0.9 },
        { frame: 25, x: 0.3, y: 0.1 },
      ],
    },
  },
});

Model Capabilities

| Model | Description | | -------------- | ---------------------------------------------------- | | lucy-pro-t2v | Text-to-video generation | | lucy-pro-i2v | Image-to-video generation | | lucy-dev-i2v | Image-to-video generation (dev) | | lucy-motion | Image-to-video with trajectory-based motion control |

Video Model Settings

const { videos } = await generateVideo({
  model: decart.video('lucy-pro-t2v'),
  prompt: 'A sunset over the ocean',
  aspectRatio: '16:9',
  seed: 42,
});

Supported settings:

  • aspectRatio string

    Control the aspect ratio. Supported values: 16:9 (landscape) and 9:16 (portrait).

  • seed number

    Set a seed value for reproducible results.

  • resolution string

    Video resolution. Supported values: 1280x720 (720p) and 854x480 (480p).

Provider Options

Pass Decart-specific options via providerOptions.decart:

  • trajectory Array<{ frame: number; x: number; y: number }>

    Motion path for lucy-motion. Each point specifies a frame number and normalized x,y coordinates.

  • orientation "landscape" | "portrait"

    Override orientation directly instead of deriving from aspectRatio.

Learn More

For more details about Decart's capabilities and features, visit Decart AI.