Skip to main content

Overview

LlamaIndex.TS supports a wide range of LLM and embedding providers through dedicated packages. Each provider implements the common BaseLLM or BaseEmbedding interface, allowing you to switch providers with minimal code changes.

Provider Packages

All providers are published as separate npm packages following the pattern @llamaindex/<provider-name>:
Installing only the providers you need keeps your bundle size small.

Major LLM Providers

OpenAI

OpenAI provides GPT-4 and GPT-3.5 models with excellent performance and tool calling support.Installation:
Environment:
LLM Usage:
Embedding Usage:
Supported Features:
  • Function calling / tool use
  • Streaming responses
  • Vision (GPT-4 Vision models)
  • JSON mode / structured output
  • Multi-modal inputs (images, files)
Popular Models:
  • gpt-4o: Latest flagship model
  • gpt-4o-mini: Fast, cost-effective
  • gpt-4-turbo: Previous generation flagship
  • gpt-3.5-turbo: Fast and affordable

Additional Providers

Deepseek

Fireworks AI

Fast inference for open-source models.

Together AI

Run open-source models at scale.

Perplexity

Online LLMs with real-time web search.

Replicate

Run open-source models via cloud API.

xAI

Grok models from xAI.

Vercel AI

Integration with Vercel AI SDK.

AWS Bedrock

LLMs through AWS Bedrock.

vLLM

Self-hosted high-performance inference.

Portkey AI

LLM gateway with observability and routing.

Embedding Providers

Models:
  • text-embedding-3-small: 1536 dims (customizable)
  • text-embedding-3-large: 3072 dims (customizable)
  • text-embedding-ada-002: 1536 dims (legacy)

Provider Comparison

Switching Providers

Thanks to the unified interface, switching providers is simple:

Best Practices

LlamaIndex.TS automatically detects these standard environment variables.
This keeps your node_modules small and deploy times fast.
  • Development: Use cheaper models like gpt-4o-mini or Ollama
  • Production: Upgrade to gpt-4o or claude-3-7-sonnet for quality
  • Embeddings: text-embedding-3-small offers great quality/cost ratio
For sensitive data, use Ollama or vLLM to run models on your infrastructure:
Different providers excel at different tasks:

Next Steps

LLMs

Learn about the LLM interface and capabilities

Embeddings

Understand embedding models for semantic search