0.1.0 • Published 4 months ago

@tsdiapi/together v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

together Plugin for TSDIAPI

A TSDIAPI plugin to extend API functionality with Together AI.


šŸ“Œ About

This is a TSDIAPI plugin designed to integrate Together AI models into your API. It provides an easy way to interact with Together AI for text generation, image analysis, and more.

šŸ”— TSDIAPI CLI: @tsdiapi/cli


šŸ“¦ Installation

Install the plugin using the TSDIAPI CLI:

tsdiapi plugins add together

You can install this plugin using npm:

npm install --save @tsdiapi/together

Then, register the plugin in your TSDIAPI project:

import { createApp } from "@tsdiapi/server";
import createPlugin from "@tsdiapi/together";

createApp({
  plugins: [createPlugin()],
});

šŸš€ Features

  • šŸ›  Seamless integration with Together AI inside TSDIAPI.
  • šŸŽØ Supports text and image-based AI models.
  • āš™ Highly configurable with environment variables and plugin options.
  • šŸ“Š Tracks token usage for cost management.

šŸ”§ Configuration Options

This plugin supports both direct options and environment variables for flexible configuration.

Plugin Options

createPlugin({
  apiKey: "your-api-key",
  model: "meta-llama/Llama-Vision-Free",
  maxTokens: 200,
  temperature: 0.3,
  topP: 0.7,
  topK: 50,
  repetitionPenalty: 1.2,
});
OptionTypeDefaultENV VariableDescription
apiKeystring""TOGETHER_API_KEYTogether AI API key (Required)
modelstring"meta-llama/Llama-Vision-Free"TOGETHER_DEFAULT_MODELDefault Together AI model to use
maxTokensnumber200TOGETHER_MAX_TOKENSMaximum number of tokens per response
temperaturenumber0.3TOGETHER_TEMPERATURESampling temperature for response randomness
topPnumber0.7TOGETHER_TOP_PTop-p (nucleus sampling) value
topKnumber50TOGETHER_TOP_KTop-k sampling value
repetitionPenaltynumber1.2TOGETHER_REPETITION_PENALTYRepetition penalty for controlling repeated responses

Using Environment Variables

Instead of defining options in the code, you can set them as environment variables:

TOGETHER_API_KEY=your-api-key
TOGETHER_DEFAULT_MODEL=meta-llama/Llama-Vision-Free
TOGETHER_MAX_TOKENS=200
TOGETHER_TEMPERATURE=0.3
TOGETHER_TOP_P=0.7
TOGETHER_TOP_K=50
TOGETHER_REPETITION_PENALTY=1.2

šŸ“Œ How to Use

After installation, you can use the Together AI provider to generate text and analyze images.

Get Together Provider

import { getTogetherProvider } from "@tsdiapi/together";

const together = getTogetherProvider();

Basic Chat Completion

const response = await together.chat("Tell me a joke!");
console.log(response.result);

Analyze an Image

const response = await together.analyzeImage(
  "https://example.com/image.jpg",
  "Describe this image."
);
console.log(response.result);

šŸ”— Related Plugins

You can find more TSDIAPI plugins here:
šŸ”— Available Plugins


šŸ‘Øā€šŸ’» Contributing

Contributions are always welcome! Feel free to submit issues or pull requests to improve this plugin.

šŸ“§ Contact: unbywyd@gmail.com

šŸš€ Happy coding with TSDIAPI & Together AI! šŸŽ‰

0.1.0

4 months ago

0.0.1-alpha.3

4 months ago

0.0.1-alpha.2

4 months ago

0.0.1-alpha.1

4 months ago