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 🙏

© 2024 – Pkg Stats / Ryan Hefner

openai-next-sdk

v1.0.0

Published

provide latest AI model information

Downloads

17

Readme

AI-Model-Hub

Overview

AI-Model-Hub is a powerful utility that provides access to the latest AI model information. It allows you to easily retrieve details about AI models and their providers, making it a valuable tool for developers working with AI services.

Installation

Install the package using yarn:

yarn add ai-model-hub

Alternatively, you can install it using npm:

npm install ai-model-hub

Usage

Once installed, you can import and utilize the package to interact with the available models and providers.

Example: Basic Usage

import { modelHub, ModelHub, modelData } from 'ai-model-hub';

// Get a list of all available providers
const allProviders = modelHub.getAllProviderNames();
console.log('Available providers:', allProviders);

// Get details of a specific provider (case-insensitive)
const providerInfo = modelHub.getProviderInfo('provider_name');
console.log('Provider Info:', providerInfo);

// Get a list of all model names
const allModelNames = modelHub.getAllModelNames();
console.log('All model names:', allModelNames);

// Get model information by model name
const modelInfo = modelHub.getModelInfo('model_name');
console.log('Model Info:', modelInfo);

// Get model pricing information
const modelPrice = modelHub.getModelPrice('model_name');
console.log('Model Price:', modelPrice);

// Search for models using a keyword
const modelsWithKeyword = modelHub.getModelNamesByKeyword('keyword');
console.log('Models matching keyword:', modelsWithKeyword);

Working with modelData (JSON Data)

modelData contains the raw JSON data of all AI models and providers. You can use it directly if you need access to the underlying data structure.

import { modelData } from 'ai-model-hub';

// Access the raw JSON data
console.log('Raw model data:', modelData);

// Example: Iterate over all providers
modelData.forEach((provider) => {
  console.log(`Provider: ${provider.provider}, Models: ${provider.models_list.length}`);
});

Available Methods in ModelHub

  1. getModelList()
    Retrieves the full list of providers.

    const providerList = modelHub.getModelList();
  2. getAllProviderNames()
    Returns an array of all provider names.

    const providerNames = modelHub.getAllProviderNames();
  3. getAllModelNames()
    Gets a flat array of all model names across providers.

    const modelNames = modelHub.getAllModelNames();
  4. getAllModelNamesGroupByProvider()
    Retrieves all model names grouped by their provider.

    const groupedModels = modelHub.getAllModelNamesGroupByProvider();
  5. getProviderInfo(providerName: string)
    Fetches detailed information about a specific provider (case-insensitive).

    const providerInfo = modelHub.getProviderInfo('provider_name');
  6. getAllModelNamesByProvider(providerName: string)
    Gets the names of all models from a specific provider.

    const modelsByProvider = modelHub.getAllModelNamesByProvider('provider_name');
  7. getModelInfo(modelName: string)
    Retrieves detailed information for a specific model by name.

    const modelInfo = modelHub.getModelInfo('model_name');
  8. getModelPrice(modelName: string)
    Fetches the pricing information of a specific model.

    const price = modelHub.getModelPrice('model_name');
  9. getModelNamesByKeyword(keyword: string)
    Searches models by a keyword and returns a list of matching model names.

    const matchingModels = modelHub.getModelNamesByKeyword('keyword');

License

This project is licensed under the CC-BY-NC-ND-4.0 License.
You are free to share the work under the following terms:

  • Attribution: You must give appropriate credit, provide a link to the license, and indicate if changes were made.
  • NonCommercial: You may not use the material for commercial purposes.
  • NoDerivatives: If you remix, transform, or build upon the material, you may not distribute the modified material.
  • No additional restrictions: You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

For more details, please see the official license text.