hacker news Hacker News
  1. new
  2. show
  3. ask
  4. jobs
I built AutoRouter, an open-source SDK that helps you find the most suitable AI model for a given task. Instead of manually browsing hundreds or thousands of models on Hugging Face, it uses embeddings and a vector database to recommend models based on semantic similarity to your task description.

It works with any type of model, including text generation, classification, and image generation. You can filter by license type, limit the number of results, or use your own custom registry of models.

The SDK requires OpenAI for generating embeddings and Pinecone for storing the model index. Once the models are indexed, selecting a model for a task takes just one line of code.

It’s free to use and open source

Example usage:

import { AutoRouter } from 'autorouter-sdk';

const router = new AutoRouter({ openaiKey: process.env.OPENAI_API_KEY, pineconeKey: process.env.PINECONE_API_KEY });

const models = await router.selectModel('build a chatbot'); console.log(models);

You can also include filters like filter: { license: 'apache-2.0' }

In future I also plan to add closed source models to the registry

I’d be happy to hear any feedback or suggestions.

loading...