# NeatLogs
A comprehensive LLM tracking system that automatically captures and logs all LLM API calls with detailed metrics.
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
[](https://badge.fury.io/py/neatlogs)
## Features
- ๐ **Automatic LLM Call Tracking**: Seamlessly tracks all LLM API calls without code changes
- ๐ **Comprehensive Metrics**: Token usage, costs, response times, and more
- ๐ **Multi-Provider Support**: OpenAI, Anthropic, Google Gemini, Azure OpenAI, and LiteLLM
- ๐งต **Session Management**: Track conversations across multiple threads and agents
- ๐ **Structured Logging**: Detailed logs with OpenTelemetry support
- ๐ฏ **Easy Integration**: Simple one-line initialization
- ๐ **Real-time Monitoring**: Live tracking and statistics
## Quick Start
### Installation
**Basic installation (no LLM libraries):**
```bash
pip install neatlogs
```
### Basic Usage
```python
import neatlogs
# Initialize tracking with your API key
neatlogs.init(
api_key="your-api-key-here"
)
# Now all LLM calls are automatically tracked!
# Use any supported LLM library normally
# Get session statistics
stats = neatlogs.get_session_stats()
print(f"Total calls: {stats['total_calls']}")
print(f"Total cost: ${stats['total_cost']:.4f}")
```
## Supported Providers
- **OpenAI** (GPT models)
- **Anthropic** (Claude models)
- **Google Gemini** (Gemini models)
- **Azure OpenAI**
- **LiteLLM** (unified interface)
- **CrewAI**
### Configuration Options
```python
neatlogs.init(
api_key="your-api-key",
tags=["tag1", "tag2"],
debug=False, # Enable debug logging
)
```
## Session Statistics
Get comprehensive insights into your LLM usage:
```python
stats = neatlogs.get_session_stats()
# Available metrics:
# - total_calls: Number of LLM API calls
# - total_tokens_input: Total input tokens
# - total_tokens_output: Total output tokens
# - total_cost: Total cost in USD
# - average_response_time: Average response time
# - provider_breakdown: Usage by provider
# - model_breakdown: Usage by model
```
Raw data
{
"_id": null,
"home_page": null,
"name": "neatlogs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "llm, tracking, monitoring, logging, ai, machine-learning, observability, collboration",
"author": null,
"author_email": "Neatlogs <hello@neatlogs.com>",
"download_url": "https://files.pythonhosted.org/packages/8d/33/816618f90017b24f151b653f702c97e02cd2153e44938e5c0e9bd1fe49d3/neatlogs-1.0.0.tar.gz",
"platform": null,
"description": "# NeatLogs\n\nA comprehensive LLM tracking system that automatically captures and logs all LLM API calls with detailed metrics.\n\n[](https://www.python.org/downloads/)\n[](https://opensource.org/licenses/MIT)\n[](https://badge.fury.io/py/neatlogs)\n\n## Features\n\n- \ud83d\ude80 **Automatic LLM Call Tracking**: Seamlessly tracks all LLM API calls without code changes\n- \ud83d\udcca **Comprehensive Metrics**: Token usage, costs, response times, and more\n- \ud83d\udd0c **Multi-Provider Support**: OpenAI, Anthropic, Google Gemini, Azure OpenAI, and LiteLLM\n- \ud83e\uddf5 **Session Management**: Track conversations across multiple threads and agents\n- \ud83d\udcdd **Structured Logging**: Detailed logs with OpenTelemetry support\n- \ud83c\udfaf **Easy Integration**: Simple one-line initialization\n- \ud83d\udd0d **Real-time Monitoring**: Live tracking and statistics\n\n## Quick Start\n\n### Installation\n\n**Basic installation (no LLM libraries):**\n\n```bash\npip install neatlogs\n```\n\n### Basic Usage\n\n```python\nimport neatlogs\n\n# Initialize tracking with your API key\nneatlogs.init(\n api_key=\"your-api-key-here\"\n)\n\n# Now all LLM calls are automatically tracked!\n# Use any supported LLM library normally\n\n# Get session statistics\nstats = neatlogs.get_session_stats()\nprint(f\"Total calls: {stats['total_calls']}\")\nprint(f\"Total cost: ${stats['total_cost']:.4f}\")\n```\n\n## Supported Providers\n\n- **OpenAI** (GPT models)\n- **Anthropic** (Claude models)\n- **Google Gemini** (Gemini models)\n- **Azure OpenAI**\n- **LiteLLM** (unified interface)\n- **CrewAI**\n\n### Configuration Options\n\n```python\nneatlogs.init(\n api_key=\"your-api-key\",\n tags=[\"tag1\", \"tag2\"],\n debug=False, # Enable debug logging\n)\n```\n\n## Session Statistics\n\nGet comprehensive insights into your LLM usage:\n\n```python\nstats = neatlogs.get_session_stats()\n\n# Available metrics:\n# - total_calls: Number of LLM API calls\n# - total_tokens_input: Total input tokens\n# - total_tokens_output: Total output tokens\n# - total_cost: Total cost in USD\n# - average_response_time: Average response time\n# - provider_breakdown: Usage by provider\n# - model_breakdown: Usage by model\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package for extracting and managing LLM logs to build a collaborative workspace",
"version": "1.0.0",
"project_urls": {
"Documentation": "https://docs.neatlogs.com/",
"Homepage": "https://github.com/NeatLogs/neatlogs",
"Issues": "https://github.com/NeatLogs/neatlogs/issues",
"Repository": "https://github.com/NeatLogs/neatlogs.git"
},
"split_keywords": [
"llm",
" tracking",
" monitoring",
" logging",
" ai",
" machine-learning",
" observability",
" collboration"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0f960f61bb362c2ed029c6be95bd27960cef84ef544e531a153659680f084dcd",
"md5": "1a30e69585b226431cb696f642dfc291",
"sha256": "c7027a4ad74efa970e5fe8486ab48c9eb0f88f598925103dbda3475e74a9eed9"
},
"downloads": -1,
"filename": "neatlogs-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1a30e69585b226431cb696f642dfc291",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 34243,
"upload_time": "2025-08-19T19:26:22",
"upload_time_iso_8601": "2025-08-19T19:26:22.870524Z",
"url": "https://files.pythonhosted.org/packages/0f/96/0f61bb362c2ed029c6be95bd27960cef84ef544e531a153659680f084dcd/neatlogs-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8d33816618f90017b24f151b653f702c97e02cd2153e44938e5c0e9bd1fe49d3",
"md5": "043155e761b8bcd9eb13a521472490da",
"sha256": "f2b1bd9ac6b0ca82a0225d346ff2b81e6193c8f54291567ea8e6ff7cd4e1675f"
},
"downloads": -1,
"filename": "neatlogs-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "043155e761b8bcd9eb13a521472490da",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 27151,
"upload_time": "2025-08-19T19:26:24",
"upload_time_iso_8601": "2025-08-19T19:26:24.836827Z",
"url": "https://files.pythonhosted.org/packages/8d/33/816618f90017b24f151b653f702c97e02cd2153e44938e5c0e9bd1fe49d3/neatlogs-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-19 19:26:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "NeatLogs",
"github_project": "neatlogs",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "neatlogs"
}