Frameworks & Platforms
Graphiti
Use TokenLab as an OpenAI-compatible Graphiti LLM provider
Overview
Graphiti supports OpenAI-compatible /v1 endpoints through OpenAIGenericClient. Point that client at TokenLab and choose a TokenLab model.
Installation
pip install graphiti-core httpxEnvironment
export TOKENLAB_API_KEY="sk-your-tokenlab-key"LLM Client
import os
from graphiti_core.llm_client.config import LLMConfig
from graphiti_core.llm_client.openai_generic_client import OpenAIGenericClient
llm_config = LLMConfig(
api_key=os.environ["TOKENLAB_API_KEY"],
model="claude-sonnet-5",
small_model="gpt-5.6-luna",
base_url="https://api.tokenlab.sh/v1",
)
llm_client = OpenAIGenericClient(
config=llm_config,
structured_output_mode="json_object",
)Pass llm_client into your Graphiti(...) instance alongside your graph database and embedder configuration.
Endpoint Notes
Graphiti's OpenAI-compatible path is chat-completions oriented. Use models that reliably return structured JSON for extraction and deduplication tasks.