Installation
LlamaIndex.TS is designed to work across multiple JavaScript runtime environments. This guide covers installation for all supported runtimes and package managers.Quick Install
For most Node.js projects, start with:The
llamaindex package provides core functionality. You’ll also need to install provider packages for LLMs, embeddings, and vector stores.Runtime Requirements
LlamaIndex.TS supports multiple JavaScript runtimes with different requirements:Provider Packages
LlamaIndex.TS uses a modular architecture. Install only the providers you need to keep your bundle size small.LLM Providers
Choose the LLM provider(s) you want to use:- OpenAI
- Anthropic
- Google Gemini
- Other Providers
Vector Store Providers
For production use, integrate with a vector database:- Pinecone
- Qdrant
- Chroma
- Other Stores
Runtime-Specific Setup
Node.js
Node.js >= 20 is required for full AsyncLocalStorage support.Deno
LlamaIndex.TS works with Deno’s npm compatibility:Bun
Bun has full support with its fast package manager:Vercel Edge Runtime
For Vercel Edge Functions, use the edge-compatible entry point:Cloudflare Workers
Cloudflare Workers automatically use the workerd-compatible entry point:Environment Variables
Set up your API keys and configuration:.env
Additional Packages
Workflow and Agents
For building agentic applications:File Readers
For reading different file formats:LlamaCloud
For managed RAG with LlamaCloud:Verifying Installation
Create a simple test file to verify everything works:test.ts
Troubleshooting
Module Resolution Errors
If you encounter module resolution errors, ensure you’re using Node.js >= 20:TypeScript Configuration
Add these settings to yourtsconfig.json:
tsconfig.json
API Key Issues
If your API key isn’t being recognized:- Ensure
.envis in your project root - Install
dotenvand load it: - Verify the key is set:
Next Steps
Quickstart
Build your first RAG application
Core Concepts
Learn about Documents, Nodes, and Indices