LlamaIndex.TS is the TypeScript/JavaScript port of LlamaIndex Python. While the core concepts remain the same, there are important differences in implementation and API design.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/run-llama/LlamaIndexTS/llms.txt
Use this file to discover all available pages before exploring further.
Key Differences
Language & Type System
Python:- Dynamic typing (with optional type hints)
- Duck typing and runtime flexibility
- Python-specific features (decorators, context managers)
- Static typing with full TypeScript support
- Compile-time type checking
- Modern JavaScript/TypeScript patterns
Runtime Environment Support
LlamaIndex.TS is designed to work across multiple JavaScript runtimes:- Node.js >= 18.0.0
- Deno
- Bun
- Vercel Edge Runtime
- Cloudflare Workers
- Nitro
Browser support is currently limited due to the lack of AsyncLocalStorage-like APIs.
Package Structure
Python
TypeScript
- LlamaIndex.TS uses a modular package structure with provider-specific packages
- Install only what you need:
npm install llamaindex @llamaindex/openai - Core functionality in
llamaindex, providers in@llamaindex/*packages
API Mapping
Settings Configuration
Document Loading
Creating an Index
Query Engine
Chat Engine
Common Migration Patterns
Async/Await
All I/O operations in TypeScript are async:Streaming Responses
Custom Node Parsers
Vector Stores
Naming Conventions
| Python | TypeScript |
|---|---|
snake_case | camelCase |
load_data() | loadData() |
as_query_engine() | asQueryEngine() |
get_nodes_from_documents() | getNodesFromDocuments() |
chunk_size | chunkSize |
embed_model | embedModel |
Provider Packages
Unlike Python where providers are organized as namespaces, TypeScript uses separate npm packages:Not Yet Implemented
Some Python features are not yet available in TypeScript:- Some specialized readers and data connectors
- Certain advanced query engines
- Some evaluation metrics
- GraphRAG components
Getting Help
If you’re migrating from Python and need help:- Join our Discord community
- Check GitHub Discussions
- Review the examples