> ## Documentation Index
> Fetch the complete documentation index at: https://docs.visualvortexcreatives.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# LiteLLM

> Documentation for LiteLLM Integration

### LiteLLM Integration

TokenSense has native integration with `litellm`. It intercepts the universal `litellm.completion()` method to provide observability across 100+ LLM providers.

```python theme={null}
from tokensense import observe
import litellm

# Wrap litellm directly
litellm = observe(litellm)

response = litellm.completion(
    model="gemini/gemini-2.5-flash",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)
```

With this integration, you can utilize any provider supported by LiteLLM while maintaining exact cost attribution, token observability, and semantic caching via TokenSense.
