xsAI v0.1 is now available! Read Announcement
xsAI0.2.0-beta.1

Providers

Collection of predefined providers.

This package is not recommended for xsAI-based libraries, which can increase the size of the installation.

Cloud

install sizeminified sizeminzipped size
npm i @xsai-ext/providers-cloud

Examples

Keys

import * as  from '@xsai-ext/providers-cloud'
 
type  = keyof typeof 

OpenAI

import {  } from '@xsai-ext/providers-cloud'
import {  } from '@xsai/generate-text'
import {  } from 'node:process'
 
const  = (.!) 
 
const {  } = await ({
  ....('gpt-4o'), 
  : .!, 
  : 'https://api.openai.com/v1/', 
  : [{
    : 'Why is the sky blue?',
    : 'user'
  }],
  : 'gpt-4o', 
})

Local

install sizeminified sizeminzipped size
npm i @xsai-ext/providers-local

Examples

Keys

import * as  from '@xsai-ext/providers-local'
 
type  = keyof typeof 

Ollama

import {  } from '@xsai-ext/providers-local'
import {  } from '@xsai/generate-text'
import {  } from 'node:process'
 
const  = () 
 
const {  } = await ({
  ....('llama3.2'), 
  : 'http://localhost:11434/v1/', 
  : [{
    : 'Why is the sky blue?',
    : 'user'
  }],
  : 'llama3.2', 
})
Edit on GitHub

Last updated on

On this page