Infinity Embeddings

Generate embeddings using self-hosted Infinity server

Overview

Infinity is a high-performance self-hosted embedding server that supports various open-source models.

Quick Start

python
from praisonaiagents import embedding

result = embedding(
    input="Hello world",
    model="infinity/BAAI/bge-small-en-v1.5",
    api_base="http://localhost:7997"
)
print(f"Dimensions: {len(result.embeddings[0])}")

CLI Usage

bash
praisonai embed "Hello world" --model infinity/BAAI/bge-small-en-v1.5

Setup

  1. Install and run Infinity server:
bash
pip install infinity-emb
infinity_emb --model-name-or-path BAAI/bge-small-en-v1.5
  1. Set environment variable:
bash
export INFINITY_API_BASE="http://localhost:7997"

Related