New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@chainfuse/ai-tools

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainfuse/ai-tools

  • 0.6.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

OpenSSF ScorecardSocket Badge

NPM Downloadsnpm bundle sizeNPM Unpacked Size

Build & TestRelease

@chainfuse/ai-tools

Vercel AI SDK plugin for multi-model and provider selection built for edge runtimes. Just replace model property and continue using vercel ai sdk as normal.

Compatability

  • generateText()
  • streamText()
  • generateObject()
  • streamObject()
  • embed()
  • generateImage()

Usage

import { AiModels } from '@chainfuse/types';
import { generateText } from 'ai';
import { AiModel } from '@chainfuse/ai-tools';

generateText({
	model: await new AiModel(
		{
			gateway: {
				accountId: 'cf account id',
				apiToken: 'cf ai gateway token with run permission',
			},
			geoRouting: {
				userCoordinate: {
					lat: 'latitude as a string to preserve 0 placement',
					lon: 'longitude as a string to preserve 0 placement',
				},
				country: 'ISO 3166-1 Alpha 2 country code',
				continent: 'two-letter code of continent',
			},
			environment: 'the gateway to use',
			providers: {
				// api keys and any additional info needed for each service
			},
		},
		// ...
	).wrappedLanguageModel(args, 'AiModels.LanguageModels enum or service name', 'if no enum, then model name (includes autofill typescript types based on service name)'),
	// ... (anything else vercel)
});

// Continue using vercel ai sdk as normal

FAQs

Package last updated on 27 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc