LlamaIndex
Connect LangDB to LlamaIndex using OpenAI-compatible setup to enhance LLM workflows with full tracing and streamlined monitoring.
2
Add LangDB into your Code
import os
from llama_index.llms import openai
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
from llama_index.core import Settings
from llama_index.llms.openai import OpenAI
Settings.llm = OpenAI(
base_url=os.getenv("OPENAI_API_BASE"),
api_key=os.getenv("OPENAI_API_KEY"),
model="gpt-4o-mini"
)
documents = SimpleDirectoryReader("data").load_data()
## Rest of your LlamaIndex
Check out full examples in the samples.
Was this helpful?