Overview
LlamaIndex.TS supports a wide range of LLM and embedding providers through dedicated packages. Each provider implements the commonBaseLLM 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
- Anthropic
- Google Gemini
- Ollama
- Groq
- Mistral
OpenAI
OpenAI provides GPT-4 and GPT-3.5 models with excellent performance and tool calling support.Installation:- Function calling / tool use
- Streaming responses
- Vision (GPT-4 Vision models)
- JSON mode / structured output
- Multi-modal inputs (images, files)
gpt-4o: Latest flagship modelgpt-4o-mini: Fast, cost-effectivegpt-4-turbo: Previous generation flagshipgpt-3.5-turbo: Fast and affordable
Additional Providers
Deepseek
Deepseek
Fireworks
Fireworks
Together AI
Together AI
Perplexity
Perplexity
Replicate
Replicate
xAI (Grok)
xAI (Grok)
Vercel AI SDK
Vercel AI SDK
AWS Bedrock
AWS Bedrock
vLLM
vLLM
Portkey
Portkey
Embedding Providers
- OpenAI
- Voyage AI
- Cohere
- HuggingFace
- Jina AI
- Mixedbread
- CLIP
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
Use environment variables for API keys
Use environment variables for API keys
Install only what you need
Install only what you need
node_modules small and deploy times fast.Consider cost vs performance
Consider cost vs performance
- Development: Use cheaper models like
gpt-4o-minior Ollama - Production: Upgrade to
gpt-4oorclaude-3-7-sonnetfor quality - Embeddings:
text-embedding-3-smalloffers great quality/cost ratio
Use local models for privacy
Use local models for privacy
For sensitive data, use Ollama or vLLM to run models on your infrastructure:
Test with multiple providers
Test with multiple providers
Different providers excel at different tasks:
Next Steps
LLMs
Learn about the LLM interface and capabilities
Embeddings
Understand embedding models for semantic search