llama-index-callbacks-nebeso
LlamaIndex callback handler for NeBeso — open source AI cost tracking.
Track every LLM call in your LlamaIndex app: tokens, cost, latency, and custom tags — all visible in your NeBeso dashboard in real time.
Installation
pip install llama-index-callbacks-nebeso
Quick start
from llama_index_callbacks_nebeso import NeBesoHandler
from llama_index.core import Settings
from llama_index.core.callbacks import CallbackManager
handler = NeBesoHandler(
api_key="nb_ak_...", # or set NEBESO_API_KEY env var
tags={"feature": "rag-search", "env": "production"},
)
Settings.callback_manager = CallbackManager([handler])
# Now build your index and query normally — all LLM calls are tracked.
Usage with RAG pipelines
from llama_index_callbacks_nebeso import NeBesoHandler
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings
from llama_index.core.callbacks import CallbackManager
handler = NeBesoHandler(api_key="nb_ak_...")
Settings.callback_manager = CallbackManager([handler])
documents = SimpleDirectoryReader("data").load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query("What are the main topics?")
# Token usage and cost are now visible in your NeBeso dashboard.
Supported providers
Works with any LlamaIndex-supported LLM: OpenAI, Anthropic, Google Gemini, Mistral, Meta Llama, Cohere, AWS Bedrock, and more. Cost is calculated automatically from a built-in pricing table covering 60+ models.
Environment variables
| Variable | Description |
|---|---|
NEBESO_API_KEY |
Your NeBeso API key (alternative to api_key= kwarg) |
NEBESO_ENDPOINT |
Override API endpoint (default: https://api.nebeso.com) |
Links
Metadata
Release files for llama-index-callbacks-nebeso 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_callbacks_nebeso-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / llama_index_callbacks_nebeso-0.1.0-py3-none-any.whl
| Download URL | llama_index_callbacks_nebeso-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
94a008b293dfa400b90be7a390d45f4261d03339ac155242e038eb31ed741fa8
|
|
BLAKE2b-256 checksum How to use checksums |
3a8db252b66d7577658a2b4f1458853e81f5aa7bc7bebb748277ebc005b5f931
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|