{"id":15175546,"url":"https://github.com/openlit/dokumetry-node","last_synced_at":"2025-10-01T13:31:23.858Z","repository":{"id":219210414,"uuid":"747296050","full_name":"openlit/dokumetry-node","owner":"openlit","description":"Official NodeJS library for monitoring LLM Applications with Doku","archived":true,"fork":false,"pushed_at":"2024-04-15T21:52:21.000Z","size":1928,"stargazers_count":1,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-12T21:48:07.655Z","etag":null,"topics":["ai","ai-observability","anthropic","chatgpt","cohere","dokumetry","generative-ai","gpt-3","large-language-models","library","llm","llmops","metrics","monitoring","node","observability","open-source","openai","sdk","visualization"],"latest_commit_sha":null,"homepage":"https://docs.dokulabs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openlit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-23T16:47:45.000Z","updated_at":"2024-04-18T19:49:34.000Z","dependencies_parsed_at":"2024-03-27T08:51:10.543Z","dependency_job_id":null,"html_url":"https://github.com/openlit/dokumetry-node","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"4f699bc23a6ad8ec9223b0241006711d18e4e0ec"},"previous_names":["dokulabs/dokumetry-node","openlit/dokumetry-node"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlit%2Fdokumetry-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlit%2Fdokumetry-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlit%2Fdokumetry-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlit%2Fdokumetry-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openlit","download_url":"https://codeload.github.com/openlit/dokumetry-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234866645,"owners_count":18899087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-observability","anthropic","chatgpt","cohere","dokumetry","generative-ai","gpt-3","large-language-models","library","llm","llmops","metrics","monitoring","node","observability","open-source","openai","sdk","visualization"],"created_at":"2024-09-27T12:39:26.368Z","updated_at":"2025-10-01T13:31:18.180Z","avatar_url":"https://github.com/openlit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Doku Node SDK - dokumetry\n\n[![Doku NPM Package](https://img.shields.io/badge/Doku-orange)](https://github.com/dokulabs/doku)\n[![Documentation](https://img.shields.io/badge/Documentation-orange?logo=Google-Docs\u0026logoColor=white)](https://docs.dokulabs.com/)\n[![License](https://img.shields.io/github/license/dokulabs/dokumetry-node?label=license\u0026logo=github\u0026color=f80\u0026logoColor=fff%22%20alt=%22License)](https://github.com/dokulabs/dokumetry-node/blob/main/LICENSE)\n[![Package Version](https://img.shields.io/github/tag/dokulabs/dokumetry-node.svg?\u0026label=Package%20Version\u0026logo=npm)](https://github.com/dokulabs/dokumetry-node/tags)\n[![GitHub Last Commit](https://img.shields.io/github/last-commit/dokulabs/dokumetry-node)](https://github.com/dokulabs/dokumetry-node/pulse)\n[![GitHub Contributors](https://img.shields.io/github/contributors/dokulabs/dokumetry-node)](https://github.com/dokulabs/dokumetry-node/graphs/contributors)\n\n[![Tests](https://github.com/dokulabs/dokumetry-node/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/dokulabs/dokumetry-node/actions/workflows/tests.yml)\n[![Linting](https://github.com/dokulabs/dokumetry-node/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/dokulabs/dokumetry-node/actions/workflows/lint.yml)\n[![CodeQL](https://github.com/dokulabs/dokumetry-node/actions/workflows/github-code-scanning/codeql/badge.svg?branch=main)](https://github.com/dokulabs/dokumetry-node/actions/workflows/github-code-scanning/codeql)\n\n[Doku Node SDK](https://www.npmjs.com/package/dokumetry) (`dokumetry`) is your workhorse for collecting and transmitting language learning model (LLM) usage data and metrics with zero added latency. Simplicity is at the core of `dokumetry`, enabling you to kickstart comprehensive LLM observability with just two lines of code. It’s designed to blend seamlessly into your projects, supporting integration with leading LLM platforms:\n\n- ✅ OpenAI\n- ✅ Anthropic\n- ✅ Cohere\n- ✅ Mistral\n- ✅ Azure OpenAI\n\nDeployed as the backbone for all your LLM monitoring needs, `dokumetry` channels crucial usage data directly to Doku, streamlining the tracking process. Unlock efficient and effective observability for your LLM applications with DokuMetry.\n\n## 🔥 Features\n\n- **Effortless Integration:** With `dokumetry`, observability comes easy. Elevate your LLM observability by integrating this powerhouse into your projects using just two lines of code. \n\n- **Zero Latency Impact:** We value the performance of your applications. `dokumetry` is engineered to capture and send data without hampering your application’s speed, ensuring a seamless user experience.\n\n- - **Customizable Data Labeling:** Enhance your LLM analytics with customizable environment and application tags. `dokumetry` allows you to append these labels to your data, offering you the capability to sift through your observability data with ease. Drill down and view metrics in Doku, segmented by these specific tags for a more insightful analysis.\n\n\n## 💿 Installation\n\n```bash\nnpm install dokumetry\n```\n\n## ⚡️ Quick Start\n\n### OpenAI\n\n```\nimport OpenAI from 'openai';\nimport DokuMetry from 'dokumetry';\n\nconst openai = new OpenAI({\n  apiKey: 'My API Key', // defaults to process.env[\"OPENAI_API_KEY\"]\n});\n\n// Pass the above `openai` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.\nDokuMetry.init({llm: openai, dokuUrl: \"YOUR_DOKU_INGESTER_URL\", apiKey: \"YOUR_DOKU_TOKEN\"})\n\nasync function main() {\n  const chatCompletion = await openai.chat.completions.create({\n    messages: [{ role: 'user', content: 'What is LLM Observability and Monitoring?' }],\n    model: 'gpt-3.5-turbo',\n  });\n}\n\nmain();\n```\n\n### Anthropic\n\n```\nimport Anthropic from '@anthropic-ai/sdk';\nimport DokuMetry from 'dokumetry';\n\nconst anthropic = new Anthropic({\n  apiKey: 'my_api_key', // defaults to process.env[\"ANTHROPIC_API_KEY\"]\n});\n\n// Pass the above `anthropic` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.\nDokuMetry.init({llm: anthropic, dokuUrl: \"YOUR_DOKU_INGESTER_URL\", apiKey: \"YOUR_DOKU_TOKEN\"})\n\nasync function main() {\n  const message = await anthropic.messages.create({\n    max_tokens: 1024,\n    messages: [{ role: 'user', content: 'What is LLM Observability and Monitoring?' }],\n    model: 'claude-3-opus-20240229',\n  });\n\n  console.log(message.content);\n}\n\nmain();\n\n```\n\n### Cohere\n\n```\nimport { CohereClient } from \"cohere-ai\";\nimport DokuMetry from 'dokumetry';\n\nconst cohere = new CohereClient({\n    apiKey: \"YOUR_COHERE_API_KEY\",\n});\n\n// Pass the above `cohere` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.\nDokuMetry.init({llm: cohere, dokuUrl: \"YOUR_DOKU_INGESTER_URL\", apiKey: \"YOUR_DOKU_TOKEN\"})\n\n(async () =\u003e {\n    const prediction = await cohere.generate({\n        prompt: \"What is LLM Observability and Monitoring?\",\n        maxTokens: 100,\n    });\n    \n    console.log(\"Received prediction\", prediction);\n})();\n```\n\n## Supported Parameters\n\n| Parameter         | Description                                               | Required      |\n|-------------------|-----------------------------------------------------------|---------------|\n| llm               | Language Learning Model (LLM) Object to track             | Yes           |\n| dokuUrl           | URL of your Doku Instance                                 | Yes           |\n| apiKey            | Your Doku API key                                         | Yes           |\n| environment       | Custom environment tag to include in your metrics         | Optional      |\n| applicationName   | Custom application name tag for your metrics              | Optional      |\n| skipResp          | Skip response from the Doku Ingester for faster execution | Optional      |\n\n\n## Error\nTo make it easier to follow the server errors caused by dokumetry, we have logged the errors like `Dokumetry: Error transmitting Data: HTTP status 401`, where `Dokumetry` is the application name in blue and the rest is the error in red.\n\n## Semantic Versioning\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\nChanges that only affect static types, without breaking runtime behavior.\nChanges to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals).\nChanges that we do not expect to impact the vast majority of users in practice.\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\n\n## Requirements\n\nThe following runtimes are supported:\n\n- Node.js 18 LTS or later (non-EOL) versions.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Security\n\nDoku NPM Package (`dokumetry`) sends the observability data over HTTP/HTTPS to the Doku Ingester which uses key based authentication mechanism to ensure the security of your data. Be sure to keep your API keys confidential and manage permissions diligently. Refer to our [Security Policy](SECURITY)\n\n## Contributing\n\nWe welcome contributions to the Doku NPM Package (`dokumetry`) project. Please refer to [CONTRIBUTING](CONTRIBUTING) for detailed guidelines on how you can participate.\n\n## License\n\nDoku NPM Package (`dokumetry`) is available under the [Apache-2.0 license](LICENSE).\n\n## Support\n\nFor support, issues, or feature requests, submit an issue through the [GitHub issues](https://github.com/dokulabs/doku/issues) associated with the Doku Repository and add `dokumetry-node` label.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenlit%2Fdokumetry-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenlit%2Fdokumetry-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenlit%2Fdokumetry-node/lists"}