Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.
TypeScript agent-harnessagent-harness-engineeringai-engineeringai-observabilityamd-gpuclaude-codeclickhousecodexcoding-agentcoding-agentscursorgenaigpu-monitoringllm-observabilityllmopsnvidia-smiobservabilityopen-sourceopenaiopentelemetry
Initial Commit
patcher99a3380c0524e6
diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.mdnew file mode 100644index 00000000..d1073a93--- /dev/null+++ b/.github/ISSUE_TEMPLATE/bug.md@@ -0,0 +1,37 @@+---+name: Bug+about: Create a report to help us improve+title: ''+labels: 'bug :bug:, Up for Grab! :raised_hand:'+assignees: ''++---++### Describe the bug+A clear and concise description of what the bug is.++### Steps to Reproduce+1. Go to '...'+2. Click on '....'+3. Scroll down to '....'+4. See error++### Expected behavior+A clear and concise description of what you expected to happen.++### Screenshots+If applicable, add screenshots to help explain your problem.++### Desktop (please complete the following information)+ - OS: [e.g. iOS]+ - Browser [e.g. chrome, safari]+ - Version [e.g. 22]++### Smartphone (please complete the following information)+ - Device: [e.g. iPhone6]+ - OS: [e.g. iOS8.1]+ - Browser [e.g. stock browser, safari]+ - Version [e.g. 22]++### Additional context+Add any other context about the problem here.diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.mdnew file mode 100644index 00000000..252e529d--- /dev/null+++ b/.github/ISSUE_TEMPLATE/feature-request.md@@ -0,0 +1,20 @@+---+name: Feature Request+about: Suggest an idea for this project+title: ''+labels: 'feature :rocket:, Up for Grab! :raised_hand:'+assignees: ''++---++### Is your feature request related to a problem? Please describe.+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]++### Describe the solution you'd like+A clear and concise description of what you want to happen.++### Describe alternatives you've considered+A clear and concise description of any alternative solutions or features you've considered.++### Additional context+Add any other context or screenshots about the feature request here.diff --git a/.github/dependabot.yml b/.github/dependabot.ymlnew file mode 100644index 00000000..5ace4600--- /dev/null+++ b/.github/dependabot.yml@@ -0,0 +1,6 @@+version: 2+updates:+ - package-ecosystem: "github-actions"+ directory: "/"+ schedule:+ interval: "weekly"diff --git a/.gitignore b/.gitignorenew file mode 100644index 00000000..b512c09d--- /dev/null+++ b/.gitignore@@ -0,0 +1 @@+node_modules\ No newline at end of filediff --git a/CODEOWNERS b/CODEOWNERSnew file mode 100644index 00000000..042d7f71--- /dev/null+++ b/CODEOWNERS@@ -0,0 +1,2 @@+# Default owners for everything in the repo, unless a later match takes precedence.+* @dokulabs/dokuersdiff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.mdnew file mode 100644index 00000000..18c91471--- /dev/null+++ b/CODE_OF_CONDUCT.md@@ -0,0 +1,128 @@+# Contributor Covenant Code of Conduct++## Our Pledge++We as members, contributors, and leaders pledge to make participation in our+community a harassment-free experience for everyone, regardless of age, body+size, visible or invisible disability, ethnicity, sex characteristics, gender+identity and expression, level of experience, education, socio-economic status,+nationality, personal appearance, race, religion, or sexual identity+and orientation.++We pledge to act and interact in ways that contribute to an open, welcoming,+diverse, inclusive, and healthy community.++## Our Standards++Examples of behavior that contributes to a positive environment for our+community include:++* Demonstrating empathy and kindness toward other people+* Being respectful of differing opinions, viewpoints, and experiences+* Giving and gracefully accepting constructive feedback+* Accepting responsibility and apologizing to those affected by our mistakes,+ and learning from the experience+* Focusing on what is best not just for us as individuals, but for the+ overall community++Examples of unacceptable behavior include:++* The use of sexualized language or imagery, and sexual attention or+ advances of any kind+* Trolling, insulting or derogatory comments, and personal or political attacks+* Public or private harassment+* Publishing others' private information, such as a physical or email+ address, without their explicit permission+* Other conduct which could reasonably be considered inappropriate in a+ professional setting++## Enforcement Responsibilities++Community leaders are responsible for clarifying and enforcing our standards of+acceptable behavior and will take appropriate and fair corrective action in+response to any behavior that they deem inappropriate, threatening, offensive,+or harmful.++Community leaders have the right and responsibility to remove, edit, or reject+comments, commits, code, wiki edits, issues, and other contributions that are+not aligned to this Code of Conduct, and will communicate reasons for moderation+decisions when appropriate.++## Scope++This Code of Conduct applies within all community spaces, and also applies when+an individual is officially representing the community in public spaces.+Examples of representing our community include using an official e-mail address,+posting via an official social media account, or acting as an appointed+representative at an online or offline event.++## Enforcement++Instances of abusive, harassing, or otherwise unacceptable behavior may be+reported to the community leaders responsible for enforcement at+.+All complaints will be reviewed and investigated promptly and fairly.++All community leaders are obligated to respect the privacy and security of the+reporter of any incident.++## Enforcement Guidelines++Community leaders will follow these Community Impact Guidelines in determining+the consequences for any action they deem in violation of this Code of Conduct:++### 1. Correction++**Community Impact**: Use of inappropriate language or other behavior deemed+unprofessional or unwelcome in the community.++**Consequence**: A private, written warning from community leaders, providing+clarity around the nature of the violation and an explanation of why the+behavior was inappropriate. A public apology may be requested.++### 2. Warning++**Community Impact**: A violation through a single incident or series+of actions.++**Consequence**: A warning with consequences for continued behavior. No+interaction with the people involved, including unsolicited interaction with+those enforcing the Code of Conduct, for a specified period of time. This+includes avoiding interactions in community spaces as well as external channels+like social media. Violating these terms may lead to a temporary or+permanent ban.++### 3. Temporary Ban++**Community Impact**: A serious violation of community standards, including+sustained inappropriate behavior.++**Consequence**: A temporary ban from any sort of interaction or public+communication with the community for a specified period of time. No public or+private interaction with the people involved, including unsolicited interaction+with those enforcing the Code of Conduct, is allowed during this period.+Violating these terms may lead to a permanent ban.++### 4. Permanent Ban++**Community Impact**: Demonstrating a pattern of violation of community+standards, including sustained inappropriate behavior, harassment of an+individual, or aggression toward or disparagement of classes of individuals.++**Consequence**: A permanent ban from any sort of public interaction within+the community.++## Attribution++This Code of Conduct is adapted from the [Contributor Covenant][homepage],+version 2.0, available at+https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.++Community Impact Guidelines were inspired by [Mozilla's code of conduct+enforcement ladder](https://github.com/mozilla/diversity).++[homepage]: https://www.contributor-covenant.org++For answers to common questions about this code of conduct, see the FAQ at+https://www.contributor-covenant.org/faq. Translations are available at+https://www.contributor-covenant.org/translations.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdnew file mode 100644index 00000000..85021a2b--- /dev/null+++ b/CONTRIBUTING.md@@ -0,0 +1,77 @@+# Contributing to Doku++We welcome contributions to the Doku project and are grateful for every contribution from bug reports to new features. If you are looking to contribute to the codebase, improve documentation, report issues, or suggest new features, this document is a set of guidelines to help you get started.++## Getting Started++Before you begin:+- Ensure you have a [GitHub account](https://github.com/join).+- Familiarize yourself with git commands in the [Git Documentation](https://git-scm.com/documentation).+- Read the README for project setup instructions.++## Contributing Workflow++Here's how you can contribute to Doku:++1. **Fork the Repository**+ - Click the "Fork" button at the top right corner of the [Doku repository](https://github.com/dokulabs/doku).++2. **Clone the Forked Repository**+ - Clone your fork to your local machine:++ ```+ git clone https://github.com/YOUR_USERNAME/doku.git+ ```++3. **Create Your Feature Branch**+ - Create a branch for your contribution:++ ```+ git checkout -b feature/my-new-feature+ ```++4. **Make Your Changes**+ - Make and test your changes locally. Make sure you adhere to the code style and guidelines of the project.++5. **Commit Your Changes**+ - Commit your changes with a descriptive message:++ ```+ git commit -am 'Add some feature'+ ```++6. **Push to GitHub**+ - Push your changes to your fork:++ ```+ git push origin feature/my-new-feature+ ```++7. **Submit a Pull Request**+ - Go to your fork on GitHub, select your feature branch, and click on "Pull request" to send a pull request to the original repository.+ - Ensure the description clearly describes the problem and solution. Include any relevant issue numbers in your pull request description.++## Reporting Issues++If you find a bug or have a suggestion for improvement:+- Check the GitHub Issue Tracker to see if the issue has already been reported.+- If the issue is new, click the "Issues" tab, and then click "New Issue" to submit your issue.+- Provide as much information as possible to help us resolve the issue. This can include error messages, screenshots, and the steps to reproduce the issue.++## Pull Request Guidelines++When submitting a pull request, please follow these guidelines for a smooth collaboration process:+- Keep changes compact and well-documented to make the review process easier.+- Rebase your feature branch with the latest changes from the main branch to stay up to date.+- Add tests for new features to ensure they work as expected.+- Update documentation if necessary.++## Code of Conduct++We are committed to fostering an open and welcoming environment. By participating, you are expected to uphold the [Code of Conduct](CODE_OF_CONDUCT.md).++## Queries++If you have any questions or need further clarification about contributing, feel free to open an issue for discussion or ask for help on a specific topic.++Thank you for your interest in contributing to Doku!diff --git a/LICENSE b/LICENSEnew file mode 100644index 00000000..f288702d--- /dev/null+++ b/LICENSE@@ -0,0 +1,674 @@+ GNU GENERAL PUBLIC LICENSE+ Version 3, 29 June 2007++ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++ Preamble++ The GNU General Public License is a free, copyleft license for+software and other kinds of works.++ The licenses for most software and other practical works are designed+to take away your freedom to share and change the works. By contrast,+the GNU General Public License is intended to guarantee your freedom to+share and change all versions of a program--to make sure it remains free+software for all its users. We, the Free Software Foundation, use the+GNU General Public License for most of our software; it applies also to+any other work released this way by its authors. You can apply it to+your programs, too.++ When we speak of free software, we are referring to freedom, not+price. Our General Public Licenses are designed to make sure that you+have the freedom to distribute copies of free software (and charge for+them if you wish), that you receive source code or can get it if you+want it, that you can change the software or use pieces of it in new+free programs, and that you know you can do these things.++ To protect your rights, we need to prevent others from denying you+these rights or asking you to surrender the rights. Therefore, you have+certain responsibilities if you distribute copies of the software, or if+you modify it: responsibilities to respect the freedom of others.++ For example, if you distribute copies of such a program, whether+gratis or for a fee, you must pass on to the recipients the same+freedoms that you received. You must make sure that they, too, receive+or can get the source code. And you must show them these terms so they+know their rights.++ Developers that use the GNU GPL protect your rights with two steps:+(1) assert copyright on the software, and (2) offer you this License+giving you legal permission to copy, distribute and/or modify it.++ For the developers' and authors' protection, the GPL clearly explains+that there is no warranty for this free software. For both users' and+authors' sake, the GPL requires that modified versions be marked as+changed, so that their problems will not be attributed erroneously to+authors of previous versions.++ Some devices are designed to deny users access to install or run+modified versions of the software inside them, although the manufacturer+can do so. This is fundamentally incompatible with the aim of+protecting users' freedom to change the software. The systematic+pattern of such abuse occurs in the area of products for individuals to+use, which is precisely where it is most unacceptable. Therefore, we+have designed this version of the GPL to prohibit the practice for those+products. If such problems arise substantially in other domains, we+stand ready to extend this provision to those domains in future versions+of the GPL, as needed to protect the freedom of users.++ Finally, every program is threatened constantly by software patents.+States should not allow patents to restrict development and use of+software on general-purpose computers, but in those that do, we wish to+avoid the special danger that patents applied to a free program could+make it effectively proprietary. To prevent this, the GPL assures that+patents cannot be used to render the program non-free.++ The precise terms and conditions for copying, distribution and+modification follow.++ TERMS AND CONDITIONS++ 0. Definitions.++ "This License" refers to version 3 of the GNU General Public License.++ "Copyright" also means copyright-like laws that apply to other kinds of+works, such as semiconductor masks.++ "The Program" refers to any copyrightable work licensed under this+License. Each licensee is addressed as "you". "Licensees" and+"recipients" may be individuals or organizations.++ To "modify" a work means to copy from or adapt all or part of the work+in a fashion requiring copyright permission, other than the making of an+exact copy. The resulting work is called a "modified version" of the+earlier work or a work "based on" the earlier work.++ A "covered work" means either the unmodified Program or a work based+on the Program.++ To "propagate" a work means to do anything with it that, without+permission, would make you directly or secondarily liable for+infringement under applicable copyright law, except executing it on a+computer or modifying a private copy. Propagation includes copying,+distribution (with or without modification), making available to the+public, and in some countries other activities as well.++ To "convey" a work means any kind of propagation that enables other+parties to make or receive copies. Mere interaction with a user through+a computer network, with no transfer of a copy, is not conveying.++ An interactive user interface displays "Appropriate Legal Notices"+to the extent that it includes a convenient and prominently visible+feature that (1) displays an appropriate copyright notice, and (2)+tells the user that there is no warranty for the work (except to the+extent that warranties are provided), that licensees may convey the+work under this License, and how to view a copy of this License. If+the interface presents a list of user commands or options, such as a+menu, a prominent item in the list meets this criterion.++ 1. Source Code.++ The "source code" for a work means the preferred form of the work+for making modifications to it. "Object code" means any non-source+form of a work.++ A "Standard Interface" means an interface that either is an official+standard defined by a recognized standards body, or, in the case of+interfaces specified for a particular programming language, one that+is widely used among developers working in that language.++ The "System Libraries" of an executable work include anything, other+than the work as a whole, that (a) is included in the normal form of+packaging a Major Component, but which is not part of that Major+Component, and (b) serves only to enable use of the work with that+Major Component, or to implement a Standard Interface for which an+implementation is available to the public in source code form. A+"Major Component", in this context, means a major essential component+(kernel, window system, and so on) of the specific operating system+(if any) on which the executable work runs, or a compiler used to+produce the work, or an object code interpreter used to run it.++ The "Corresponding Source" for a work in object code form means all+the source code needed to generate, install, and (for an executable+work) run the object code and to modify the work, including scripts to+control those activities. However, it does not include the work's+System Libraries, or general-purpose tools or generally available free+programs which are used unmodified in performing those activities but+which are not part of the work. For example, Corresponding Source+includes interface definition files associated with source files for+the work, and the source code for shared libraries and dynamically+linked subprograms that the work is specifically designed to require,+such as by intimate data communication or control flow between those+subprograms and other parts of the work.++ The Corresponding Source need not include anything that users+can regenerate automatically from other parts of the Corresponding+Source.++ The Corresponding Source for a work in source code form is that+same work.++ 2. Basic Permissions.++ All rights granted under this License are granted for the term of+copyright on the Program, and are irrevocable provided the stated+conditions are met. This License explicitly affirms your unlimited+permission to run the unmodified Program. The output from running a+covered work is covered by this License only if the output, given its+content, constitutes a covered work. This License acknowledges your+rights of fair use or other equivalent, as provided by copyright law.++ You may make, run and propagate covered works that you do not+convey, without conditions so long as your license otherwise remains+in force. You may convey covered works to others for the sole purpose+of having them make modifications exclusively for you, or provide you+with facilities for running those works, provided that you comply with+the terms of this License in conveying all material for which you do+not control copyright. Those thus making or running the covered works+for you must do so exclusively on your behalf, under your direction+and control, on terms that prohibit them from making any copies of+your copyrighted material outside their relationship with you.++ Conveying under any other circumstances is permitted solely under+the conditions stated below. Sublicensing is not allowed; section 10+makes it unnecessary.++ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.++ No covered work shall be deemed part of an effective technological+measure under any applicable law fulfilling obligations under article+11 of the WIPO copyright treaty adopted on 20 December 1996, or+similar laws prohibiting or restricting circumvention of such+measures.++ When you convey a covered work, you waive any legal power to forbid+circumvention of technological measures to the extent such circumvention+is effected by exercising rights under this License with respect to+the covered work, and you disclaim any intention to limit operation or+modification of the work as a means of enforcing, against the work's+users, your or third parties' legal rights to forbid circumvention of+technological measures.++ 4. Conveying Verbatim Copies.++ You may convey verbatim copies of the Program's source code as you+receive it, in any medium, provided that you conspicuously and+appropriately publish on each copy an appropriate copyright notice;+keep intact all notices stating that this License and any+non-permissive terms added in accord with section 7 apply to the code;+keep intact all notices of the absence of any warranty; and give all+recipients a copy of this License along with the Program.++ You may charge any price or no price for each copy that you convey,+and you may offer support or warranty protection for a fee.++ 5. Conveying Modified Source Versions.++ You may convey a work based on the Program, or the modifications to+produce it from the Program, in the form of source code under the+terms of section 4, provided that you also meet all of these conditions:++ a) The work must carry prominent notices stating that you modified+ it, and giving a relevant date.++ b) The work must carry prominent notices stating that it is+ released under this License and any conditions added under section+ 7. This requirement modifies the requirement in section 4 to+ "keep intact all notices".++ c) You must license the entire work, as a whole, under this+ License to anyone who comes into possession of a copy. This+ License will therefore apply, along with any applicable section 7+ additional terms, to the whole of the work, and all its parts,+ regardless of how they are packaged. This License gives no+ permission to license the work in any other way, but it does not+ invalidate such permission if you have separately received it.++ d) If the work has interactive user interfaces, each must display+ Appropriate Legal Notices; however, if the Program has interactive+ interfaces that do not display Appropriate Legal Notices, your+ work need not make them do so.++ A compilation of a covered work with other separate and independent+works, which are not by their nature extensions of the covered work,+and which are not combined with it such as to form a larger program,+in or on a volume of a storage or distribution medium, is called an+"aggregate" if the compilation and its resulting copyright are not+used to limit the access or legal rights of the compilation's users+beyond what the individual works permit. Inclusion of a covered work+in an aggregate does not cause this License to apply to the other+parts of the aggregate.++ 6. Conveying Non-Source Forms.++ You may convey a covered work in object code form under the terms+of sections 4 and 5, provided that you also convey the+machine-readable Corresponding Source under the terms of this License,+in one of these ways:++ a) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by the+ Corresponding Source fixed on a durable physical medium+ customarily used for software interchange.++ b) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by a+ written offer, valid for at least three years and valid for as+ long as you offer spare parts or customer support for that product+ model, to give anyone who possesses the object code either (1) a+ copy of the Corresponding Source for all the software in the+ product that is covered by this License, on a durable physical+ medium customarily used for software interchange, for a price no+ more than your reasonable cost of physically performing this+ conveying of source, or (2) access to copy the+ Corresponding Source from a network server at no charge.++ c) Convey individual copies of the object code with a copy of the+ written offer to provide the Corresponding Source. This+ alternative is allowed only occasionally and noncommercially, and+ only if you received the object code with such an offer, in accord+ with subsection 6b.++ d) Convey the object code by offering access from a designated+ place (gratis or for a charge), and offer equivalent access to the+ Corresponding Source in the same way through the same place at no+ further charge. You need not require recipients to copy the+ Corresponding Source along with the object code. If the place to+ copy the object code is a network server, the Corresponding Source+ may be on a different server (operated by you or a third party)+ that supports equivalent copying facilities, provided you maintain+ clear directions next to the object code saying where to find the+ Corresponding Source. Regardless of what server hosts the+ Corresponding Source, you remain obligated to ensure that it is+ available for as long as needed to satisfy these requirements.++ e) Convey the object code using peer-to-peer transmission, provided+ you inform other peers where the object code and Corresponding+ Source of the work are being offered to the general public at no+ charge under subsection 6d.++ A separable portion of the object code, whose source code is excluded+from the Corresponding Source as a System Library, need not be+included in conveying the object code work.++ A "User Product" is either (1) a "consumer product", which means any+tangible personal property which is normally used for personal, family,+or household purposes, or (2) anything designed or sold for incorporation+into a dwelling. In determining whether a product is a consumer product,+doubtful cases shall be resolved in favor of coverage. For a particular+product received by a particular user, "normally used" refers to a+typical or common use of that class of product, regardless of the status+of the particular user or of the way in which the particular user+actually uses, or expects or is expected to use, the product. A product+is a consumer product regardless of whether the product has substantial+commercial, industrial or non-consumer uses, unless such uses represent+the only significant mode of use of the product.++ "Installation Information" for a User Product means any methods,+procedures, authorization keys, or other information required to install+and execute modified versions of a covered work in that User Product from+a modified version of its Corresponding Source. The information must+suffice to ensure that the continued functioning of the modified object+code is in no case prevented or interfered with solely because+modification has been made.++ If you convey an object code work under this section in, or with, or+specifically for use in, a User Product, and the conveying occurs as+part of a transaction in which the right of possession and use of the+User Product is transferred to the recipient in perpetuity or for a+fixed term (regardless of how the transaction is characterized), the+Corresponding Source conveyed under this section must be accompanied+by the Installation Information. But this requirement does not apply+if neither you nor any third party retains the ability to install+modified object code on the User Product (for example, the work has+been installed in ROM).++ The requirement to provide Installation Information does not include a+requirement to continue to provide support service, warranty, or updates+for a work that has been modified or installed by the recipient, or for+the User Product in which it has been modified or installed. Access to a+network may be denied when the modification itself materially and+adversely affects the operation of the network or violates the rules and+protocols for communication across the network.++ Corresponding Source conveyed, and Installation Information provided,+in accord with this section must be in a format that is publicly+documented (and with an implementation available to the public in+source code form), and must require no special password or key for+unpacking, reading or copying.++ 7. Additional Terms.++ "Additional permissions" are terms that supplement the terms of this+License by making exceptions from one or more of its conditions.+Additional permissions that are applicable to the entire Program shall+be treated as though they were included in this License, to the extent+that they are valid under applicable law. If additional permissions+apply only to part of the Program, that part may be used separately+under those permissions, but the entire Program remains governed by+this License without regard to the additional permissions.++ When you convey a copy of a covered work, you may at your option+remove any additional permissions from that copy, or from any part of+it. (Additional permissions may be written to require their own+removal in certain cases when you modify the work.) You may place+additional permissions on material, added by you to a covered work,+for which you have or can give appropriate copyright permission.++ Notwithstanding any other provision of this License, for material you+add to a covered work, you may (if authorized by the copyright holders of+that material) supplement the terms of this License with terms:++ a) Disclaiming warranty or limiting liability differently from the+ terms of sections 15 and 16 of this License; or++ b) Requiring preservation of specified reasonable legal notices or+ author attributions in that material or in the Appropriate Legal+ Notices displayed by works containing it; or++ c) Prohibiting misrepresentation of the origin of that material, or+ requiring that modified versions of such material be marked in+ reasonable ways as different from the original version; or++ d) Limiting the use for publicity purposes of names of licensors or+ authors of the material; or++ e) Declining to grant rights under trademark law for use of some+ trade names, trademarks, or service marks; or++ f) Requiring indemnification of licensors and authors of that+ material by anyone who conveys the material (or modified versions of+ it) with contractual assumptions of liability to the recipient, for+ any liability that these contractual assumptions directly impose on+ those licensors and authors.++ All other non-permissive additional terms are considered "further+restrictions" within the meaning of section 10. If the Program as you+received it, or any part of it, contains a notice stating that it is+governed by this License along with a term that is a further+restriction, you may remove that term. If a license document contains+a further restriction but permits relicensing or conveying under this+License, you may add to a covered work material governed by the terms+of that license document, provided that the further restriction does+not survive such relicensing or conveying.++ If you add terms to a covered work in accord with this section, you+must place, in the relevant source files, a statement of the+additional terms that apply to those files, or a notice indicating+where to find the applicable terms.++ Additional terms, permissive or non-permissive, may be stated in the+form of a separately written license, or stated as exceptions;+the above requirements apply either way.++ 8. Termination.++ You may not propagate or modify a covered work except as expressly+provided under this License. Any attempt otherwise to propagate or+modify it is void, and will automatically terminate your rights under+this License (including any patent licenses granted under the third+paragraph of section 11).++ However, if you cease all violation of this License, then your+license from a particular copyright holder is reinstated (a)+provisionally, unless and until the copyright holder explicitly and+finally terminates your license, and (b) permanently, if the copyright+holder fails to notify you of the violation by some reasonable means+prior to 60 days after the cessation.++ Moreover, your license from a particular copyright holder is+reinstated permanently if the copyright holder notifies you of the+violation by some reasonable means, this is the first time you have+received notice of violation of this License (for any work) from that+copyright holder, and you cure the violation prior to 30 days after+your receipt of the notice.++ Termination of your rights under this section does not terminate the+licenses of parties who have received copies or rights from you under+this License. If your rights have been terminated and not permanently+reinstated, you do not qualify to receive new licenses for the same+material under section 10.++ 9. Acceptance Not Required for Having Copies.++ You are not required to accept this License in order to receive or+run a copy of the Program. Ancillary propagation of a covered work+occurring solely as a consequence of using peer-to-peer transmission+to receive a copy likewise does not require acceptance. However,+nothing other than this License grants you permission to propagate or+modify any covered work. These actions infringe copyright if you do+not accept this License. Therefore, by modifying or propagating a+covered work, you indicate your acceptance of this License to do so.++ 10. Automatic Licensing of Downstream Recipients.++ Each time you convey a covered work, the recipient automatically+receives a license from the original licensors, to run, modify and+propagate that work, subject to this License. You are not responsible+for enforcing compliance by third parties with this License.++ An "entity transaction" is a transaction transferring control of an+organization, or substantially all assets of one, or subdividing an+organization, or merging organizations. If propagation of a covered+work results from an entity transaction, each party to that+transaction who receives a copy of the work also receives whatever+licenses to the work the party's predecessor in interest had or could+give under the previous paragraph, plus a right to possession of the+Corresponding Source of the work from the predecessor in interest, if+the predecessor has it or can get it with reasonable efforts.++ You may not impose any further restrictions on the exercise of the+rights granted or affirmed under this License. For example, you may+not impose a license fee, royalty, or other charge for exercise of+rights granted under this License, and you may not initiate litigation+(including a cross-claim or counterclaim in a lawsuit) alleging that+any patent claim is infringed by making, using, selling, offering for+sale, or importing the Program or any portion of it.++ 11. Patents.++ A "contributor" is a copyright holder who authorizes use under this+License of the Program or a work on which the Program is based. The+work thus licensed is called the contributor's "contributor version".++ A contributor's "essential patent claims" are all patent claims+owned or controlled by the contributor, whether already acquired or+hereafter acquired, that would be infringed by some manner, permitted+by this License, of making, using, or selling its contributor version,+but do not include claims that would be infringed only as a+consequence of further modification of the contributor version. For+purposes of this definition, "control" includes the right to grant+patent sublicenses in a manner consistent with the requirements of+this License.++ Each contributor grants you a non-exclusive, worldwide, royalty-free+patent license under the contributor's essential patent claims, to+make, use, sell, offer for sale, import and otherwise run, modify and+propagate the contents of its contributor version.++ In the following three paragraphs, a "patent license" is any express+agreement or commitment, however denominated, not to enforce a patent+(such as an express permission to practice a patent or covenant not to+sue for patent infringement). To "grant" such a patent license to a+party means to make such an agreement or commitment not to enforce a+patent against the party.++ If you convey a covered work, knowingly relying on a patent license,+and the Corresponding Source of the work is not available for anyone+to copy, free of charge and under the terms of this License, through a+publicly available network server or other readily accessible means,+then you must either (1) cause the Corresponding Source to be so+available, or (2) arrange to deprive yourself of the benefit of the+patent license for this particular work, or (3) arrange, in a manner+consistent with the requirements of this License, to extend the patent+license to downstream recipients. "Knowingly relying" means you have+actual knowledge that, but for the patent license, your conveying the+covered work in a country, or your recipient's use of the covered work+in a country, would infringe one or more identifiable patents in that+country that you have reason to believe are valid.++ If, pursuant to or in connection with a single transaction or+arrangement, you convey, or propagate by procuring conveyance of, a+covered work, and grant a patent license to some of the parties+receiving the covered work authorizing them to use, propagate, modify+or convey a specific copy of the covered work, then the patent license+you grant is automatically extended to all recipients of the covered+work and works based on it.++ A patent license is "discriminatory" if it does not include within+the scope of its coverage, prohibits the exercise of, or is+conditioned on the non-exercise of one or more of the rights that are+specifically granted under this License. You may not convey a covered+work if you are a party to an arrangement with a third party that is+in the business of distributing software, under which you make payment+to the third party based on the extent of your activity of conveying+the work, and under which the third party grants, to any of the+parties who would receive the covered work from you, a discriminatory+patent license (a) in connection with copies of the covered work+conveyed by you (or copies made from those copies), or (b) primarily+for and in connection with specific products or compilations that+contain the covered work, unless you entered into that arrangement,+or that patent license was granted, prior to 28 March 2007.++ Nothing in this License shall be construed as excluding or limiting+any implied license or other defenses to infringement that may+otherwise be available to you under applicable patent law.++ 12. No Surrender of Others' Freedom.++ If conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License. If you cannot convey a+covered work so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you may+not convey it at all. For example, if you agree to terms that obligate you+to collect a royalty for further conveying from those to whom you convey+the Program, the only way you could satisfy both those terms and this+License would be to refrain entirely from conveying the Program.++ 13. Use with the GNU Affero General Public License.++ Notwithstanding any other provision of this License, you have+permission to link or combine any covered work with a work licensed+under version 3 of the GNU Affero General Public License into a single+combined work, and to convey the resulting work. The terms of this+License will continue to apply to the part which is the covered work,+but the special requirements of the GNU Affero General Public License,+section 13, concerning interaction through a network will apply to the+combination as such.++ 14. Revised Versions of this License.++ The Free Software Foundation may publish revised and/or new versions of+the GNU General Public License from time to time. Such new versions will+be similar in spirit to the present version, but may differ in detail to+address new problems or concerns.++ Each version is given a distinguishing version number. If the+Program specifies that a certain numbered version of the GNU General+Public License "or any later version" applies to it, you have the+option of following the terms and conditions either of that numbered+version or of any later version published by the Free Software+Foundation. If the Program does not specify a version number of the+GNU General Public License, you may choose any version ever published+by the Free Software Foundation.++ If the Program specifies that a proxy can decide which future+versions of the GNU General Public License can be used, that proxy's+public statement of acceptance of a version permanently authorizes you+to choose that version for the Program.++ Later license versions may give you additional or different+permissions. However, no additional obligations are imposed on any+author or copyright holder as a result of your choosing to follow a+later version.++ 15. Disclaimer of Warranty.++ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++ 16. Limitation of Liability.++ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF+SUCH DAMAGES.++ 17. Interpretation of Sections 15 and 16.++ If the disclaimer of warranty and limitation of liability provided+above cannot be given local legal effect according to their terms,+reviewing courts shall apply local law that most closely approximates+an absolute waiver of all civil liability in connection with the+Program, unless a warranty or assumption of liability accompanies a+copy of the Program in return for a fee.++ END OF TERMS AND CONDITIONS++ How to Apply These Terms to Your New Programs++ If you develop a new program, and you want it to be of the greatest+possible use to the public, the best way to achieve this is to make it+free software which everyone can redistribute and change under these terms.++ To do so, attach the following notices to the program. It is safest+to attach them to the start of each source file to most effectively+state the exclusion of warranty; and each file should have at least+the "copyright" line and a pointer to where the full notice is found.++ <one line to give the program's name and a brief idea of what it does.>+ Copyright (C) <year> <name of author>++ This program is free software: you can redistribute it and/or modify+ it under the terms of the GNU General Public License as published by+ the Free Software Foundation, either version 3 of the License, or+ (at your option) any later version.++ This program is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ GNU General Public License for more details.++ You should have received a copy of the GNU General Public License+ along with this program. If not, see <https://www.gnu.org/licenses/>.++Also add information on how to contact you by electronic and paper mail.++ If the program does terminal interaction, make it output a short+notice like this when it starts in an interactive mode:++ <program> Copyright (C) <year> <name of author>+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.+ This is free software, and you are welcome to redistribute it+ under certain conditions; type `show c' for details.++The hypothetical commands `show w' and `show c' should show the appropriate+parts of the General Public License. Of course, your program's commands+might be different; for a GUI interface, you would use an "about box".++ You should also get your employer (if you work as a programmer) or school,+if any, to sign a "copyright disclaimer" for the program, if necessary.+For more information on this, and how to apply and follow the GNU GPL, see+<https://www.gnu.org/licenses/>.++ The GNU General Public License does not permit incorporating your program+into proprietary programs. If your program is a subroutine library, you+may consider it more useful to permit linking proprietary applications with+the library. If this is what you want to do, use the GNU Lesser General+Public License instead of this License. But first, please read+<https://www.gnu.org/licenses/why-not-lgpl.html>.diff --git a/README.md b/README.mdnew file mode 100644index 00000000..09843912--- /dev/null+++ b/README.md@@ -0,0 +1,192 @@+# Doku: Open Source Observability for LLMs+[](https://github.com/dokulabs/doku)+[](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA)+[](https://github.com/dokulabs/doku/blob/main/LICENSE)+[](https://pepy.tech/project/dokumetry)+[](https://github.com/dokulabs/doku/pulse)+[](https://github.com/dokulabs/doku/graphs/contributors)++[](https://artifacthub.io/packages/search?repo=doku)+[](https://github.com/dokulabs/helm/tags)+[](https://pypi.org/project/dokumetry/)+[](https://www.npmjs.com/package/dokumetry)++++Doku is an open-source observability tool engineered for Large Language Models (LLMs). Designed for ease of integration into existing LLM applications, Doku offers unparalleled insights into usage, performance, and overhead—allowing you to analyze, optimize, and scale your AI applications and LLM usage effectively.++Whether you're working with OpenAI, Cohere, or Anthropic, It tracks all your LLM requests transparently and conveys the insights needed to make data-driven decisions. From monitoring usage and understanding latencies to managing costs and collaborating effortlessly, Doku grants you the lens to view your models in high definition.++#### How it works+++Leveraging Doku, you can get:++- 🕵️ **In-depth LLM Monitoring**: Track every request to LLM platforms like OpenAI with precision, ensuring comprehensive visibility over your model's interactions.+- 🎛️ **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.+- 📈 **Connect to Observability Platforms**: Export LLM Observablity data and insights from Doku to popular observability platforms such as Grafana Cloud or Datadog.+- 👥 **Team-centric Workflow**: Enhance team collaboration with seamless data sharing capabilities, creating an integrated environment for observability-driven teamwork.++## Supported LLMs:++- ✅ [OpenAI](https://openai.com/)+- ✅ [Cohere](https://cohere.com/)+- ✅ [Anthropic](https://www.anthropic.com/)++And this is only the beginning—as we grow, so will our list of supported LLM platforms. We're dedicated to continually refining our features to enhance your LLM and Generative AI observability experience.+++## 🚀 Getting Started with Doku++Jumpstart your journey with Doku by deploying it via our Helm chart, designed to simplify the installation process on any Kubernetes cluster.++### Deploying with Helm 📦++To install the Doku Helm chart, follow these steps:++1. Add the Doku Helm repository to your Helm setup:++```shell+helm repo add dokulabs https://dokulabs.github.io/helm/+```++2. Update your Helm repositories to fetch the latest chart information:++```shell+helm repo update+```++3. Install the Doku chart with the release name `doku`:++```shell+helm install doku dokulabs/doku+```++**NOTE**:+> As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [values.yaml](https://github.com/dokulabs/doku/tree/main/helm/doku/values.yaml) file in the Helm Chart. Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.++For a detailed list of configurable parameters for the Helm chart, refer to the `values.yaml` file in the [Helm chart](https://github.com/dokulabs/doku/tree/main/helm/doku).++### 🔑 Generating an API Key++Once Doku is up and running, proceed to generate your first API key:++1. Hit the `/api/keys` endpoint of the Doku service:++```shell+curl -X POST http://<Doku-URL>/api/keys \+-H 'Authorization: ""' \+-H 'Content-Type: application/json' \+-d '{"Name": "YourKeyName"}'+```++**Note**:+> - For your initial API call, `Authorization` header can be set to `""`.+> - Store the provided API key securely; it will be required to pass the generated and a valid API Ke in `Authorization` header for subsequent API calls.++### ⚡️ Automatically send LLM Observability Data to Doku++With the `dokumetry` SDKs for [Python](https://github.com/dokulabs/dokumetry-python) and [NodeJS](https://github.com/dokulabs/dokumetry-node), sending observability data to Doku is just **TWO** lines of code in your application. Once integrated, the SDKs take care of capturing and conveying LLM usage data directly to your Doku instance, requiring minimal effort on your part.++#### Python++Install the `dokumetry` [Python SDK](https://pypi.org/project/dokumetry/) using pip:++```shell+pip install dokumetry+```++Add the following two lines to your application code:++```python+import dokumetry++dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")+```++##### Example Usage for monitoring `OpenAI` Usage:++```python+from openai import OpenAI+import dokumetry++client = OpenAI(+ api_key="YOUR_OPENAI_KEY"+)++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++chat_completion = client.chat.completions.create(+ messages=[+ {+ "role": "user",+ "content": "What is LLM Observability",+ }+ ],+ model="gpt-3.5-turbo",+)+```++Refer to the `dokumetry` [Python SDK repository](https://github.com/dokulabs/dokumetry-python) for more advanced configurations and use cases.++#### Node++Install the `dokumetry` [NodeJS SDK](https://www.npmjs.com/package/dokumetry) using npm:++```shell+npm install dokumetry+```++Add the following two lines to your application code:++```javascript+import DokuMetry from 'dokumetry';++DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})+```++##### Example Usage for monitoring `OpenAI` Usage:++```javascript+import OpenAI from 'openai';+import DokuMetry from 'dokumetry';++const openai = new OpenAI({+ apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]+});++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const chatCompletion = await openai.chat.completions.create({+ messages: [{ role: 'user', content: 'What are the key to effective observability?' }],+ model: 'gpt-3.5-turbo',+ });+}++main();+```++Refer to the `dokumetry` [NodeJS SDK repository](https://github.com/dokulabs/dokumetry-node) for more advanced configurations and use cases.++## Security++Doku 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)++## Contributing++We welcome contributions to the Doku project. Please refer to [CONTRIBUTING](CONTRIBUTING) for detailed guidelines on how you can participate.++## License++Doku is available under the [GPL-3.0](LICENSE).++## Support++For support, issues, or feature requests, submit an issue through the [GitHub issues](https://github.com/dokulabs/doku/issues) associated with this repository.++## Visualize! Analyze! Optimize!++Join us on this voyage to reshape the future of AI insights. Share your thoughts, suggest features, and explore contributions. Engage with us on [GitHub](https://github.com/dokulabs/doku) and be part of Doku's community-led innovation.diff --git a/SECURITY.md b/SECURITY.mdnew file mode 100644index 00000000..52192299--- /dev/null+++ b/SECURITY.md@@ -0,0 +1,27 @@+# Security Policy++## Supported Versions++We are committed to maintaining the security of Doku and provide updates to address vulnerabilities. The following table shows which versions of our software currently receive security updates:++| Version | Supported | Notes |+|---------|--------------------|-------------------------------------------------------------|+| 0.0.x | :white_check_mark: | Active release with patches for all identified vulnerabilities. |++We encourage all users to run the latest version for the best security and stability.++## Reporting a Vulnerability++If you believe you have found a security vulnerability in Doku or any of its SDKs or components, we encourage you to report it to us through our GitHub repository. Follow these steps to submit a report:++1. **Open an Issue**: Navigate to the [Issues tab](https://github.com/dokulabs/doku/issues) in our GitHub repository and click on "New Issue".++2. **Describe in Detail**: Provide a thorough description of the vulnerability. This description should include steps to reproduce the issue and any potential impact.++3. **Label the Issue**: Attach the "Security Vulnerability" label to your issue. This helps us quickly identify and prioritize security-related concerns.++4. **Await Our Response**: The Doku maintainers will review your report and respond as quickly as possible. We ask that you keep any communications regarding the potential vulnerability confidential until we've been able to investigate and address the issue.++5. **Updates**: We will provide status updates on the issue thread. Once resolved, we will acknowledge the contribution in the issue and any applicable release notes.++We appreciate your help in keeping Doku secure. With your support and responsible disclosure, we can work together to create a safer software ecosystem for everyone.diff --git a/docs/.DS_Store b/docs/.DS_Storenew file mode 100644index 00000000..13c2248bBinary files /dev/null and b/docs/.DS_Store differdiff --git a/docs/0.0.3/api-reference/endpoint/api-keys/create.mdx b/docs/0.0.3/api-reference/endpoint/api-keys/create.mdxnew file mode 100644index 00000000..cce6cecf--- /dev/null+++ b/docs/0.0.3/api-reference/endpoint/api-keys/create.mdx@@ -0,0 +1,4 @@+---+title: 'Create API Key'+openapi: 'POST /api/keys'+---\ No newline at end of filediff --git a/docs/0.0.3/api-reference/endpoint/api-keys/delete.mdx b/docs/0.0.3/api-reference/endpoint/api-keys/delete.mdxnew file mode 100644index 00000000..fbb9e963--- /dev/null+++ b/docs/0.0.3/api-reference/endpoint/api-keys/delete.mdx@@ -0,0 +1,4 @@+---+title: 'Delete API Key'+openapi: 'DELETE /api/keys'+---\ No newline at end of filediff --git a/docs/0.0.3/api-reference/endpoint/api-keys/get.mdx b/docs/0.0.3/api-reference/endpoint/api-keys/get.mdxnew file mode 100644index 00000000..3ecec318--- /dev/null+++ b/docs/0.0.3/api-reference/endpoint/api-keys/get.mdx@@ -0,0 +1,4 @@+---+title: 'GET API Key'+openapi: 'GET /api/keys'+---\ No newline at end of filediff --git a/docs/0.0.3/api-reference/introduction.mdx b/docs/0.0.3/api-reference/introduction.mdxnew file mode 100644index 00000000..d23b01bd--- /dev/null+++ b/docs/0.0.3/api-reference/introduction.mdx@@ -0,0 +1,25 @@+---+title: 'Introduction'+description: 'OpenAPI specification for API Endpoints in Doku'+---++<Card+ title="API Keys Endpoints"+ icon="key"+ href="0.0.3/api-reference/endpoint/api-keys/create"+>+ View the documentation for API Keys+</Card>++## Authentication++All API endpoints are authenticated using Authetication Header.++```json+Authorization: <api-key>+```++<Info>+For your initial API call, Authorization header can be set to "".+Store the provided API key securely; it will be required to pass the generated and a valid API Key in Authorization header for subsequent API calls.+</Info>\ No newline at end of filediff --git a/docs/0.0.3/api-reference/openiapi.yml b/docs/0.0.3/api-reference/openiapi.ymlnew file mode 100644index 00000000..281f249a--- /dev/null+++ b/docs/0.0.3/api-reference/openiapi.yml@@ -0,0 +1,100 @@+openapi: 3.0.0+info:+ title: API Keys Service+ description: This service manages API keys through GET, POST, and DELETE operations.+ version: "1.0.0"++servers:+ - url: https://127.0.0.1:9044/++paths:+ /api/keys:+ get:+ summary: Get a list of API keys+ operationId: getApiKeys+ tags:+ - API Key+ security:+ - ApiKeyAuth: []+ requestBody:+ required: true+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/APIKeyRequest'+ responses:+ '200':+ description: A list of API keys+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/jsonResponse'++ post:+ summary: Create a new API key+ operationId: createApiKey+ tags:+ - API Key+ security:+ - ApiKeyAuth: []+ requestBody:+ required: true+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/APIKeyRequest'+ responses:+ '201':+ description: API key created+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/jsonResponse'++ delete:+ summary: Delete an API key+ operationId: deleteApiKey+ tags:+ - API Key+ security:+ - ApiKeyAuth: []+ requestBody:+ required: true+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/APIKeyRequest'+ responses:+ '200':+ description: API key deleted+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/jsonResponse'++components:+ schemas:+ APIKeyRequest:+ type: object+ required:+ - name+ properties:+ name:+ type: string++ jsonResponse:+ type: object+ required:+ - status+ - message+ properties:+ status:+ type: integer+ message:+ type: string++ securitySchemes:+ ApiKeyAuth:+ type: apiKey+ in: header+ name: Authorization\ No newline at end of filediff --git a/docs/0.0.3/configuration.mdx b/docs/0.0.3/configuration.mdxnew file mode 100644index 00000000..f5c4b4fa--- /dev/null+++ b/docs/0.0.3/configuration.mdx@@ -0,0 +1,151 @@+---+title: 'Configuration'+description: 'Configuring Options for Doku'+icon: 'sliders'+---++This document outlines the various options available for configuring Doku.+For ease of use and clarity, we recommend naming the configuration file `doku.yml`+++## Ingester Configuration++### `ingesterPort`++The `ingesterPort` specifies the network port that the Ingestion Server will listen to for incoming data. You can set this to any available port on your system.++Example:+```yaml+ingesterPort: 9044+```++## Pricing Information Source++Doku supports using either a local file or a URL to retrieve LLM Pricing data. Comment out the option you do not wish to use.+<Info>+We strongly recommend using the `url` method with the value set as `https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json`.++This ensures that you automatically retrieve the latest pricing information upon each startup, as the developers at Doku consistently refresh the pricing file with current data from OpenAI, Cohere and Anthropic.+</Info>+++### `localFile`++Uncomment `localFile` and specify the local file system path to a JSON file containing the LLM Pricing data.++Example:+```yaml+pricingInfo:+ localFile:+ path: "/assets/pricing.json"+```++### `url` (Recommended)++Alternatively, provide the URL where the pricing data JSON file can be downloaded. Ensure the given URL is accessible.++Example:+```yaml+pricingInfo:+ url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json"+```++## Database Configuration++### `dbConfig`++Configure the database connection details to connect Doku with TimescaleDB (or another Postgres compatible DB).++Replace `DBNAME`, `USERNAME`, `PASSWORD`, `HOSTURL`, `DBPORT`, and `SSLMODE` with appropriate values for your database.++- `name`: Database name.+- `username`: The username for the database.+- `password`: The password for the database.+- `host`: Host address for the database.+- `port`: Network port for the database connection.+- `sslMode`: The SSL mode for the database connection (e.g., "require" if SSL is needed).+- `maxOpenConns`: Maximum number of concurrent open database connections.+- `maxIdleConns`: Maximum number of idle database connections.+- `dataTable`: Name of the table to store LLM Data.+- `apiKeyTable`: Name of the table to store API Keys.++Example:+```yaml+dbConfig:+ name: "mydatabase"+ username: "myusername"+ password: "mypassword"+ host: "mydbhost.example.com"+ port: 5432+ sslMode: "require"+ maxOpenConns: 15+ maxIdleConns: 10+ dataTable: "llm_data"+ apiKeyTable: "api_keys"+```++## Observability Platform Configuration++Choose the external platform you wish to use for exporting observability data from Doku and set `enabled` to `true`. Fill in the required fields for the chosen platform. Only one platform can be selected at a time.++The following sections show example configurations for different platforms - Grafana Cloud, New Relic, and DataDog. You will need to uncomment the applicable section and provide necessary credentials such as URLs, User IDs, and API Keys corresponding to your account on the observability platform.++Example for Grafana Cloud:+```yaml+observabilityPlatform:+ enabled: true+ grafanaCloud:+ promUrl: "https://your-grafana-prometheus-url"+ promUsername: "your-prom-user-id"+ lokiUrl: "https://your-grafana-loki-url"+ lokiUsername: "your-loki-user-id"+ accessToken: "your-grafana-cloud-access-token"+```++Ensure that the file is correctly formatted in YAML and all necessary fields are populated based on your deployment needs. Save the file and restart the Doku service to apply the new configuration.++## Example Configuration File++```yaml doku.yml+ingesterPort: 9044 # Port to run the Ingestion Server on, Example: 9044++# Comment out either 'localFile' or 'url' to use only one at a time.+pricingInfo:+ # localFile:+ # path: "/assets/pricing.json" # Path to local JSON file with LLM Pricing data+ url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json" # URL to download Pricing data file++# Configuration for the Doku Backend Database (TimescaleDB)+dbConfig:+ name: "DBNAME" # Name of the database, Example: "postgres"+ username: "USERNAME" # Username to connect to the database, Example: "admin"+ password: "PASSWORD" # Password to connect to the database, Example: "DOKU"+ host: "HOSTURL" # Hostname of the database, Example: "174.21.1.2"+ port: DBPORT # Port of the database, Example: 5432+ sslMode: SSLMODE # SSL Mode of the database, Example: "require"+ maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15+ maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15+ dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"+ apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"++# Configure Platform to export LLM Observability Data from Doku+# Only one platform can be enabled at a time, To enable a platform, set enabled to true and fill in the required fields for that platform.+observabilityPlatform:+ enabled: false # Enable or Disable the Observability Platform, Example: true+ # grafanaCloud:+ # promUrl: "influx-line-proxy-url" # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance+ # promUsername: "prometheus-userid" # Prometheus User ID of the Grafana Cloud Prometheus Instance+ # lokiUrl: "loki-push-url" # URL to the Loki Push URL of the Grafana Cloud Loki Instance+ # lokiUsername: "loki-username" # Loki Username of the Grafana Cloud Loki Instance+ # accessToken: "grafana-cloud-access-token" # Access Token of the Grafana Cloud Instance++ # newRelic:+ # metricsUrl: "https://metric-api.newrelic.com/metric/v1" # URL to the New Relic Metric API+ # logsUrl: "https://log-api.newrelic.com/log/v1" # URL to the New Relic Log API+ # key: "newrelic-api-key" # Ingest API Key of the New Relic Account++ # datadog:+ # metricsUrl: "https://api.datadoghq.com/api/v1/series" # URL to the DataDog Metrics API+ # logsUrl: "https://http.logs.datadoghq.com/api/v2/logs" # URL to the DataDog Logs API+ # apiKey: "datadog-api-key" # API Key of the DataDog Account+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/introduction.mdx b/docs/0.0.3/dokumetry/introduction.mdxnew file mode 100644index 00000000..2412a83d--- /dev/null+++ b/docs/0.0.3/dokumetry/introduction.mdx@@ -0,0 +1,34 @@+---+title: 'Overview'+description: 'Seamlessly send LLM usage data to Doku'+---++[DokuMetry SDK](https://www.npmjs.com/package/dokumetry) (`dokumetry`) empowers you to effortlessly track and monitor language learning model (LLM) usage data and metrics from your Python/NodeJS code. It seamlessly integrates with major LLM Platforms:+++DokuMetry SDKs can currently track and monitor API usage for the below platforms+<CardGroup cols={3}>+<Card title="OpenAI">+</Card>+<Card title="Cohere">+</Card>+<Card title="Anthropic">+</Card>+</CardGroup>++All LLM observability data collected by DokuMetry is sent directly to the Doku Platform for streamlined tracking.++## Features++- **Effortless Setup:** Integrate full-featured LLM usage monitoring into your application with just two lines of code.+- **Efficient Performance:** Designed for near-zero latency impact, allowing your applications to run smoothly without compromise.+- **Secure and Reliable**: DokuMetry SDKs prioritize the safety and integrity of your data. All data transmission to Doku is conducted over secure HTTP, ensuring that your observability data is protected during transit.++## Supported Languages++<CardGroup cols={2}>+<Card title="Python" href="0.0.3/dokumetry/python/intro" icon="python">+</Card>+<Card title="NodeJS" href="0.0.3/dokumetry/node/introduction" icon="node-js">+</Card>+</CardGroup>diff --git a/docs/0.0.3/dokumetry/node/examples/anthropic/completions.mdx b/docs/0.0.3/dokumetry/node/examples/anthropic/completions.mdxnew file mode 100644index 00000000..946996fb--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/anthropic/completions.mdx@@ -0,0 +1,29 @@+---+title: 'Completions'+description: 'Monitor Anthropic Completions API Usage'+---++## Completions++```javascript+import Anthropic from '@anthropic-ai/sdk';+import DokuMetry from 'dokumetry';++const anthropic = new Anthropic({+ apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]+});++// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.+DokuMetry.init({llm: anthropic, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await anthropic.completions.create({+ model: 'claude-2',+ max_tokens_to_sample: 300,+ prompt: `${Anthropic.HUMAN_PROMPT} Hello, Claude{Anthropic.AI_PROMPT}`,+ });+ console.log(completion.completion);+}+main().catch(console.error);+```+diff --git a/docs/0.0.3/dokumetry/node/examples/cohere/chat.mdx b/docs/0.0.3/dokumetry/node/examples/cohere/chat.mdxnew file mode 100644index 00000000..c806e971--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/cohere/chat.mdx@@ -0,0 +1,57 @@+---+title: 'Chat'+description: 'Monitor Cohere Chat API usage'+---++## Chat+<CodeGroup>++```javascript No Streaming+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++const response = await cohere.chat({+ message: 'Say this is a test',+ model: 'command',+ });+print(response)+```++```javascript Streaming+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const chatStream = await cohere.chatStream({+ chatHistory: [+ { role: "USER", message: "Who discovered gravity?" },+ { role: "CHATBOT", message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" }+ ],+ message: "What year was he born?",+ // perform web search before answering the question. You can also use your own custom connector.+ connectors: [{ id: "web-search" }],+ });++ for await (const message of chatStream) {+ if (message.eventType === "text-generation") {+ console.log(message);+ }+ }+})();+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/node/examples/cohere/co-embed.mdx b/docs/0.0.3/dokumetry/node/examples/cohere/co-embed.mdxnew file mode 100644index 00000000..d6a3fc53--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/cohere/co-embed.mdx@@ -0,0 +1,27 @@+---+title: 'Embed'+description: 'Monitor Cohere Embed API usage'+---++## Embed++```javascript+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const embed = await cohere.embed({+ texts: ["hello", "goodbye"],+ model: "embed-english-v3.0",+ inputType: "classification",+ });+ console.log(embed);+})();+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/node/examples/cohere/generate.mdx b/docs/0.0.3/dokumetry/node/examples/cohere/generate.mdxnew file mode 100644index 00000000..b7a3035d--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/cohere/generate.mdx@@ -0,0 +1,26 @@+---+title: 'Generate'+description: 'Monitor Cohere Generate API usage'+---++## Generate++```javascript+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const generate = await cohere.generate({+ prompt: "Please explain to me how LLMs work",+ });++ console.log(generate);+})();+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/node/examples/cohere/summarize.mdx b/docs/0.0.3/dokumetry/node/examples/cohere/summarize.mdxnew file mode 100644index 00000000..20fef3a1--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/cohere/summarize.mdx@@ -0,0 +1,45 @@+---+title: 'Summarize'+description: 'Monitor Cohere Summarize API usage'+---++## Summarize++```javascript+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const summarize = await cohere.summarize({+ text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "+ + "It may be made from milk or cream and is flavoured with a sweetener, "+ + "either sugar or an alternative, and a spice, such as cocoa or vanilla, "+ + "or with fruit such as strawberries or peaches. "+ + "It can also be made by whisking a flavored cream base and liquid nitrogen together. "+ + "Food coloring is sometimes added, in addition to stabilizers. "+ + "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "+ + "and to prevent detectable ice crystals from forming. The result is a smooth, "+ + "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "+ + "It becomes more malleable as its temperature increases.\n\n"+ + "The meaning of the name \"ice cream\" varies from one country to another. "+ + "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "+ + "and most governments regulate the commercial use of the various terms according to the "+ + "relative quantities of the main ingredients, notably the amount of cream. "+ + "Products that do not meet the criteria to be called ice cream are sometimes labelled "+ + "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "+ + "one word is used fo\r all variants. Analogues made from dairy alternatives, "+ + "such as goat's or sheep's milk, or milk substitutes "+ + "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "+ + "lactose intolerant, allergic to dairy protein or vegan.",+ });++ console.log(summarize);+})();+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/node/examples/openai/audio.mdx b/docs/0.0.3/dokumetry/node/examples/openai/audio.mdxnew file mode 100644index 00000000..ee418a65--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/openai/audio.mdx@@ -0,0 +1,32 @@+---+title: 'Audio'+description: 'Monitor OpenAI Audio API usage'+---++## Create Speech++```javascript+import fs from "fs";+import path from "path";+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++const speechFile = path.resolve("./speech.mp3");++async function main() {+ const mp3 = await openai.audio.speech.create({+ model: "tts-1",+ voice: "alloy",+ input: "Today is a wonderful day to build something people love!",+ });+ console.log(speechFile);+ const buffer = Buffer.from(await mp3.arrayBuffer());+ await fs.promises.writeFile(speechFile, buffer);+}+main();+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/node/examples/openai/chat.mdx b/docs/0.0.3/dokumetry/node/examples/openai/chat.mdxnew file mode 100644index 00000000..4d72ed4d--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/openai/chat.mdx@@ -0,0 +1,157 @@+---+title: 'Chat'+description: 'Monitor OpenAI Chat Completions API usage'+---++## Chat Completions++<CodeGroup>++```javascript Default+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await openai.chat.completions.create({+ messages: [{ role: "system", content: "You are a helpful assistant." }],+ model: "gpt-3.5-turbo",+ });++ console.log(completion.choices[0]);+}++main();+```++```javascript Image Input+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const response = await openai.chat.completions.create({+ model: "gpt-4-vision-preview",+ messages: [+ {+ role: "user",+ content: [+ { type: "text", text: "What’s in this image?" },+ {+ type: "image_url",+ image_url:+ "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",+ },+ ],+ },+ ],+ });+ console.log(response.choices[0]);+}+main();+```++```javascript Streaming+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await openai.chat.completions.create({+ model: "gpt-3.5-turbo",+ messages: [+ {"role": "system", "content": "You are a helpful assistant."},+ {"role": "user", "content": "Hello!"}+ ],+ stream: true,+ });++ for await (const chunk of completion) {+ console.log(chunk.choices[0].delta.content);+ }+}++main();+```++```javascript Functions+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];+ const tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+ ];++ const response = await openai.chat.completions.create({+ model: "gpt-3.5-turbo",+ messages: messages,+ tools: tools,+ tool_choice: "auto",+ });++ console.log(response);+}++main();+```++```javascript LogProbs+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await openai.chat.completions.create({+ messages: [{ role: "user", content: "Hello!" }],+ model: "gpt-3.5-turbo",+ logprobs: true,+ top_logprobs: 2,+ });++ console.log(completion.choices[0]);+}++main();+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/node/examples/openai/completions.mdx b/docs/0.0.3/dokumetry/node/examples/openai/completions.mdxnew file mode 100644index 00000000..d535f7cc--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/openai/completions.mdx@@ -0,0 +1,53 @@+---+title: 'Completions'+description: 'Monitor OpenAI Completions API Usage'+---++## Completions+<CodeGroup>+```javascript No Streaming+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await openai.completions.create({+ model: "gpt-3.5-turbo-instruct",+ prompt: "Say this is a test.",+ max_tokens: 7,+ temperature: 0,+ });++ console.log(completion);+}+main();+```++```javascript Streaming+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const stream = await openai.completions.create({+ model: "gpt-3.5-turbo-instruct",+ prompt: "Say this is a test.",+ stream: true,+ });++ for await (const chunk of stream) {+ console.log(chunk.choices[0].text)+ }+}+main();+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/node/examples/openai/embeddings.mdx b/docs/0.0.3/dokumetry/node/examples/openai/embeddings.mdxnew file mode 100644index 00000000..fac7405a--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/openai/embeddings.mdx@@ -0,0 +1,28 @@+---+title: 'Embeddings'+description: 'Monitor OpenAI Embeddings API usage'+---++## Create Embeddings++```javascript+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const embedding = await openai.embeddings.create({+ model: "text-embedding-ada-002",+ input: "The quick brown fox jumped over the lazy dog",+ encoding_format: "float",+ });++ console.log(embedding);+}++main();+```diff --git a/docs/0.0.3/dokumetry/node/examples/openai/fine-tuning.mdx b/docs/0.0.3/dokumetry/node/examples/openai/fine-tuning.mdxnew file mode 100644index 00000000..06ed6f0e--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/openai/fine-tuning.mdx@@ -0,0 +1,26 @@+---+title: 'Fine Tuning'+description: 'Monitor OpenAI Fine Tuning API usage'+---++## Create Fine Tuning Job++```javascript+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const fineTune = await openai.fineTuning.jobs.create({+ training_file: "file-abc123"+ });++ console.log(fineTune);+}++main();+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/node/examples/openai/image.mdx b/docs/0.0.3/dokumetry/node/examples/openai/image.mdxnew file mode 100644index 00000000..7a80fd09--- /dev/null+++ b/docs/0.0.3/dokumetry/node/examples/openai/image.mdx@@ -0,0 +1,44 @@+---+title: 'Image'+description: 'Monitor OpenAI Image API usage'+---++## Create Image++```javascript+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" });++ console.log(image.data);+}+main();+```++## Create Image Variation+```javascript+import fs from "fs";+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const image = await openai.images.createVariation({+ image: fs.createReadStream("otter.png"),+ });++ console.log(image.data);+}+main();+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/node/introduction.mdx b/docs/0.0.3/dokumetry/node/introduction.mdxnew file mode 100644index 00000000..93ed263f--- /dev/null+++ b/docs/0.0.3/dokumetry/node/introduction.mdx@@ -0,0 +1,125 @@+---+title: 'Introduction'+description: 'Monitor your NodeJS LLM Application with DokuMetry'+---++DokuMetry Node SDK is the official library from Doku to send LLM usage data from your NodeJS application to Doku.++## Installation+``` shell shell+npm install dokumetry+```++## Usage++### OpenAI++```javascript openai.js+import OpenAI from 'openai';+import DokuMetry from 'dokumetry';++const openai = new OpenAI({+ apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]+});++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const chatCompletion = await openai.chat.completions.create({+ messages: [{ role: 'user', content: 'What are the key to effective observability?' }],+ model: 'gpt-3.5-turbo',+ });+}++main();+```++The following OpenAI Endpoints are supported for monitoring with DokuMetry++- [Chat completions](/0.0.3/dokumetry/node/examples/openai/chat)+- [Image Create](/0.0.3/dokumetry/node/examples/openai/image#create-image) and [Image Variations](/0.0.3/dokumetry/node/examples/openai/image#create-image-variation)+- [Audio Speech Create](/0.0.3/dokumetry/node/examples/openai/audio)+- [Embeddings](/0.0.3/dokumetry/node/examples/openai/embeddings)+- [Fine Tunings](/0.0.3/dokumetry/node/examples/openai/fine-tuning)+- [Completions](/0.0.3/dokumetry/node/examples/openai/completions)++### Cohere++```javascript cohere.js+import { CohereClient } from "cohere-ai";+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ apiKey: "YOUR_API_KEY",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const prediction = await cohere.generate({+ prompt: "hello",+ maxTokens: 10,+ });++ console.log("Received prediction", prediction);+})();+```++The following Cohere Endpoints are supported for monitoring with DokuMetry++- [Chat](/0.0.3/dokumetry/node/examples/cohere/chat)+- [Generate](/0.0.3/dokumetry/node/examples/cohere/generate)+- [Summarize](/0.0.3/dokumetry/node/examples/cohere/summarize)+- [Embed](/0.0.3/dokumetry/node/examples/cohere/co-embed)++### Anthropic++```javascript anthropic.js+import Anthropic from '@anthropic-ai/sdk';+import DokuMetry from 'dokumetry';++const anthropic = new Anthropic({+ apiKey: 'my api key', // defaults to process.env["ANTHROPIC_API_KEY"]+});++// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.+DokuMetry.init({llm: anthropic, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await anthropic.completions.create({+ model: 'claude-2',+ max_tokens_to_sample: 300,+ prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court?${Anthropic.AI_PROMPT}`,+ });+}++main();+```++The following Anthropic Endpoints are supported for monitoring with DokuMetry++- [Completions](/0.0.3/dokumetry/node/examples/anthropic/completions)++## Parameters++| Parameter | Description | Required |+|-------------------|-----------------------------------------------------------|---------------|+| llm | Language Learning Model (LLM) Object to track | Yes |+| dokuURL | URL of your Doku Instance | Yes |+| apiKey | Your Doku API key | Yes |+| environment | Custom environment tag to include in your metrics | Optional |+| applicationName | Custom application name tag for your metrics | Optional |+| skipResp | Skip response from the Doku Ingester for faster execution | Optional |++## Advanced Usage+When using DokuMetry in Production environments, It is recommened to set `skipResp: True` for faster porcessing.++To filter your LLM Usage according application or the environment, set the `application` and `environment` parameters with the actual values.+++## Requirements+NodeJS >= 18.0 is supported.++If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/examples/anthropic/completions.mdx b/docs/0.0.3/dokumetry/python/examples/anthropic/completions.mdxnew file mode 100644index 00000000..b2ea104b--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/anthropic/completions.mdx@@ -0,0 +1,27 @@+---+title: 'Completions'+description: 'Monitor Anthropic Completions API Usage'+---++## Completions++```javascript+from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT+import dokumetry++anthropic = Anthropic(+ # defaults to os.environ.get("ANTHROPIC_API_KEY")+ api_key="my_api_key",+)++# Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.+dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = anthropic.completions.create(+ model="claude-2",+ max_tokens_to_sample=300,+ prompt=f"{HUMAN_PROMPT} Hello, Claude{AI_PROMPT}",+)+print(completion.completion)+```+diff --git a/docs/0.0.3/dokumetry/python/examples/cohere/chat.mdx b/docs/0.0.3/dokumetry/python/examples/cohere/chat.mdxnew file mode 100644index 00000000..d8f8fb92--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/cohere/chat.mdx@@ -0,0 +1,52 @@+---+title: 'Chat'+description: 'Monitor Cohere Chat API usage'+---++## Chat+<CodeGroup>++```python No Streaming+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = co.chat(+ chat_history=[+ {"role": "USER", "message": "Who discovered gravity?"},+ {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}+ ],+ message="What year was he born?",+ # perform web search before answering the question. You can also use your own custom connector.+ connectors=[{"id": "web-search"}]+)+print(response)+```++```python Streaming+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = co.chat(+ chat_history=[+ {"role": "USER", "message": "Who discovered gravity?"},+ {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}+ ],+ message="What year was he born?",+ stream=True,+ # perform web search before answering the question. You can also use your own custom connector.+ connectors=[{"id": "web-search"}]+)+print(response)+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/examples/cohere/embed.mdx b/docs/0.0.3/dokumetry/python/examples/cohere/embed.mdxnew file mode 100644index 00000000..05900ae2--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/cohere/embed.mdx@@ -0,0 +1,23 @@+---+title: 'Embed'+description: 'Monitor Cohere Embed API usage'+---++## Embed++```python+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = co.embed(+ texts=['hello', 'goodbye'],+ model='embed-english-v3.0',+ input_type='classification'+)+print(response)+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/examples/cohere/generate.mdx b/docs/0.0.3/dokumetry/python/examples/cohere/generate.mdxnew file mode 100644index 00000000..b137a0c9--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/cohere/generate.mdx@@ -0,0 +1,21 @@+---+title: 'Generate'+description: 'Monitor Cohere Generate API usage'+---++## Generate++```python+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = co.generate(+ prompt='Please explain to me how LLMs work',+)+print(response)+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/examples/cohere/summarize.mdx b/docs/0.0.3/dokumetry/python/examples/cohere/summarize.mdxnew file mode 100644index 00000000..c9bfcc05--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/cohere/summarize.mdx@@ -0,0 +1,44 @@+---+title: 'Summarize'+description: 'Monitor Cohere Summarize API usage'+---++## Summarize++```python+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++text=(+ "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "+ "It may be made from milk or cream and is flavoured with a sweetener, "+ "either sugar or an alternative, and a spice, such as cocoa or vanilla, "+ "or with fruit such as strawberries or peaches. "+ "It can also be made by whisking a flavored cream base and liquid nitrogen together. "+ "Food coloring is sometimes added, in addition to stabilizers. "+ "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "+ "and to prevent detectable ice crystals from forming. The result is a smooth, "+ "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "+ "It becomes more malleable as its temperature increases.\n\n"+ "The meaning of the name \"ice cream\" varies from one country to another. "+ "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "+ "and most governments regulate the commercial use of the various terms according to the "+ "relative quantities of the main ingredients, notably the amount of cream. "+ "Products that do not meet the criteria to be called ice cream are sometimes labelled "+ "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "+ "one word is used fo\r all variants. Analogues made from dairy alternatives, "+ "such as goat's or sheep's milk, or milk substitutes "+ "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "+ "lactose intolerant, allergic to dairy protein or vegan."+)++response = co.summarize(+ text=text,+)+print(response)+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/examples/openai/audio.mdx b/docs/0.0.3/dokumetry/python/examples/openai/audio.mdxnew file mode 100644index 00000000..c927bb36--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/openai/audio.mdx@@ -0,0 +1,25 @@+---+title: 'Audio'+description: 'Monitor OpenAI Audio API usage'+---++## Create Speech++```python+from pathlib import Path+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++speech_file_path = Path(__file__).parent / "speech.mp3"+response = client.audio.speech.create(+ model="tts-1",+ voice="alloy",+ input="The quick brown fox jumped over the lazy dog."+)+response.stream_to_file(speech_file_path)+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/examples/openai/chat.mdx b/docs/0.0.3/dokumetry/python/examples/openai/chat.mdxnew file mode 100644index 00000000..5c97d068--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/openai/chat.mdx@@ -0,0 +1,143 @@+---+title: 'Chat'+description: 'Monitor OpenAI Chat Completions API usage'+---++## Chat Completions++<CodeGroup>++```python Default+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = client.chat.completions.create(+ model="gpt-3.5-turbo",+ messages=[+ {"role": "system", "content": "You are a helpful assistant."},+ {"role": "user", "content": "Hello!"}+ ]+)++print(completion.choices[0].message)+```++```python Image Input+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = client.chat.completions.create(+ model="gpt-4-vision-preview",+ messages=[+ {+ "role": "user",+ "content": [+ {"type": "text", "text": "What’s in this image?"},+ {+ "type": "image_url",+ "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",+ },+ ],+ }+ ],+ max_tokens=300,+)++print(response.choices[0])+```++```python Streaming+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = client.chat.completions.create(+ model="gpt-3.5-turbo",+ messages=[+ {"role": "system", "content": "You are a helpful assistant."},+ {"role": "user", "content": "Hello!"}+ ],+ stream=True+)++for chunk in completion:+ print(chunk.choices[0].delta)+```++```python Functions+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+]+messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]+completion = client.chat.completions.create(+ model="gpt-3.5-turbo",+ messages=messages,+ tools=tools,+ tool_choice="auto"+)++print(completion)+```++```python LogProbs+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = client.chat.completions.create(+ model="gpt-3.5-turbo",+ messages=[+ {"role": "user", "content": "Hello!"}+ ],+ logprobs=True,+ top_logprobs=2+)++print(completion.choices[0].message)+print(completion.choices[0].logprobs)+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/examples/openai/chatCompletions.mdx b/docs/0.0.3/dokumetry/python/examples/openai/chatCompletions.mdxnew file mode 100644index 00000000..ab3beb87--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/openai/chatCompletions.mdx@@ -0,0 +1,45 @@+---+title: 'Completions'+description: 'Monitor OpenAI Completions API Usage'+---++## Completions+<CodeGroup>+```python No Streaming+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++client.completions.create(+ model="gpt-3.5-turbo-instruct",+ prompt="Say this is a test",+ max_tokens=7,+ temperature=0+)+```++```python Streaming+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++for chunk in client.completions.create(+ model="gpt-3.5-turbo-instruct",+ prompt="Say this is a test",+ max_tokens=7,+ temperature=0,+ stream=True+):++print(chunk.choices[0].text)+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/examples/openai/embeddings.mdx b/docs/0.0.3/dokumetry/python/examples/openai/embeddings.mdxnew file mode 100644index 00000000..6c22743a--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/openai/embeddings.mdx@@ -0,0 +1,22 @@+---+title: 'Embeddings'+description: 'Monitor OpenAI Embeddings API usage'+---++## Create Embeddings++```python+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++client.embeddings.create(+ model="text-embedding-ada-002",+ input="The food was delicious and the waiter...",+ encoding_format="float"+)+```diff --git a/docs/0.0.3/dokumetry/python/examples/openai/fine-tuning.mdx b/docs/0.0.3/dokumetry/python/examples/openai/fine-tuning.mdxnew file mode 100644index 00000000..4de9f9c7--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/openai/fine-tuning.mdx@@ -0,0 +1,21 @@+---+title: 'Fine Tuning'+description: 'Monitor OpenAI Fine Tuning API usage'+---++## Create Fine Tuning Job++```python+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++client.fine_tuning.jobs.create(+ training_file="file-abc123",+ model="gpt-3.5-turbo"+)+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/examples/openai/image.mdx b/docs/0.0.3/dokumetry/python/examples/openai/image.mdxnew file mode 100644index 00000000..87df73ea--- /dev/null+++ b/docs/0.0.3/dokumetry/python/examples/openai/image.mdx@@ -0,0 +1,40 @@+---+title: 'Image'+description: 'Monitor OpenAI Image API usage'+---++## Create Image++```python+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++client.images.generate(+ model="dall-e-3",+ prompt="A cute baby sea otter",+ n=1,+ size="1024x1024"+)+```++## Create Image Variation+```python+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = client.images.create_variation(+ image=open("image_edit_original.png", "rb"),+ n=2,+ size="1024x1024"+)+```\ No newline at end of filediff --git a/docs/0.0.3/dokumetry/python/intro.mdx b/docs/0.0.3/dokumetry/python/intro.mdxnew file mode 100644index 00000000..79229926--- /dev/null+++ b/docs/0.0.3/dokumetry/python/intro.mdx@@ -0,0 +1,119 @@+---+title: 'Introduction'+description: 'Monitor your Python LLM Application with DokuMetry'+---++DokuMetry Python SDK is the official library from Doku to send LLM usage data from your Python application to Doku.++## Installation+``` shell shell+pip install dokumetry+```++## Usage++### OpenAI++``` python openai.py+from openai import OpenAI+import dokumetry++client = OpenAI(+ api_key="YOUR_OPENAI_KEY"+)++# Pass the above `client` object along with your Doku URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++chat_completion = client.chat.completions.create(+ messages=[+ {+ "role": "user",+ "content": "What is LLM Observability",+ }+ ],+ model="gpt-3.5-turbo",+)+```++The following OpenAI Endpoints are supported for monitoring with DokuMetry++- [Chat completions](/0.0.3/dokumetry/python/examples/openai/chat)+- [Image Create](/0.0.3/dokumetry/python/examples/openai/image#create-image) and [Image Variations](/0.0.3/dokumetry/python/examples/openai/image#create-image-variation)+- [Audio Speech Create](/0.0.3/dokumetry/python/examples/openai/audio)+- [Embeddings](/0.0.3/dokumetry/python/examples/openai/embeddings)+- [Fine Tunings](/0.0.3/dokumetry/python/examples/openai/fine-tuning)+- [Completions](/0.0.3/dokumetry/python/examples/openai/chatCompletions)++### Cohere++```python cohere.py+import cohere+import dokumetry++# initialize the Cohere Client with an API Key+co = cohere.Client('YOUR_API_KEY')++# Pass the above `co` object along with your Doku URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++# generate a prediction for a prompt+prediction = co.chat(message='What is LLM Observability?', model='command')++# print the predicted text+print(f'Chatbot: {prediction.text}')+```++The following Cohere Endpoints are supported for monitoring with DokuMetry++- [Chat](/0.0.3/dokumetry/python/examples/cohere/chat)+- [Generate](/0.0.3/dokumetry/python/examples/cohere/generate)+- [Summarize](/0.0.3/dokumetry/python/examples/cohere/summarize)+- [Embed](/0.0.3/dokumetry/python/examples/cohere/embed)++### Anthropic++```python anthropic.py+from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT+import dokumetry++anthropic = Anthropic(+ # defaults to os.environ.get("ANTHROPIC_API_KEY")+ api_key="my api key",+)++# Pass the above `anthropic` object along with your Doku URL and API key and this will make sure that all Anthropic calls are automatically tracked.+dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = anthropic.completions.create(+ model="claude-2",+ max_tokens_to_sample=300,+ prompt=f"{HUMAN_PROMPT} What is LLM Observability?{AI_PROMPT}",+)+print(completion.completion)+```++The following Anthropic Endpoints are supported for monitoring with DokuMetry++- [Completions](/0.0.3/dokumetry/python/examples/anthropic/completions)++## Parameters++| Parameter | Description | Required |+|-------------------|-----------------------------------------------------------|---------------|+| llm | Language Learning Model (LLM) Object to track | Yes |+| doku_url | URL of your Doku Instance | Yes |+| api_key | Your Doku API key | Yes |+| environment | Custom environment tag to include in your metrics | Optional |+| application_name | Custom application name tag for your metrics | Optional |+| skip_resp | Skip response from the Doku Ingester for faster execution | Optional |++## Advanced Usage+When using DokuMetry in Production environments, It is recommened to set `skip_resp = true` for faster porcessing.++To filter your LLM Usage according application or the environment, set the `application` and `environment` paramaters with the actual values.++## Requirements+Python >= 3.7 is supported.++If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).\ No newline at end of filediff --git a/docs/0.0.3/installation.mdx b/docs/0.0.3/installation.mdxnew file mode 100644index 00000000..4ad50f6a--- /dev/null+++ b/docs/0.0.3/installation.mdx@@ -0,0 +1,272 @@+---+title: 'Installing Doku'+description: 'Deploy Doku in your preferred environment'+icon: 'circle-down'+---++Doku flexibly adapts to your preferred environment. Select a deployment method that best fits your setup:++<CardGroup cols={2}>+ <Card+ title="Kubernetes"+ icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <title>Kubernetes</title>+ <path fill="#FFA500" d="M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"/></svg>}+ href="/0.0.3/installation#kubernetes"+ >+ Deploy Doku in a Kubernetes Cluster using Helm+ </Card>+ <Card+ title="Docker"+ icon="docker"+ href="/0.0.3/installation#docker"+ >+ Deploy Doku using docker compose+ </Card>+ <Card+ title="Linux"+ icon="linux"+ href="/0.0.3/installation#linux"+ >+ Deploy Doku in a Linux Host+ </Card>+ <Card+ title="Windows"+ icon="windows"+ href="/0.0.3/installation#windows"+ >+ Deploy Doku in a Windows Host+ </Card>+</CardGroup>++## Kubernetes++Deploy Doku on your Kubernetes cluster using the [Doku Helm chart](https://github.com/dokulabs/helm/tree/main/charts/doku) for a reliable and scalable solution.+<Steps>+ <Step title="Helm Repo Setup">+ ```shell shell+ helm repo add dokulabs https://dokulabs.github.io/helm/+ helm repo update+ ```+ </Step>+ <Step title="Installing the Helm Chart">+ ```shell shell+ helm install doku dokulabs/doku+ ```+ </Step>+</Steps>+<Info>As Doku does not have a built-in visualization UI yet, it is preferred that you set up the observabilityPlatform configuration within the [values.yaml](https://github.com/dokulabs/helm/blob/main/charts/doku/values.yaml) file. Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.</Info>++## Docker+Quickly spin up Doku using Docker for a fast and straightforward setup.++<Steps>+ <Step title="Install TimescaleDB">+ <Steps>+ <Step title="Pull TimescaleDB Image">+ ```shell+ docker pull timescale/timescaledb-ha:pg14-latest+ ```+ </Step>+ <Step title="Run TimescaleDB Image">+ ```shell+ docker run -d --name timescaledb -p 127.0.0.1:5432:5432 \+ -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg14-latest+ ```+ </Step>+ </Steps>+ </Step>+ <Step title="Install Doku">+ <Steps>+ <Step title="Pull Doku Image">+ ```shell+ docker pull ghcr.io/dokulabs/ingester:0.0.3+ ```+ </Step>+ <Step title="Create a Doku Configuration file">+ Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:++ ```yaml doku.yml+ ingesterPort: 9044++ pricingInfo:+ url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file++ # Configuration for the Doku Backend Database (TimescaleDB)+ dbConfig:+ name: DBNAME # Name of the database, Example: "postgres"+ username: USERNAME # Username to connect to the database, Example: "admin"+ password: PASSWORD # Password to connect to the database, Example: "DOKU"+ host: HOSTURL # Hostname of the database, Example: "174.21.1.2"+ port: DBPORT # Port of the database, Example: 5432+ sslMode: SSLMODE # SSL Mode of the database, Example: "require"+ maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15+ maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15+ dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"+ apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"++ observabilityPlatform:+ enabled: false+ ```+ Be sure to replace the placeholder values with your actual database details and desired settings.+ <Info>+ As Doku does not have a built-in visualization UI yet, it is preferred that you set up the observabilityPlatform configuration within the [Doku Configuration file (`doku.yml`)](/0.0.3/configuration#observability-platform-configuration) file.++ Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.+ </Info>+ </Step>+ <Step title="Run the Doku Image">+ ```shell+ docker run -d --name doku -p 127.0.0.1:9044:9044 -v /doku.yml:/doku.yml dokulabs/ingester:0.0.3 --config /doku.yml+ ```+ </Step>+ </Steps>+ </Step>+</Steps>++## Linux+<Steps>+ <Step title="Install TimescaleDB">+ Follow the Instructions [here](https://docs.timescale.com/self-hosted/latest/install/installation-linux/#installing-self-hosted-timescaledb-on-debian-based-systems) to install TimescaleDB in your Linux host.+ </Step>+ <Step title="Create a Doku Configuration file">+ Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:++ ```yaml doku.yml+ ingesterPort: 9044++ pricingInfo:+ url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file++ # Configuration for the Doku Backend Database (TimescaleDB)+ dbConfig:+ name: DBNAME # Name of the database, Example: "postgres"+ username: USERNAME # Username to connect to the database, Example: "admin"+ password: PASSWORD # Password to connect to the database, Example: "DOKU"+ host: HOSTURL # Hostname of the database, Example: "174.21.1.2"+ port: DBPORT # Port of the database, Example: 5432+ sslMode: SSLMODE # SSL Mode of the database, Example: "require"+ maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15+ maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15+ dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"+ apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"++ observabilityPlatform:+ enabled: false+ ```+ Be sure to replace the placeholder values with your actual database details and desired settings.+ <Info>+ As Doku does not have a built-in visualization UI yet, it is preferred that you set up the observabilityPlatform configuration within the [Doku Configuration file (`doku.yml`)](/0.0.3/configuration#observability-platform-configuration) file.++ Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.+ </Info>+ </Step>+ <Step title="Install Doku in a linux Host">+ <Tabs>+ <Tab title="Linux">+ <CodeGroup>+ ```shell amd64+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.3/ingester-linux-amd64+ chmod +x ingester-linux-amd64+ ./ingester-linux-amd64 --config doku.yml+ ```++ ```shell arm64+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.3/ingester-linux-arm64+ chmod +x ingester-linux-arm64+ ./ingester-linux-arm64 --config doku.yml+ ```++ ```shell arm+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.3/ingester-linux-arm+ chmod +x ingester-linux-arm+ ./ingester-linux-arm --config doku.yml+ ```++ ```shell ppc64le+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.3/ingester-linux-ppc64le+ chmod +x ingester-linux-ppc64le+ ./ingester-linux-ppc64le --config doku.yml+ ```+ </CodeGroup>+ </Tab>+ <Tab title="Darwin">+ <CodeGroup>+ ```shell amd64+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.3/ingester-darwin-amd64+ chmod +x ingester-darwin-amd64+ ./ingester-darwin-amd64 --config doku.yml+ ```++ ```shell arm64+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.3/ingester-darwin-arm64+ chmod +x ingester-darwin-arm64+ ./ingester-darwin-arm64 --config doku.yml+ ```+ </CodeGroup>+ </Tab>+ </Tabs>+ </Step>+</Steps>++## Windows+<Steps>+ <Step title="Install TimescaleDB">+ <Steps>+ Download and install the Visual C++ Redistributable for Visual Studio from [www.microsoft.com](https://www.microsoft.com/en-us/download/details.aspx?id=48145).++ Download and install PostgreSQL from [www.postgresql.org](https://www.postgresql.org/download/windows/). You might need to add the `pg_config` file location to your path. In the Windows Search tool, search for `system environment variables`. The path should be `C:\Program Files\PostgreSQL\<version>\bin`.++ Download the TimescaleDB installation `.zip` file from [Windows releases](https://docs.timescale.com/self-hosted/latest/install/installation-windows/#windows-releases).++ Locate the downloaded file on your local file system, and extract the files.++ In the extracted TimescaleDB directory, right-click the `setup.exe` file and select `Run as Administrator` to start the installer.+ </Steps>+ </Step>+ <Step title="Create a Doku Configuration file">+ Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:++ ```yaml doku.yml+ ingesterPort: 9044++ pricingInfo:+ url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file++ # Configuration for the Doku Backend Database (TimescaleDB)+ dbConfig:+ name: DBNAME # Name of the database, Example: "postgres"+ username: USERNAME # Username to connect to the database, Example: "admin"+ password: PASSWORD # Password to connect to the database, Example: "DOKU"+ host: HOSTURL # Hostname of the database, Example: "174.21.1.2"+ port: DBPORT # Port of the database, Example: 5432+ sslMode: SSLMODE # SSL Mode of the database, Example: "require"+ maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15+ maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15+ dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"+ apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"++ observabilityPlatform:+ enabled: false+ ```+ Be sure to replace the placeholder values with your actual database details and desired settings.+ <Info>+ As Doku does not have a built-in visualization UI yet, it is preferred that you set up the observabilityPlatform configuration within the [Doku Configuration file (`doku.yml`)](/0.0.3/configuration#observability-platform-configuration) file.++ Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.+ </Info>+ </Step>+ <Step title="Install Doku in a Windows Host">+ <CodeGroup>+ ```shell amd64+ invoke-WebRequest -Uri "https://github.com/dokulabs/ingester/releases/download/0.0.3/ingester-windows-amd64" -OutFile "ingester.exe"+ .\ingester.exe --config doku.yml+ ```++ ```shell 386+ invoke-WebRequest -Uri "https://github.com/dokulabs/ingester/releases/download/0.0.3/ingester-windows-386" -OutFile "ingester.exe"+ .\ingester.exe --config doku.yml+ ```+ </CodeGroup>+ </Step>+</Steps>\ No newline at end of filediff --git a/docs/0.0.3/integrations/datadog.mdx b/docs/0.0.3/integrations/datadog.mdxnew file mode 100644index 00000000..92dffa4f--- /dev/null+++ b/docs/0.0.3/integrations/datadog.mdx@@ -0,0 +1,17 @@+---+title: 'DataDog'+description: 'Connect Doku to DataDog'+---++Doku can automatically send LLM usage data from Doku to DataDog using the [Submit Metrics API](https://docs.datadoghq.com/api/latest/metrics/#submit-metrics) and [Send Logs API](https://docs.datadoghq.com/api/latest/logs/#send-logs)++Add the following to your doku configuration file(`doku.yml`).++```yaml doku.yml+observabilityPlatform:+ enabled: true # Enable or Disable the Observability Platform, Example: true+ datadog:+ metricsUrl: <your-datadog-metrics-url> # URL to the DataDog Metrics API+ logsUrl: <your-datadog-logs-url> # URL to the DataDog Logs API+ apiKey: <your-datadog-api-key> # API Key of the DataDog Account+```\ No newline at end of filediff --git a/docs/0.0.3/integrations/grafanacloud.mdx b/docs/0.0.3/integrations/grafanacloud.mdxnew file mode 100644index 00000000..4d76f39c--- /dev/null+++ b/docs/0.0.3/integrations/grafanacloud.mdx@@ -0,0 +1,19 @@+---+title: 'Grafana Cloud'+description: 'Connect Doku to Grafana Cloud'+---++Doku can automatically send LLM usage data from Doku to Grafana Cloud using the [Grafana Cloud Influx Telegraf](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-influxdb/push-from-telegraf/) and [Loki Push HTTP API](https://grafana.com/docs/loki/latest/reference/api/#push-log-entries-to-loki)++Add the following to your doku configuration file(`doku.yml`).++```yaml doku.yml+observabilityPlatform:+ enabled: true # Enable or Disable the Observability Platform, Example: true+ grafanaCloud:+ promUrl: <your-grafana-cloud-influx-line-proxy-url> # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance+ promUsername: <your-prometheus-userid> # Prometheus User ID of the Grafana Cloud Prometheus Instance+ lokiUrl: <your-loki-push-url> # URL to the Loki Push URL of the Grafana Cloud Loki Instance+ lokiUsername: <your-loki-username> # Loki Username of the Grafana Cloud Loki Instance+ accessToken: <your-grafana-cloud-access-token> # Access Token of the Grafana Cloud Instance+```\ No newline at end of filediff --git a/docs/0.0.3/integrations/introduction.mdx b/docs/0.0.3/integrations/introduction.mdxnew file mode 100644index 00000000..6fff44e9--- /dev/null+++ b/docs/0.0.3/integrations/introduction.mdx@@ -0,0 +1,19 @@+---+title: 'Introduction'+description: 'Connect to your existing Observablity Platform'+---++Doku streamlines the observability experience by delivering processed LLM data right to the observability platform you are already familiar with. We recognize how crucial it is for developers to aggregate all application-related data, encompassing LLM usage metrics, into a single source of truth.++This integration allows you to visualize and assess your entire application landscape in one integrated Observability platform, thereby refining your monitoring approaches and sharpening your decision-making.++Below is a list of observability platforms that work seamlessly with Doku, allowing for integrated and expanded insights.++<CardGroup cols={3}>+ <Card title="Grafana Cloud" href="/0.0.3/integrations/grafanacloud" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>+ </Card>+ <Card title="DataDog" href="/0.0.3/integrations/datadog" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Datadog</title><path d="M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"/></svg>}>+ </Card>+ <Card title="New Relic" href="/0.0.3/integrations/new-relic" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>New Relic</title><path d="M8.0015 14.3091v7.384L12.0008 24V12.0008L1.6078 5.9996v4.6167ZM12.0008 0 2.8232 5.2976 6.8209 7.606l5.1799-2.9893 6.3936 3.6913v7.384l-5.1783 2.9908v4.6167l9.176-5.2991V5.9996Z"/></svg>}>+ </Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.0.3/integrations/new-relic.mdx b/docs/0.0.3/integrations/new-relic.mdxnew file mode 100644index 00000000..391c8b9c--- /dev/null+++ b/docs/0.0.3/integrations/new-relic.mdx@@ -0,0 +1,17 @@+---+title: 'New Relic'+description: 'Connect Doku to New Relic'+---++Doku can automatically send LLM usage data from Doku to New Relic using the [Report Metrics HTTP API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/report-metrics-metric-api/) and [Send Logs API](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api/)++Add the following to your doku configuration file(`doku.yml`).++```yaml doku.yml+observabilityPlatform:+ enabled: true # Enable or Disable the Observability Platform, Example: true+ newRelic:+ metricsUrl: <your-new-relic-metrics-url> # URL to the New Relic Metric API+ logsUrl: <your-new-relic-logs-url> # URL to the New Relic Log API+ key: <your-new-relic-api-key> # Ingest API Key of the New Relic Account+```\ No newline at end of filediff --git a/docs/0.0.3/introduction.mdx b/docs/0.0.3/introduction.mdxnew file mode 100644index 00000000..2f55cb78--- /dev/null+++ b/docs/0.0.3/introduction.mdx@@ -0,0 +1,71 @@+---+title: What is Doku?+description: 'Monitor and evalute your LLM Applications'+---++Doku is an open-source observability tool engineered for Large Language Models (LLMs). Designed for ease of integration into existing LLM applications, Doku offers unparalleled insights into usage, performance, and overhead—allowing you to analyze, optimize, and scale your AI applications and LLM usage effectively.++Whether you're working with OpenAI, Cohere, or Anthropic, It tracks all your LLM requests transparently and conveys the insights needed to make data-driven decisions. From monitoring usage and understanding latencies to managing costs and collaborating effortlessly, Doku grants you the lens to view your models in high definition.++## How it works++<Frame>+ <img src="https://raw.githubusercontent.com/dokulabs/.github/main/profile/assets/banner.gif" />+</Frame>+### Application Integration with Two Lines of Code+Start by incorporating the DokuMetry SDK into your application. With SDKs tailored for both Python and NodeJS, Doku fits into your tech stack with minimal changes. Just a **two lines** of code is all it takes to begin:++For Python and NodeJS projects, just import the DokuMetry SDK and initialize it as follows:+ <CodeGroup>+ ```python python+ import dokumetry+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")+ ```++ ```javascript NodeJS+ import DokuMetry from 'dokumetry';+ DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})+ ```+ </CodeGroup>+Find detailed instructions at the [DokuMetry SDK Documentation](0.0.3/dokumetry/introduction).++### The Doku Ingester: Your Data Processing Workhorse++Upon SDK setup, data from your LLM operations is automatically collected. The DokuMetry SDKs transmit this usage data over HTTP in the background to the [Doku Ingester](https://github.com/dokulabs/ingester/).++The ingester is the core engine where the magic happens:+- **Data Collection**: Effortlessly captures live data from your LLM interactions without complicating your existing codebase.+- **Cost Analysis**: Enriches your data with cost considerations, providing a financial perspective to your analytics.+- **Secure Storage**: All processed information is securely stored in TimescaleDB, providing you with a scalable, time-series database that can handle large volumes of observability data.++You have the choice to set up a fresh TimescaleDB instance or connect Doku to your existing one. Whichever path you choose, your data resides within your control, reinforcing your data security and operational compliance.++## Features+Leveraging Doku, you can get:++- **In-depth LLM Monitoring**: Track every request to LLM platforms like OpenAI with precision, ensuring comprehensive visibility over your model's interactions.+- **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.+- **Connect to Observability Platforms**: Export LLM Observablity data and insights from Doku to popular observability platforms such as Grafana Cloud or Datadog.+- **Team-centric Workflow**: Enhance team collaboration with seamless data sharing capabilities, creating an integrated environment for observability-driven teamwork.++## Supported LLM Platforms+<CardGroup cols={3}>+<Card title="OpenAI">+</Card>+<Card title="Cohere">+</Card>+<Card title="Anthropic">+</Card>+</CardGroup>++## Getting Started+Select from the following guides to learn more about how to use Doku:++<CardGroup cols={2}>+<Card title="Quickstart" href="/0.0.3/quickstart" icon='bolt'>+Get Started with monitoring your LLM Applications in 3 simple steps+</Card>+<Card title="Integrations" href="/0.0.3/integrations/introduction" icon='connectdevelop'>+Connect to your existing Observablity Platform+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.0.3/quickstart.mdx b/docs/0.0.3/quickstart.mdxnew file mode 100644index 00000000..a6f593ca--- /dev/null+++ b/docs/0.0.3/quickstart.mdx@@ -0,0 +1,150 @@+---+title: 'Quickstart'+description: 'Quickly start **monitoring** your **LLM Applications** in just **two lines** of code'+icon: 'bolt'+---++This guide will walk you through setting up your monitoring system with minimal effort. In just a few steps, you'll be able to track and analyze the performance and usage of your Large Language Model (LLM) applications.++## Prerequistes+- Ensure you have access to a **Kubernetes Cluster**. You can quickly spin up a Kubernetes Cluster using [Kind](https://github.com/kubernetes-sigs/kind?tab=readme-ov-file#installation-and-usage)++## Get Started++<Steps>+ <Step title="Install Doku in a Kubernetes Cluster">+ <Steps>+ <Step title="Helm Repo Setup">+ ```shell shell+ helm repo add dokulabs https://dokulabs.github.io/helm/+ helm repo update+ ```+ </Step>+ <Step title="Installing the Helm Chart">+ ```shell shell+ helm install doku dokulabs/doku+ ```+ </Step>+ </Steps>+ </Step>+ <Step title="Generate an API Key">+ With Doku running, the next step is to [generate an API key](/0.0.3/api-reference/endpoint/api-keys/create) for secure communication between your applications and Doku.++ To generate your first API key, you can use the following command:++ ```shell shell+ curl --request POST \+ --url https://<your-doku-url>/api/keys \+ --header 'Authorization: ""' \+ --header 'Content-Type: application/json' \+ --data '{+ "name": "Admin"+ }'+ ```++ Make sure to store the returned API key securely, as it's necessary for authorizing future API calls with Doku.++ <Info>+ During your initial request to generate an API key, you can leave the Authorization header empty (i.e., `""`). For subsequent requests, you will need to supply the generated API key.+ </Info>++ </Step>+ <Step title="Instrument your code">+ Choose the appropriate SDK for your application's programming language and follow the steps to integrate monitoring with just a couple of lines of code.+ <Tabs>+ <Tab title="Python">+ <Steps>+ <Step title="Install the dokumetry Python SDK using pip">+ ```shell+ pip install dokumetry+ ```+ </Step>+ <Step title="Add the following two lines to your application code:">+ Add the snippet below to your Python application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.++ ```python+ import dokumetry++ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")+ ```++ Example Usage for monitoring `OpenAI` Usage:++ ```python+ from openai import OpenAI+ import dokumetry++ client = OpenAI(+ api_key="YOUR_OPENAI_KEY"+ )++ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++ chat_completion = client.chat.completions.create(+ messages=[+ {+ "role": "user",+ "content": "What is LLM Observability",+ }+ ],+ model="gpt-3.5-turbo",+ )+ ```++ Refer to the `dokumetry` [Python SDK repository](https://github.com/dokulabs/dokumetry-python) or the [DokuMetry Docs](/0.0.3/dokumetry/python/intro) for more advanced configurations and use cases.+ </Step>+ </Steps>+ </Tab>+ <Tab title="NodeJS">+ <Steps>+ <Step title="Install the dokumetry NodeJS SDK using npm">+ ```shell+ npm install dokumetry+ ```+ </Step>+ <Step title="Add the following two lines to your application code">+ Add the snippet below to your NodeJS application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.+ ```javascript+ import DokuMetry from 'dokumetry';++ DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})+ ```++ Example Usage for monitoring `OpenAI` Usage:++ ```javascript+ import OpenAI from 'openai';+ import DokuMetry from 'dokumetry';++ const openai = new OpenAI({+ apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]+ });++ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const chatCompletion = await openai.chat.completions.create({+ messages: [{ role: 'user', content: 'What are the key to effective observability?' }],+ model: 'gpt-3.5-turbo',+ });+ }++ main();+ ```++ Refer to the `dokumetry` [NodeJS SDK repository](https://github.com/dokulabs/dokumetry-node) or the [DokuMetry Docs](/0.0.3/dokumetry/node/introduction) for more advanced configurations and use cases.+ </Step>+ </Steps>+ </Tab>+ </Tabs>+ </Step>+</Steps>++## (Optional) Export Data+<Card title="Integrations" href="/0.0.3/integrations/introduction" icon='connectdevelop'>+Connect to your existing Observablity Platform+</Card>++You're all set! Following these steps should have you on your way to effectively monitoring your LLM applications. If you have any questions or need support, reach out to our [community](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA).diff --git a/docs/0.0.4/api-reference/endpoint/api-keys/create.mdx b/docs/0.0.4/api-reference/endpoint/api-keys/create.mdxnew file mode 100644index 00000000..cce6cecf--- /dev/null+++ b/docs/0.0.4/api-reference/endpoint/api-keys/create.mdx@@ -0,0 +1,4 @@+---+title: 'Create API Key'+openapi: 'POST /api/keys'+---\ No newline at end of filediff --git a/docs/0.0.4/api-reference/endpoint/api-keys/delete.mdx b/docs/0.0.4/api-reference/endpoint/api-keys/delete.mdxnew file mode 100644index 00000000..fbb9e963--- /dev/null+++ b/docs/0.0.4/api-reference/endpoint/api-keys/delete.mdx@@ -0,0 +1,4 @@+---+title: 'Delete API Key'+openapi: 'DELETE /api/keys'+---\ No newline at end of filediff --git a/docs/0.0.4/api-reference/endpoint/api-keys/get.mdx b/docs/0.0.4/api-reference/endpoint/api-keys/get.mdxnew file mode 100644index 00000000..3ecec318--- /dev/null+++ b/docs/0.0.4/api-reference/endpoint/api-keys/get.mdx@@ -0,0 +1,4 @@+---+title: 'GET API Key'+openapi: 'GET /api/keys'+---\ No newline at end of filediff --git a/docs/0.0.4/api-reference/introduction.mdx b/docs/0.0.4/api-reference/introduction.mdxnew file mode 100644index 00000000..7834f304--- /dev/null+++ b/docs/0.0.4/api-reference/introduction.mdx@@ -0,0 +1,25 @@+---+title: 'Introduction'+description: 'OpenAPI specification for API Endpoints in Doku'+---++<Card+ title="API Keys Endpoints"+ icon="key"+ href="/0.0.4/api-reference/endpoint/api-keys/create"+>+ View the documentation for API Keys+</Card>++## Authentication++All API endpoints are authenticated using Authetication Header.++```json+Authorization: <api-key>+```++<Info>+For your initial API call, Authorization header can be set to "".+Store the provided API key securely; it will be required to pass the generated and a valid API Key in Authorization header for subsequent API calls.+</Info>\ No newline at end of filediff --git a/docs/0.0.4/api-reference/openiapi.yml b/docs/0.0.4/api-reference/openiapi.ymlnew file mode 100644index 00000000..281f249a--- /dev/null+++ b/docs/0.0.4/api-reference/openiapi.yml@@ -0,0 +1,100 @@+openapi: 3.0.0+info:+ title: API Keys Service+ description: This service manages API keys through GET, POST, and DELETE operations.+ version: "1.0.0"++servers:+ - url: https://127.0.0.1:9044/++paths:+ /api/keys:+ get:+ summary: Get a list of API keys+ operationId: getApiKeys+ tags:+ - API Key+ security:+ - ApiKeyAuth: []+ requestBody:+ required: true+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/APIKeyRequest'+ responses:+ '200':+ description: A list of API keys+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/jsonResponse'++ post:+ summary: Create a new API key+ operationId: createApiKey+ tags:+ - API Key+ security:+ - ApiKeyAuth: []+ requestBody:+ required: true+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/APIKeyRequest'+ responses:+ '201':+ description: API key created+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/jsonResponse'++ delete:+ summary: Delete an API key+ operationId: deleteApiKey+ tags:+ - API Key+ security:+ - ApiKeyAuth: []+ requestBody:+ required: true+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/APIKeyRequest'+ responses:+ '200':+ description: API key deleted+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/jsonResponse'++components:+ schemas:+ APIKeyRequest:+ type: object+ required:+ - name+ properties:+ name:+ type: string++ jsonResponse:+ type: object+ required:+ - status+ - message+ properties:+ status:+ type: integer+ message:+ type: string++ securitySchemes:+ ApiKeyAuth:+ type: apiKey+ in: header+ name: Authorization\ No newline at end of filediff --git a/docs/0.0.4/configuration.mdx b/docs/0.0.4/configuration.mdxnew file mode 100644index 00000000..cc1f7c53--- /dev/null+++ b/docs/0.0.4/configuration.mdx@@ -0,0 +1,248 @@+---+title: 'Configuration'+description: 'Configuring Options for Doku'+icon: 'sliders'+---++This document outlines the various options available for configuring Doku.+For ease of use and clarity, we recommend naming the configuration file `doku.yml`+++## Properties++<ResponseField name="ingester_port" type="String">+ The `ingesterPort` specifies the network port that the Ingestion Server will listen to for incoming data. You can set this to any available port on your system.++**Example**:+```yaml+ingesterPort: 9044+```+</ResponseField>++### Pricing Information Source++Doku supports using either a local file or a URL to retrieve LLM Pricing data. Comment out the option you do not wish to use.+<Info>+We strongly recommend using the `url` method with the value set as `https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json`.++This ensures that you automatically retrieve the latest pricing information upon each startup, as the developers at Doku consistently refresh the pricing file with current data from OpenAI, Cohere and Anthropic.+</Info>++<ResponseField name="local_file" type="Object">+ Local File containing the Pricing Information JSON+ <Expandable title="properties">+ <ResponseField name="path" type="String">+ Specify the local file system path to a JSON file containing the LLM Pricing data.+ </ResponseField>+ </Expandable>++ **Example**:+ ```yaml+ pricingInfo:+ localFile:+ path: "/assets/pricing.json"+ ```+</ResponseField>++<ResponseField name="url" type="String">+ Provide the URL where the pricing data JSON file can be downloaded. Ensure the given URL is accessible.++ **Example**:+ ```yaml+ pricingInfo:+ url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json"+ ```+</ResponseField>+++### Database Configuration++<ResponseField name="dbConfig" type="Object">+ Configure the database connection details to connect Doku with TimescaleDB (or another Postgres compatible DB).+ <Expandable title="properties">+ <ResponseField name="name" type="String">+ Database name.+ </ResponseField>+ <ResponseField name="username" type="String">+ The username for the database.+ </ResponseField>+ <ResponseField name="password" type="String">+ The password for the database.+ </ResponseField>+ <ResponseField name="host" type="String">+ Host address for the database.+ </ResponseField>+ <ResponseField name="port" type="String">+ Network port for the database connection.+ </ResponseField>+ <ResponseField name="sslMode" type="String">+ The SSL mode for the database connection (e.g., "require" if SSL is needed).+ </ResponseField>+ <ResponseField name="maxOpenConns" type="String">+ Maximum number of concurrent open database connections.+ </ResponseField>+ <ResponseField name="maxIdleConns" type="String">+ Maximum number of idle database connections.+ </ResponseField>+ <ResponseField name="dataTable" type="String">+ Name of the table to store LLM Data.+ </ResponseField>+ <ResponseField name="apiKeyTable" type="String">+ Name of the table to store API Keys.+ </ResponseField>+ </Expandable>++ **Example**:+ ```yaml+ dbConfig:+ name: "mydatabase"+ username: "myusername"+ password: "mypassword"+ host: "mydbhost.example.com"+ port: 5432+ sslMode: "require"+ maxOpenConns: 15+ maxIdleConns: 10+ dataTable: "llm_data"+ apiKeyTable: "api_keys"+ ```+</ResponseField>+++### Observability Platform Configuration++<ResponseField name="observabilityPlatform" type="Object">+ Choose the external platform you wish to use for exporting observability data from Doku and set `enabled` to `true`. Fill in the required fields for the chosen platform. Only one platform can be selected at a time.++ The following sections show example configurations for different platforms - Grafana Cloud, New Relic, and DataDog. You will need to uncomment the applicable section and provide necessary credentials such as URLs, User IDs, and API Keys corresponding to your account on the observability platform.+ <Expandable title="properties">+ <ResponseField name="enabled" type="boolean">+ Boolean parameter to configure external Observability Platform+ </ResponseField>+ <ResponseField name="grafanaCloud" type="Object">+ Configuration for connecting Doku with Grafana Cloud.+ <Expandable title="properties">+ <ResponseField name="promUrl" type="String">+ URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance.+ </ResponseField>+ <ResponseField name="promUsername" type="String">+ Prometheus User ID of the Grafana Cloud Prometheus Instance.+ </ResponseField>+ <ResponseField name="lokiUrl" type="String">+ URL of the Loki Push URL of the Grafana Cloud Loki Instance.+ </ResponseField>+ <ResponseField name="lokiUsername" type="String">+ Loki Username of the Grafana Cloud Loki Instance.+ </ResponseField>+ <ResponseField name="accessToken" type="String">+ Access Token of the Grafana Cloud Instance.+ </ResponseField>+ **Example**:+ ```yaml+ observabilityPlatform:+ enabled: true+ grafanaCloud:+ promUrl: "https://your-grafana-prometheus-url"+ promUsername: "your-prom-user-id"+ lokiUrl: "https://your-grafana-loki-url"+ lokiUsername: "your-loki-user-id"+ accessToken: "your-grafana-cloud-access-token"+ ```+ </Expandable>+ </ResponseField>+ <ResponseField name="datadog" type="Object">+ Configuration for connecting Doku with DataDog.+ <Expandable title="properties">+ <ResponseField name="metricsUrl" type="String">+ URL to the DataDog Metrics API.+ </ResponseField>+ <ResponseField name="logsUrl" type="String">+ URL to the DataDog Logs API.+ </ResponseField>+ <ResponseField name="apiKey" type="String">+ API Key of the DataDog Account.+ </ResponseField>+ **Example**:+ ```yaml+ observabilityPlatform:+ enabled: true+ datadog:+ metricsUrl: "https://api.datadoghq.com/api/v1/series"+ logsUrl: "https://http.logs.datadoghq.com/api/v2/logs"+ apiKey: "datadog-api-key"+ ```+ </Expandable>+ </ResponseField>+ <ResponseField name="newRelic" type="Object">+ Configuration for connecting Doku with New Relic.+ <Expandable title="properties">+ <ResponseField name="metricsUrl" type="String">+ URL to the New Relic Metric API.+ </ResponseField>+ <ResponseField name="logsUrl" type="String">+ URL to the New Relic Log API.+ </ResponseField>+ <ResponseField name="apiKey" type="String">+ Ingest API Key of the New Relic Account.+ </ResponseField>+ **Example**:+ ```yaml+ observabilityPlatform:+ enabled: true+ newRelic:+ metricsUrl: "https://metric-api.newrelic.com/metric/v1"+ logsUrl: "https://log-api.newrelic.com/log/v1"+ apiKey: "newrelic-api-key"+ ```+ </Expandable>+ </ResponseField>+ </Expandable>+</ResponseField>++Ensure that the file is correctly formatted in YAML and all necessary fields are populated based on your deployment needs. Save the file and restart the Doku service to apply the new configuration.++## Example Configuration File++```yaml doku.yml+ingesterPort: 9044 # Port to run the Ingestion Server on, Example: 9044++# Comment out either 'localFile' or 'url' to use only one at a time.+pricingInfo:+ # localFile:+ # path: "/assets/pricing.json" # Path to local JSON file with LLM Pricing data+ url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json" # URL to download Pricing data file++# Configuration for the Doku Backend Database (TimescaleDB)+dbConfig:+ name: "DBNAME" # Name of the database, Example: "postgres"+ username: "USERNAME" # Username to connect to the database, Example: "admin"+ password: "PASSWORD" # Password to connect to the database, Example: "DOKU"+ host: "HOSTURL" # Hostname of the database, Example: "174.21.1.2"+ port: DBPORT # Port of the database, Example: 5432+ sslMode: SSLMODE # SSL Mode of the database, Example: "require"+ maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15+ maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15+ dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"+ apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"++# Configure Platform to export LLM Observability Data from Doku+# Only one platform can be enabled at a time, To enable a platform, set enabled to true and fill in the required fields for that platform.+observabilityPlatform:+ enabled: false # Enable or Disable the Observability Platform, Example: true+ # grafanaCloud:+ # promUrl: "influx-line-proxy-url" # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance+ # promUsername: "prometheus-userid" # Prometheus User ID of the Grafana Cloud Prometheus Instance+ # lokiUrl: "loki-push-url" # URL to the Loki Push URL of the Grafana Cloud Loki Instance+ # lokiUsername: "loki-username" # Loki Username of the Grafana Cloud Loki Instance+ # accessToken: "grafana-cloud-access-token" # Access Token of the Grafana Cloud Instance++ # newRelic:+ # metricsUrl: "https://metric-api.newrelic.com/metric/v1" # URL to the New Relic Metric API+ # logsUrl: "https://log-api.newrelic.com/log/v1" # URL to the New Relic Log API+ # key: "newrelic-api-key" # Ingest API Key of the New Relic Account++ # datadog:+ # metricsUrl: "https://api.datadoghq.com/api/v1/series" # URL to the DataDog Metrics API+ # logsUrl: "https://http.logs.datadoghq.com/api/v2/logs" # URL to the DataDog Logs API+ # apiKey: "datadog-api-key" # API Key of the DataDog Account+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/introduction.mdx b/docs/0.0.4/dokumetry/introduction.mdxnew file mode 100644index 00000000..fb46de85--- /dev/null+++ b/docs/0.0.4/dokumetry/introduction.mdx@@ -0,0 +1,34 @@+---+title: 'Overview'+description: 'Seamlessly send LLM usage data to Doku'+---++[DokuMetry SDK](https://www.npmjs.com/package/dokumetry) (`dokumetry`) empowers you to effortlessly track and monitor language learning model (LLM) usage data and metrics from your Python/NodeJS code. It seamlessly integrates with major LLM Platforms:+++DokuMetry SDKs can currently track and monitor API usage for the below platforms+<CardGroup cols={3}>+<Card title="OpenAI">+</Card>+<Card title="Cohere">+</Card>+<Card title="Anthropic">+</Card>+</CardGroup>++All LLM observability data collected by DokuMetry is sent directly to the Doku Platform for streamlined tracking.++## Features++- **Effortless Setup:** Integrate full-featured LLM usage monitoring into your application with just two lines of code.+- **Efficient Performance:** Designed for near-zero latency impact, allowing your applications to run smoothly without compromise.+- **Secure and Reliable**: DokuMetry SDKs prioritize the safety and integrity of your data. All data transmission to Doku is conducted over secure HTTP, ensuring that your observability data is protected during transit.++## Supported Languages++<CardGroup cols={2}>+<Card title="Python" href="/0.0.4/dokumetry/python" icon="python">+</Card>+<Card title="NodeJS" href="/0.0.4/dokumetry/node" icon="node-js">+</Card>+</CardGroup>diff --git a/docs/0.0.4/dokumetry/node/examples/anthropic/anthropic-completions.mdx b/docs/0.0.4/dokumetry/node/examples/anthropic/anthropic-completions.mdxnew file mode 100644index 00000000..946996fb--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/anthropic/anthropic-completions.mdx@@ -0,0 +1,29 @@+---+title: 'Completions'+description: 'Monitor Anthropic Completions API Usage'+---++## Completions++```javascript+import Anthropic from '@anthropic-ai/sdk';+import DokuMetry from 'dokumetry';++const anthropic = new Anthropic({+ apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]+});++// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.+DokuMetry.init({llm: anthropic, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await anthropic.completions.create({+ model: 'claude-2',+ max_tokens_to_sample: 300,+ prompt: `${Anthropic.HUMAN_PROMPT} Hello, Claude{Anthropic.AI_PROMPT}`,+ });+ console.log(completion.completion);+}+main().catch(console.error);+```+diff --git a/docs/0.0.4/dokumetry/node/examples/cohere/chat.mdx b/docs/0.0.4/dokumetry/node/examples/cohere/chat.mdxnew file mode 100644index 00000000..c806e971--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/cohere/chat.mdx@@ -0,0 +1,57 @@+---+title: 'Chat'+description: 'Monitor Cohere Chat API usage'+---++## Chat+<CodeGroup>++```javascript No Streaming+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++const response = await cohere.chat({+ message: 'Say this is a test',+ model: 'command',+ });+print(response)+```++```javascript Streaming+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const chatStream = await cohere.chatStream({+ chatHistory: [+ { role: "USER", message: "Who discovered gravity?" },+ { role: "CHATBOT", message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" }+ ],+ message: "What year was he born?",+ // perform web search before answering the question. You can also use your own custom connector.+ connectors: [{ id: "web-search" }],+ });++ for await (const message of chatStream) {+ if (message.eventType === "text-generation") {+ console.log(message);+ }+ }+})();+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/node/examples/cohere/embed.mdx b/docs/0.0.4/dokumetry/node/examples/cohere/embed.mdxnew file mode 100644index 00000000..d6a3fc53--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/cohere/embed.mdx@@ -0,0 +1,27 @@+---+title: 'Embed'+description: 'Monitor Cohere Embed API usage'+---++## Embed++```javascript+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const embed = await cohere.embed({+ texts: ["hello", "goodbye"],+ model: "embed-english-v3.0",+ inputType: "classification",+ });+ console.log(embed);+})();+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/node/examples/cohere/generate.mdx b/docs/0.0.4/dokumetry/node/examples/cohere/generate.mdxnew file mode 100644index 00000000..b7a3035d--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/cohere/generate.mdx@@ -0,0 +1,26 @@+---+title: 'Generate'+description: 'Monitor Cohere Generate API usage'+---++## Generate++```javascript+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const generate = await cohere.generate({+ prompt: "Please explain to me how LLMs work",+ });++ console.log(generate);+})();+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/node/examples/cohere/summarize.mdx b/docs/0.0.4/dokumetry/node/examples/cohere/summarize.mdxnew file mode 100644index 00000000..20fef3a1--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/cohere/summarize.mdx@@ -0,0 +1,45 @@+---+title: 'Summarize'+description: 'Monitor Cohere Summarize API usage'+---++## Summarize++```javascript+const { CohereClient } = require("cohere-ai");+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ token: "<<apiKey>>",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const summarize = await cohere.summarize({+ text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "+ + "It may be made from milk or cream and is flavoured with a sweetener, "+ + "either sugar or an alternative, and a spice, such as cocoa or vanilla, "+ + "or with fruit such as strawberries or peaches. "+ + "It can also be made by whisking a flavored cream base and liquid nitrogen together. "+ + "Food coloring is sometimes added, in addition to stabilizers. "+ + "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "+ + "and to prevent detectable ice crystals from forming. The result is a smooth, "+ + "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "+ + "It becomes more malleable as its temperature increases.\n\n"+ + "The meaning of the name \"ice cream\" varies from one country to another. "+ + "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "+ + "and most governments regulate the commercial use of the various terms according to the "+ + "relative quantities of the main ingredients, notably the amount of cream. "+ + "Products that do not meet the criteria to be called ice cream are sometimes labelled "+ + "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "+ + "one word is used fo\r all variants. Analogues made from dairy alternatives, "+ + "such as goat's or sheep's milk, or milk substitutes "+ + "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "+ + "lactose intolerant, allergic to dairy protein or vegan.",+ });++ console.log(summarize);+})();+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/node/examples/openai/audio.mdx b/docs/0.0.4/dokumetry/node/examples/openai/audio.mdxnew file mode 100644index 00000000..ee418a65--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/openai/audio.mdx@@ -0,0 +1,32 @@+---+title: 'Audio'+description: 'Monitor OpenAI Audio API usage'+---++## Create Speech++```javascript+import fs from "fs";+import path from "path";+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++const speechFile = path.resolve("./speech.mp3");++async function main() {+ const mp3 = await openai.audio.speech.create({+ model: "tts-1",+ voice: "alloy",+ input: "Today is a wonderful day to build something people love!",+ });+ console.log(speechFile);+ const buffer = Buffer.from(await mp3.arrayBuffer());+ await fs.promises.writeFile(speechFile, buffer);+}+main();+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/node/examples/openai/chat.mdx b/docs/0.0.4/dokumetry/node/examples/openai/chat.mdxnew file mode 100644index 00000000..4d72ed4d--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/openai/chat.mdx@@ -0,0 +1,157 @@+---+title: 'Chat'+description: 'Monitor OpenAI Chat Completions API usage'+---++## Chat Completions++<CodeGroup>++```javascript Default+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await openai.chat.completions.create({+ messages: [{ role: "system", content: "You are a helpful assistant." }],+ model: "gpt-3.5-turbo",+ });++ console.log(completion.choices[0]);+}++main();+```++```javascript Image Input+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const response = await openai.chat.completions.create({+ model: "gpt-4-vision-preview",+ messages: [+ {+ role: "user",+ content: [+ { type: "text", text: "What’s in this image?" },+ {+ type: "image_url",+ image_url:+ "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",+ },+ ],+ },+ ],+ });+ console.log(response.choices[0]);+}+main();+```++```javascript Streaming+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await openai.chat.completions.create({+ model: "gpt-3.5-turbo",+ messages: [+ {"role": "system", "content": "You are a helpful assistant."},+ {"role": "user", "content": "Hello!"}+ ],+ stream: true,+ });++ for await (const chunk of completion) {+ console.log(chunk.choices[0].delta.content);+ }+}++main();+```++```javascript Functions+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];+ const tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+ ];++ const response = await openai.chat.completions.create({+ model: "gpt-3.5-turbo",+ messages: messages,+ tools: tools,+ tool_choice: "auto",+ });++ console.log(response);+}++main();+```++```javascript LogProbs+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await openai.chat.completions.create({+ messages: [{ role: "user", content: "Hello!" }],+ model: "gpt-3.5-turbo",+ logprobs: true,+ top_logprobs: 2,+ });++ console.log(completion.choices[0]);+}++main();+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/node/examples/openai/chatCompletions.mdx b/docs/0.0.4/dokumetry/node/examples/openai/chatCompletions.mdxnew file mode 100644index 00000000..d535f7cc--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/openai/chatCompletions.mdx@@ -0,0 +1,53 @@+---+title: 'Completions'+description: 'Monitor OpenAI Completions API Usage'+---++## Completions+<CodeGroup>+```javascript No Streaming+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await openai.completions.create({+ model: "gpt-3.5-turbo-instruct",+ prompt: "Say this is a test.",+ max_tokens: 7,+ temperature: 0,+ });++ console.log(completion);+}+main();+```++```javascript Streaming+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const stream = await openai.completions.create({+ model: "gpt-3.5-turbo-instruct",+ prompt: "Say this is a test.",+ stream: true,+ });++ for await (const chunk of stream) {+ console.log(chunk.choices[0].text)+ }+}+main();+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/node/examples/openai/embeddings.mdx b/docs/0.0.4/dokumetry/node/examples/openai/embeddings.mdxnew file mode 100644index 00000000..fac7405a--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/openai/embeddings.mdx@@ -0,0 +1,28 @@+---+title: 'Embeddings'+description: 'Monitor OpenAI Embeddings API usage'+---++## Create Embeddings++```javascript+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const embedding = await openai.embeddings.create({+ model: "text-embedding-ada-002",+ input: "The quick brown fox jumped over the lazy dog",+ encoding_format: "float",+ });++ console.log(embedding);+}++main();+```diff --git a/docs/0.0.4/dokumetry/node/examples/openai/fine-tuning.mdx b/docs/0.0.4/dokumetry/node/examples/openai/fine-tuning.mdxnew file mode 100644index 00000000..06ed6f0e--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/openai/fine-tuning.mdx@@ -0,0 +1,26 @@+---+title: 'Fine Tuning'+description: 'Monitor OpenAI Fine Tuning API usage'+---++## Create Fine Tuning Job++```javascript+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const fineTune = await openai.fineTuning.jobs.create({+ training_file: "file-abc123"+ });++ console.log(fineTune);+}++main();+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/node/examples/openai/image.mdx b/docs/0.0.4/dokumetry/node/examples/openai/image.mdxnew file mode 100644index 00000000..7a80fd09--- /dev/null+++ b/docs/0.0.4/dokumetry/node/examples/openai/image.mdx@@ -0,0 +1,44 @@+---+title: 'Image'+description: 'Monitor OpenAI Image API usage'+---++## Create Image++```javascript+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" });++ console.log(image.data);+}+main();+```++## Create Image Variation+```javascript+import fs from "fs";+import OpenAI from "openai";+import DokuMetry from 'dokumetry';++const openai = new OpenAI();++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const image = await openai.images.createVariation({+ image: fs.createReadStream("otter.png"),+ });++ console.log(image.data);+}+main();+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/node/introduction.mdx b/docs/0.0.4/dokumetry/node/introduction.mdxnew file mode 100644index 00000000..648c8334--- /dev/null+++ b/docs/0.0.4/dokumetry/node/introduction.mdx@@ -0,0 +1,125 @@+---+title: 'Introduction'+description: 'Monitor your NodeJS LLM Application with DokuMetry'+---++DokuMetry Node SDK is the official library from Doku to send LLM usage data from your NodeJS application to Doku.++## Installation+``` shell shell+npm install dokumetry+```++## Usage++### OpenAI++```javascript openai.js+import OpenAI from 'openai';+import DokuMetry from 'dokumetry';++const openai = new OpenAI({+ apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]+});++// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const chatCompletion = await openai.chat.completions.create({+ messages: [{ role: 'user', content: 'What are the key to effective observability?' }],+ model: 'gpt-3.5-turbo',+ });+}++main();+```++The following OpenAI Endpoints are supported for monitoring with DokuMetry++- [Chat completions](/0.0.4/dokumetry/node/examples/openai/chat)+- [Image Create](/0.0.4/dokumetry/node/examples/openai/image#create-image) and [Image Variations](/0.0.4/dokumetry/node/examples/openai/image#create-image-variation)+- [Audio Speech Create](/0.0.4/dokumetry/node/examples/openai/audio)+- [Embeddings](/0.0.4/dokumetry/node/examples/openai/embeddings)+- [Fine Tunings](/0.0.4/dokumetry/node/examples/openai/fine-tuning)+- [Completions](/0.0.4/dokumetry/node/examples/openai/chatCompletions)++### Cohere++```javascript cohere.js+import { CohereClient } from "cohere-ai";+import DokuMetry from 'dokumetry';++const cohere = new CohereClient({+ apiKey: "YOUR_API_KEY",+});++// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+DokuMetry.init({llm: cohere, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++(async () => {+ const prediction = await cohere.generate({+ prompt: "hello",+ maxTokens: 10,+ });++ console.log("Received prediction", prediction);+})();+```++The following Cohere Endpoints are supported for monitoring with DokuMetry++- [Chat](/0.0.4/dokumetry/node/examples/cohere/chat)+- [Generate](/0.0.4/dokumetry/node/examples/cohere/generate)+- [Summarize](/0.0.4/dokumetry/node/examples/cohere/summarize)+- [Embed](/0.0.4/dokumetry/node/examples/cohere/embed)++### Anthropic++```javascript anthropic.js+import Anthropic from '@anthropic-ai/sdk';+import DokuMetry from 'dokumetry';++const anthropic = new Anthropic({+ apiKey: 'my api key', // defaults to process.env["ANTHROPIC_API_KEY"]+});++// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.+DokuMetry.init({llm: anthropic, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++async function main() {+ const completion = await anthropic.completions.create({+ model: 'claude-2',+ max_tokens_to_sample: 300,+ prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court?${Anthropic.AI_PROMPT}`,+ });+}++main();+```++The following Anthropic Endpoints are supported for monitoring with DokuMetry++- [Completions](/0.0.4/dokumetry/node/examples/anthropic/anthropic-completions)++## Parameters++| Parameter | Description | Required |+|-------------------|-----------------------------------------------------------|---------------|+| llm | Language Learning Model (LLM) Object to track | Yes |+| dokuURL | URL of your Doku Instance | Yes |+| apiKey | Your Doku API key | Yes |+| environment | Custom environment tag to include in your metrics | Optional |+| applicationName | Custom application name tag for your metrics | Optional |+| skipResp | Skip response from the Doku Ingester for faster execution | Optional |++## Advanced Usage+When using DokuMetry in Production environments, It is recommened to set `skipResp: True` for faster porcessing.++To filter your LLM Usage according application or the environment, set the `application` and `environment` parameters with the actual values.+++## Requirements+NodeJS >= 18.0 is supported.++If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/examples/anthropic/anthropic-completions.mdx b/docs/0.0.4/dokumetry/python/examples/anthropic/anthropic-completions.mdxnew file mode 100644index 00000000..b2ea104b--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/anthropic/anthropic-completions.mdx@@ -0,0 +1,27 @@+---+title: 'Completions'+description: 'Monitor Anthropic Completions API Usage'+---++## Completions++```javascript+from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT+import dokumetry++anthropic = Anthropic(+ # defaults to os.environ.get("ANTHROPIC_API_KEY")+ api_key="my_api_key",+)++# Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.+dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = anthropic.completions.create(+ model="claude-2",+ max_tokens_to_sample=300,+ prompt=f"{HUMAN_PROMPT} Hello, Claude{AI_PROMPT}",+)+print(completion.completion)+```+diff --git a/docs/0.0.4/dokumetry/python/examples/cohere/chat.mdx b/docs/0.0.4/dokumetry/python/examples/cohere/chat.mdxnew file mode 100644index 00000000..d8f8fb92--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/cohere/chat.mdx@@ -0,0 +1,52 @@+---+title: 'Chat'+description: 'Monitor Cohere Chat API usage'+---++## Chat+<CodeGroup>++```python No Streaming+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = co.chat(+ chat_history=[+ {"role": "USER", "message": "Who discovered gravity?"},+ {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}+ ],+ message="What year was he born?",+ # perform web search before answering the question. You can also use your own custom connector.+ connectors=[{"id": "web-search"}]+)+print(response)+```++```python Streaming+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = co.chat(+ chat_history=[+ {"role": "USER", "message": "Who discovered gravity?"},+ {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}+ ],+ message="What year was he born?",+ stream=True,+ # perform web search before answering the question. You can also use your own custom connector.+ connectors=[{"id": "web-search"}]+)+print(response)+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/examples/cohere/co-summarize.mdx b/docs/0.0.4/dokumetry/python/examples/cohere/co-summarize.mdxnew file mode 100644index 00000000..c9bfcc05--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/cohere/co-summarize.mdx@@ -0,0 +1,44 @@+---+title: 'Summarize'+description: 'Monitor Cohere Summarize API usage'+---++## Summarize++```python+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++text=(+ "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "+ "It may be made from milk or cream and is flavoured with a sweetener, "+ "either sugar or an alternative, and a spice, such as cocoa or vanilla, "+ "or with fruit such as strawberries or peaches. "+ "It can also be made by whisking a flavored cream base and liquid nitrogen together. "+ "Food coloring is sometimes added, in addition to stabilizers. "+ "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "+ "and to prevent detectable ice crystals from forming. The result is a smooth, "+ "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "+ "It becomes more malleable as its temperature increases.\n\n"+ "The meaning of the name \"ice cream\" varies from one country to another. "+ "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "+ "and most governments regulate the commercial use of the various terms according to the "+ "relative quantities of the main ingredients, notably the amount of cream. "+ "Products that do not meet the criteria to be called ice cream are sometimes labelled "+ "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "+ "one word is used fo\r all variants. Analogues made from dairy alternatives, "+ "such as goat's or sheep's milk, or milk substitutes "+ "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "+ "lactose intolerant, allergic to dairy protein or vegan."+)++response = co.summarize(+ text=text,+)+print(response)+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/examples/cohere/embed.mdx b/docs/0.0.4/dokumetry/python/examples/cohere/embed.mdxnew file mode 100644index 00000000..05900ae2--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/cohere/embed.mdx@@ -0,0 +1,23 @@+---+title: 'Embed'+description: 'Monitor Cohere Embed API usage'+---++## Embed++```python+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = co.embed(+ texts=['hello', 'goodbye'],+ model='embed-english-v3.0',+ input_type='classification'+)+print(response)+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/examples/cohere/generate.mdx b/docs/0.0.4/dokumetry/python/examples/cohere/generate.mdxnew file mode 100644index 00000000..b137a0c9--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/cohere/generate.mdx@@ -0,0 +1,21 @@+---+title: 'Generate'+description: 'Monitor Cohere Generate API usage'+---++## Generate++```python+import cohere+import dokumetry++co = cohere.Client('<<apiKey>>')++# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = co.generate(+ prompt='Please explain to me how LLMs work',+)+print(response)+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/examples/openai/audio.mdx b/docs/0.0.4/dokumetry/python/examples/openai/audio.mdxnew file mode 100644index 00000000..c927bb36--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/openai/audio.mdx@@ -0,0 +1,25 @@+---+title: 'Audio'+description: 'Monitor OpenAI Audio API usage'+---++## Create Speech++```python+from pathlib import Path+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++speech_file_path = Path(__file__).parent / "speech.mp3"+response = client.audio.speech.create(+ model="tts-1",+ voice="alloy",+ input="The quick brown fox jumped over the lazy dog."+)+response.stream_to_file(speech_file_path)+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/examples/openai/chat.mdx b/docs/0.0.4/dokumetry/python/examples/openai/chat.mdxnew file mode 100644index 00000000..5c97d068--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/openai/chat.mdx@@ -0,0 +1,143 @@+---+title: 'Chat'+description: 'Monitor OpenAI Chat Completions API usage'+---++## Chat Completions++<CodeGroup>++```python Default+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = client.chat.completions.create(+ model="gpt-3.5-turbo",+ messages=[+ {"role": "system", "content": "You are a helpful assistant."},+ {"role": "user", "content": "Hello!"}+ ]+)++print(completion.choices[0].message)+```++```python Image Input+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = client.chat.completions.create(+ model="gpt-4-vision-preview",+ messages=[+ {+ "role": "user",+ "content": [+ {"type": "text", "text": "What’s in this image?"},+ {+ "type": "image_url",+ "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",+ },+ ],+ }+ ],+ max_tokens=300,+)++print(response.choices[0])+```++```python Streaming+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = client.chat.completions.create(+ model="gpt-3.5-turbo",+ messages=[+ {"role": "system", "content": "You are a helpful assistant."},+ {"role": "user", "content": "Hello!"}+ ],+ stream=True+)++for chunk in completion:+ print(chunk.choices[0].delta)+```++```python Functions+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+]+messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]+completion = client.chat.completions.create(+ model="gpt-3.5-turbo",+ messages=messages,+ tools=tools,+ tool_choice="auto"+)++print(completion)+```++```python LogProbs+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = client.chat.completions.create(+ model="gpt-3.5-turbo",+ messages=[+ {"role": "user", "content": "Hello!"}+ ],+ logprobs=True,+ top_logprobs=2+)++print(completion.choices[0].message)+print(completion.choices[0].logprobs)+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/examples/openai/completions.mdx b/docs/0.0.4/dokumetry/python/examples/openai/completions.mdxnew file mode 100644index 00000000..ab3beb87--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/openai/completions.mdx@@ -0,0 +1,45 @@+---+title: 'Completions'+description: 'Monitor OpenAI Completions API Usage'+---++## Completions+<CodeGroup>+```python No Streaming+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++client.completions.create(+ model="gpt-3.5-turbo-instruct",+ prompt="Say this is a test",+ max_tokens=7,+ temperature=0+)+```++```python Streaming+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++for chunk in client.completions.create(+ model="gpt-3.5-turbo-instruct",+ prompt="Say this is a test",+ max_tokens=7,+ temperature=0,+ stream=True+):++print(chunk.choices[0].text)+```++</CodeGroup>\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/examples/openai/embeddings.mdx b/docs/0.0.4/dokumetry/python/examples/openai/embeddings.mdxnew file mode 100644index 00000000..6c22743a--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/openai/embeddings.mdx@@ -0,0 +1,22 @@+---+title: 'Embeddings'+description: 'Monitor OpenAI Embeddings API usage'+---++## Create Embeddings++```python+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++client.embeddings.create(+ model="text-embedding-ada-002",+ input="The food was delicious and the waiter...",+ encoding_format="float"+)+```diff --git a/docs/0.0.4/dokumetry/python/examples/openai/fine-tuning.mdx b/docs/0.0.4/dokumetry/python/examples/openai/fine-tuning.mdxnew file mode 100644index 00000000..4de9f9c7--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/openai/fine-tuning.mdx@@ -0,0 +1,21 @@+---+title: 'Fine Tuning'+description: 'Monitor OpenAI Fine Tuning API usage'+---++## Create Fine Tuning Job++```python+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++client.fine_tuning.jobs.create(+ training_file="file-abc123",+ model="gpt-3.5-turbo"+)+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/examples/openai/image.mdx b/docs/0.0.4/dokumetry/python/examples/openai/image.mdxnew file mode 100644index 00000000..87df73ea--- /dev/null+++ b/docs/0.0.4/dokumetry/python/examples/openai/image.mdx@@ -0,0 +1,40 @@+---+title: 'Image'+description: 'Monitor OpenAI Image API usage'+---++## Create Image++```python+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++client.images.generate(+ model="dall-e-3",+ prompt="A cute baby sea otter",+ n=1,+ size="1024x1024"+)+```++## Create Image Variation+```python+from openai import OpenAI+import dokumetry++client = OpenAI()++# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++response = client.images.create_variation(+ image=open("image_edit_original.png", "rb"),+ n=2,+ size="1024x1024"+)+```\ No newline at end of filediff --git a/docs/0.0.4/dokumetry/python/intro.mdx b/docs/0.0.4/dokumetry/python/intro.mdxnew file mode 100644index 00000000..7d6c93e3--- /dev/null+++ b/docs/0.0.4/dokumetry/python/intro.mdx@@ -0,0 +1,119 @@+---+title: 'Introduction'+description: 'Monitor your Python LLM Application with DokuMetry'+---++DokuMetry Python SDK is the official library from Doku to send LLM usage data from your Python application to Doku.++## Installation+``` shell shell+pip install dokumetry+```++## Usage++### OpenAI++``` python openai.py+from openai import OpenAI+import dokumetry++client = OpenAI(+ api_key="YOUR_OPENAI_KEY"+)++# Pass the above `client` object along with your Doku URL and API key and this will make sure that all OpenAI calls are automatically tracked.+dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++chat_completion = client.chat.completions.create(+ messages=[+ {+ "role": "user",+ "content": "What is LLM Observability",+ }+ ],+ model="gpt-3.5-turbo",+)+```++The following OpenAI Endpoints are supported for monitoring with DokuMetry++- [Chat completions](/0.0.4/dokumetry/python/examples/openai/chat)+- [Image Create](/0.0.4/dokumetry/python/examples/openai/image#create-image) and [Image Variations](/0.0.4/dokumetry/python/examples/openai/image#create-image-variation)+- [Audio Speech Create](/0.0.4/dokumetry/python/examples/openai/audio)+- [Embeddings](/0.0.4/dokumetry/python/examples/openai/embeddings)+- [Fine Tunings](/0.0.4/dokumetry/python/examples/openai/fine-tuning)+- [Completions](/0.0.4/dokumetry/python/examples/openai/completions)++### Cohere++```python cohere.py+import cohere+import dokumetry++# initialize the Cohere Client with an API Key+co = cohere.Client('YOUR_API_KEY')++# Pass the above `co` object along with your Doku URL and API key and this will make sure that all Cohere calls are automatically tracked.+dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++# generate a prediction for a prompt+prediction = co.chat(message='What is LLM Observability?', model='command')++# print the predicted text+print(f'Chatbot: {prediction.text}')+```++The following Cohere Endpoints are supported for monitoring with DokuMetry++- [Chat](/0.0.4/dokumetry/python/examples/cohere/chat)+- [Generate](/0.0.4/dokumetry/python/examples/cohere/generate)+- [Summarize](/0.0.4/dokumetry/python/examples/cohere/co-summarize)+- [Embed](/0.0.4/dokumetry/python/examples/cohere/embed)++### Anthropic++```python anthropic.py+from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT+import dokumetry++anthropic = Anthropic(+ # defaults to os.environ.get("ANTHROPIC_API_KEY")+ api_key="my api key",+)++# Pass the above `anthropic` object along with your Doku URL and API key and this will make sure that all Anthropic calls are automatically tracked.+dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++completion = anthropic.completions.create(+ model="claude-2",+ max_tokens_to_sample=300,+ prompt=f"{HUMAN_PROMPT} What is LLM Observability?{AI_PROMPT}",+)+print(completion.completion)+```++The following Anthropic Endpoints are supported for monitoring with DokuMetry++- [Completions](/0.0.4/dokumetry/python/examples/anthropic/anthropic-completions.mdx)++## Parameters++| Parameter | Description | Required |+|-------------------|-----------------------------------------------------------|---------------|+| llm | Language Learning Model (LLM) Object to track | Yes |+| doku_url | URL of your Doku Instance | Yes |+| api_key | Your Doku API key | Yes |+| environment | Custom environment tag to include in your metrics | Optional |+| application_name | Custom application name tag for your metrics | Optional |+| skip_resp | Skip response from the Doku Ingester for faster execution | Optional |++## Advanced Usage+When using DokuMetry in Production environments, It is recommened to set `skip_resp = true` for faster porcessing.++To filter your LLM Usage according application or the environment, set the `application` and `environment` paramaters with the actual values.++## Requirements+Python >= 3.7 is supported.++If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).\ No newline at end of filediff --git a/docs/0.0.4/installation.mdx b/docs/0.0.4/installation.mdxnew file mode 100644index 00000000..037db90e--- /dev/null+++ b/docs/0.0.4/installation.mdx@@ -0,0 +1,273 @@+---+title: 'Installing Doku'+description: 'Deploy Doku in your preferred environment'+icon: 'circle-down'+---++Doku flexibly adapts to your preferred environment. Select a deployment method that best fits your setup:++<CardGroup cols={2}>+ <Card+ title="Kubernetes"+ icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <title>Kubernetes</title>+ <path fill="#FFA500" d="M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"/></svg>}+ href="/0.0.4/installation#kubernetes"+ >+ Deploy Doku in a Kubernetes Cluster using Helm+ </Card>+ <Card+ title="Docker"+ icon="docker"+ href="/0.0.4/installation#docker"+ >+ Deploy Doku using docker compose+ </Card>+ <Card+ title="Linux"+ icon="linux"+ href="/0.0.4/installation#linux"+ >+ Deploy Doku in a Linux Host+ </Card>+ <Card+ title="Windows"+ icon="windows"+ href="/0.0.4/installation#windows"+ >+ Deploy Doku in a Windows Host+ </Card>+</CardGroup>++## Kubernetes++Deploy Doku on your Kubernetes cluster using the [Doku Helm chart](https://github.com/dokulabs/helm/tree/main/charts/doku) for a reliable and scalable solution.+<Steps>+ <Step title="Helm Repo Setup">+ ```shell shell+ helm repo add dokulabs https://dokulabs.github.io/helm/+ helm repo update+ ```+ </Step>+ <Step title="Installing the Helm Chart">+ ```shell shell+ helm install doku dokulabs/doku+ ```+ </Step>+</Steps>+<Info>As Doku does not have a built-in visualization UI yet, it is preferred that you set up the observabilityPlatform configuration within the [values.yaml](https://github.com/dokulabs/helm/blob/main/charts/doku/values.yaml) file. Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.</Info>++## Docker+Quickly spin up Doku using Docker for a fast and straightforward setup.++<Steps>+ <Step title="Install TimescaleDB">+ <Steps>+ <Step title="Pull TimescaleDB Image">+ ```shell+ docker pull timescale/timescaledb-ha:pg14-latest+ ```+ </Step>+ <Step title="Run TimescaleDB Image">+ ```shell+ docker run -d --name timescaledb -p 127.0.0.1:5432:5432 \+ -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg14-latest+ ```+ </Step>+ </Steps>+ </Step>+ <Step title="Install Doku">+ <Steps>+ <Step title="Pull Doku Image">+ ```shell+ docker pull ghcr.io/dokulabs/ingester:0.0.4+ ```+ </Step>+ <Step title="Create a Doku Configuration file">+ Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:++ ```yaml doku.yml+ ingesterPort: 9044++ pricingInfo:+ url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file++ # Configuration for the Doku Backend Database (TimescaleDB)+ dbConfig:+ name: DBNAME # Name of the database, Example: "postgres"+ username: USERNAME # Username to connect to the database, Example: "admin"+ password: PASSWORD # Password to connect to the database, Example: "DOKU"+ host: HOSTURL # Hostname of the database, Example: "174.21.1.2"+ port: DBPORT # Port of the database, Example: 5432+ sslMode: SSLMODE # SSL Mode of the database, Example: "require"+ maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15+ maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15+ dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"+ apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"++ observabilityPlatform:+ enabled: false+ ```+ Be sure to replace the placeholder values with your actual database details and desired settings.+ <Info>+ As Doku does not have a built-in visualization UI yet, it is preferred that you set up the observabilityPlatform configuration within the [Doku Configuration file (`doku.yml`)](/0.0.4/configuration#observability-platform-configuration) file.++ Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.+ </Info>+ </Step>+ <Step title="Run the Doku Image">+ ```shell+ docker run -d --name doku -p 127.0.0.1:9044:9044 -v /doku.yml:/doku.yml dokulabs/ingester:0.0.4 --config /doku.yml+ ```+ </Step>+ </Steps>+ </Step>+</Steps>++## Linux+<Steps>+ <Step title="Install TimescaleDB">+ Follow the Instructions [here](https://docs.timescale.com/self-hosted/latest/install/installation-linux/#installing-self-hosted-timescaledb-on-debian-based-systems) to install TimescaleDB in your Linux host.+ </Step>+ <Step title="Create a Doku Configuration file">+ Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:++ ```yaml doku.yml+ ingesterPort: 9044++ pricingInfo:+ url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file++ # Configuration for the Doku Backend Database (TimescaleDB)+ dbConfig:+ name: DBNAME # Name of the database, Example: "postgres"+ username: USERNAME # Username to connect to the database, Example: "admin"+ password: PASSWORD # Password to connect to the database, Example: "DOKU"+ host: HOSTURL # Hostname of the database, Example: "174.21.1.2"+ port: DBPORT # Port of the database, Example: 5432+ sslMode: SSLMODE # SSL Mode of the database, Example: "require"+ maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15+ maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15+ dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"+ apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"++ observabilityPlatform:+ enabled: false+ ```+ Be sure to replace the placeholder values with your actual database details and desired settings.+ <Info>+ As Doku does not have a built-in visualization UI yet, it is preferred that you set up the observabilityPlatform configuration within the [Doku Configuration file (`doku.yml`)](/0.0.4/configuration#observability-platform-configuration) file.++ Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.+ </Info>+ </Step>+ <Step title="Install Doku in a linux Host">+ <Tabs>+ <Tab title="Linux">+ <CodeGroup>+ ```shell amd64+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.4/ingester-linux-amd64+ chmod +x ingester-linux-amd64+ ./ingester-linux-amd64 --config doku.yml+ ```++ ```shell arm64+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.4/ingester-linux-arm64+ chmod +x ingester-linux-arm64+ ./ingester-linux-arm64 --config doku.yml+ ```++ ```shell arm+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.4/ingester-linux-arm+ chmod +x ingester-linux-arm+ ./ingester-linux-arm --config doku.yml+ ```++ ```shell ppc64le+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.4/ingester-linux-ppc64le+ chmod +x ingester-linux-ppc64le+ ./ingester-linux-ppc64le --config doku.yml+ ```+ </CodeGroup>+ </Tab>+ <Tab title="Darwin">+ <CodeGroup>+ ```shell amd64+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.4/ingester-darwin-amd64+ chmod +x ingester-darwin-amd64+ ./ingester-darwin-amd64 --config doku.yml+ ```++ ```shell arm64+ curl -O -L https://github.com/dokulabs/ingester/releases/download/0.0.4/ingester-darwin-arm64+ chmod +x ingester-darwin-arm64+ ./ingester-darwin-arm64 --config doku.yml+ ```+ </CodeGroup>+ </Tab>+ </Tabs>+ </Step>+</Steps>++## Windows+<Steps>+ <Step title="Install TimescaleDB">+ <Steps>+ Download and install the Visual C++ Redistributable for Visual Studio from [www.microsoft.com](https://www.microsoft.com/en-us/download/details.aspx?id=48145).++ Download and install PostgreSQL from [www.postgresql.org](https://www.postgresql.org/download/windows/). You might need to add the `pg_config` file location to your path. In the Windows Search tool, search for `system environment variables`. The path should be `C:\Program Files\PostgreSQL\<version>\bin`.++ Download the TimescaleDB installation `.zip` file from [Windows releases](https://docs.timescale.com/self-hosted/latest/install/installation-windows/#windows-releases).++ Locate the downloaded file on your local file system, and extract the files.++ In the extracted TimescaleDB directory, right-click the `setup.exe` file and select `Run as Administrator` to start the installer.+ </Steps>+ </Step>+ <Step title="Create a Doku Configuration file">+ Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:++ ```yaml doku.yml+ ingesterPort: 9044++ pricingInfo:+ url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file++ # Configuration for the Doku Backend Database (TimescaleDB)+ dbConfig:+ name: DBNAME # Name of the database, Example: "postgres"+ username: USERNAME # Username to connect to the database, Example: "admin"+ password: PASSWORD # Password to connect to the database, Example: "DOKU"+ host: HOSTURL # Hostname of the database, Example: "174.21.1.2"+ port: DBPORT # Port of the database, Example: 5432+ sslMode: SSLMODE # SSL Mode of the database, Example: "require"+ maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15+ maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15+ dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"+ apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"++ observabilityPlatform:+ enabled: false+ ```+ Be sure to replace the placeholder values with your actual database details and desired settings.+ <Info>+ As Doku does not have a built-in visualization UI yet, it is preferred that you set up the observabilityPlatform configuration within the [Doku Configuration file (`doku.yml`)](/0.0.4/configuration#observability-platform-configuration) file.++ Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.+ </Info>+ </Step>+ <Step title="Install Doku in a Windows Host">+ <CodeGroup>+ ```shell amd64+ invoke-WebRequest -Uri "https://github.com/dokulabs/ingester/releases/download/0.0.4/ingester-windows-amd64" -OutFile "ingester.exe"+ .\ingester.exe --config doku.yml+ ```++ ```shell 386+ invoke-WebRequest -Uri "https://github.com/dokulabs/ingester/releases/download/0.0.4/ingester-windows-386" -OutFile "ingester.exe"+ .\ingester.exe --config doku.yml+ ```+ </CodeGroup>+ </Step>+</Steps>+diff --git a/docs/0.0.4/integrations/datadog.mdx b/docs/0.0.4/integrations/datadog.mdxnew file mode 100644index 00000000..92dffa4f--- /dev/null+++ b/docs/0.0.4/integrations/datadog.mdx@@ -0,0 +1,17 @@+---+title: 'DataDog'+description: 'Connect Doku to DataDog'+---++Doku can automatically send LLM usage data from Doku to DataDog using the [Submit Metrics API](https://docs.datadoghq.com/api/latest/metrics/#submit-metrics) and [Send Logs API](https://docs.datadoghq.com/api/latest/logs/#send-logs)++Add the following to your doku configuration file(`doku.yml`).++```yaml doku.yml+observabilityPlatform:+ enabled: true # Enable or Disable the Observability Platform, Example: true+ datadog:+ metricsUrl: <your-datadog-metrics-url> # URL to the DataDog Metrics API+ logsUrl: <your-datadog-logs-url> # URL to the DataDog Logs API+ apiKey: <your-datadog-api-key> # API Key of the DataDog Account+```\ No newline at end of filediff --git a/docs/0.0.4/integrations/grafanacloud.mdx b/docs/0.0.4/integrations/grafanacloud.mdxnew file mode 100644index 00000000..4d76f39c--- /dev/null+++ b/docs/0.0.4/integrations/grafanacloud.mdx@@ -0,0 +1,19 @@+---+title: 'Grafana Cloud'+description: 'Connect Doku to Grafana Cloud'+---++Doku can automatically send LLM usage data from Doku to Grafana Cloud using the [Grafana Cloud Influx Telegraf](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-influxdb/push-from-telegraf/) and [Loki Push HTTP API](https://grafana.com/docs/loki/latest/reference/api/#push-log-entries-to-loki)++Add the following to your doku configuration file(`doku.yml`).++```yaml doku.yml+observabilityPlatform:+ enabled: true # Enable or Disable the Observability Platform, Example: true+ grafanaCloud:+ promUrl: <your-grafana-cloud-influx-line-proxy-url> # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance+ promUsername: <your-prometheus-userid> # Prometheus User ID of the Grafana Cloud Prometheus Instance+ lokiUrl: <your-loki-push-url> # URL to the Loki Push URL of the Grafana Cloud Loki Instance+ lokiUsername: <your-loki-username> # Loki Username of the Grafana Cloud Loki Instance+ accessToken: <your-grafana-cloud-access-token> # Access Token of the Grafana Cloud Instance+```\ No newline at end of filediff --git a/docs/0.0.4/integrations/intro.mdx b/docs/0.0.4/integrations/intro.mdxnew file mode 100644index 00000000..8688032f--- /dev/null+++ b/docs/0.0.4/integrations/intro.mdx@@ -0,0 +1,19 @@+---+title: 'Introduction'+description: 'Connect to your existing Observablity Platform'+---++Doku streamlines the observability experience by delivering processed LLM data right to the observability platform you are already familiar with. We recognize how crucial it is for developers to aggregate all application-related data, encompassing LLM usage metrics, into a single source of truth.++This integration allows you to visualize and assess your entire application landscape in one integrated Observability platform, thereby refining your monitoring approaches and sharpening your decision-making.++Below is a list of observability platforms that work seamlessly with Doku, allowing for integrated and expanded insights.++<CardGroup cols={3}>+ <Card title="Grafana Cloud" href="/0.0.4/integrations/grafanacloud" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>+ </Card>+ <Card title="DataDog" href="/0.0.4/integrations/datadog" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Datadog</title><path d="M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"/></svg>}>+ </Card>+ <Card title="New Relic" href="/0.0.4/integrations/new-relic" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>New Relic</title><path d="M8.0015 14.3091v7.384L12.0008 24V12.0008L1.6078 5.9996v4.6167ZM12.0008 0 2.8232 5.2976 6.8209 7.606l5.1799-2.9893 6.3936 3.6913v7.384l-5.1783 2.9908v4.6167l9.176-5.2991V5.9996Z"/></svg>}>+ </Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.0.4/integrations/new-relic.mdx b/docs/0.0.4/integrations/new-relic.mdxnew file mode 100644index 00000000..391c8b9c--- /dev/null+++ b/docs/0.0.4/integrations/new-relic.mdx@@ -0,0 +1,17 @@+---+title: 'New Relic'+description: 'Connect Doku to New Relic'+---++Doku can automatically send LLM usage data from Doku to New Relic using the [Report Metrics HTTP API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/report-metrics-metric-api/) and [Send Logs API](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api/)++Add the following to your doku configuration file(`doku.yml`).++```yaml doku.yml+observabilityPlatform:+ enabled: true # Enable or Disable the Observability Platform, Example: true+ newRelic:+ metricsUrl: <your-new-relic-metrics-url> # URL to the New Relic Metric API+ logsUrl: <your-new-relic-logs-url> # URL to the New Relic Log API+ key: <your-new-relic-api-key> # Ingest API Key of the New Relic Account+```\ No newline at end of filediff --git a/docs/0.0.4/introduction.mdx b/docs/0.0.4/introduction.mdxnew file mode 100644index 00000000..502c32ec--- /dev/null+++ b/docs/0.0.4/introduction.mdx@@ -0,0 +1,71 @@+---+title: What is Doku?+description: 'Monitor and evalute your LLM Applications'+---++Doku is an open-source observability tool engineered for Large Language Models (LLMs). Designed for ease of integration into existing LLM applications, Doku offers unparalleled insights into usage, performance, and overhead—allowing you to analyze, optimize, and scale your AI applications and LLM usage effectively.++Whether you're working with OpenAI, Cohere, or Anthropic, It tracks all your LLM requests transparently and conveys the insights needed to make data-driven decisions. From monitoring usage and understanding latencies to managing costs and collaborating effortlessly, Doku grants you the lens to view your models in high definition.++## How it works++<Frame>+ <img src="https://raw.githubusercontent.com/dokulabs/.github/main/profile/assets/banner.gif" />+</Frame>+### Application Integration with Two Lines of Code+Start by incorporating the DokuMetry SDK into your application. With SDKs tailored for both Python and NodeJS, Doku fits into your tech stack with minimal changes. Just a **two lines** of code is all it takes to begin:++For Python and NodeJS projects, just import the DokuMetry SDK and initialize it as follows:+ <CodeGroup>+ ```python python+ import dokumetry+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")+ ```++ ```javascript NodeJS+ import DokuMetry from 'dokumetry';+ DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})+ ```+ </CodeGroup>+Find detailed instructions at the [DokuMetry SDK Documentation](/0.0.4/dokumetry/introduction).++### The Doku Ingester: Your Data Processing Workhorse++Upon SDK setup, data from your LLM operations is automatically collected. The DokuMetry SDKs transmit this usage data over HTTP in the background to the [Doku Ingester](https://github.com/dokulabs/ingester/).++The ingester is the core engine where the magic happens:+- **Data Collection**: Effortlessly captures live data from your LLM interactions without complicating your existing codebase.+- **Cost Analysis**: Enriches your data with cost considerations, providing a financial perspective to your analytics.+- **Secure Storage**: All processed information is securely stored in TimescaleDB, providing you with a scalable, time-series database that can handle large volumes of observability data.++You have the choice to set up a fresh TimescaleDB instance or connect Doku to your existing one. Whichever path you choose, your data resides within your control, reinforcing your data security and operational compliance.++## Features+Leveraging Doku, you can get:++- **In-depth LLM Monitoring**: Track every request to LLM platforms like OpenAI with precision, ensuring comprehensive visibility over your model's interactions.+- **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.+- **Connect to Observability Platforms**: Export LLM Observablity data and insights from Doku to popular observability platforms such as Grafana Cloud or Datadog.+- **Team-centric Workflow**: Enhance team collaboration with seamless data sharing capabilities, creating an integrated environment for observability-driven teamwork.++## Supported LLM Platforms+<CardGroup cols={3}>+<Card title="OpenAI">+</Card>+<Card title="Cohere">+</Card>+<Card title="Anthropic">+</Card>+</CardGroup>++## Getting Started+Select from the following guides to learn more about how to use Doku:++<CardGroup cols={2}>+<Card title="Quickstart" href="/0.0.4/quickstart" icon='bolt'>+Get Started with monitoring your LLM Applications in 3 simple steps+</Card>+<Card title="Integrations" href="/0.0.4/integrations/intro" icon='connectdevelop'>+Connect to your existing Observablity Platform+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.0.4/quickstart.mdx b/docs/0.0.4/quickstart.mdxnew file mode 100644index 00000000..f7cb08f7--- /dev/null+++ b/docs/0.0.4/quickstart.mdx@@ -0,0 +1,150 @@+---+title: 'Quickstart'+description: 'Quickly start **monitoring** your **LLM Applications** in just **two lines** of code'+icon: 'bolt'+---++This guide will walk you through setting up your monitoring system with minimal effort. In just a few steps, you'll be able to track and analyze the performance and usage of your Large Language Model (LLM) applications.++## Prerequistes+- Ensure you have access to a **Kubernetes Cluster**. You can quickly spin up a Kubernetes Cluster using [Kind](https://github.com/kubernetes-sigs/kind?tab=readme-ov-file#installation-and-usage)++## Get Started++<Steps>+ <Step title="Install Doku in a Kubernetes Cluster">+ <Steps>+ <Step title="Helm Repo Setup">+ ```shell shell+ helm repo add dokulabs https://dokulabs.github.io/helm/+ helm repo update+ ```+ </Step>+ <Step title="Installing the Helm Chart">+ ```shell shell+ helm install doku dokulabs/doku+ ```+ </Step>+ </Steps>+ </Step>+ <Step title="Generate an API Key">+ With Doku running, the next step is to [generate an API key](/0.0.4/api-reference/endpoint/api-keys/create) for secure communication between your applications and Doku.++ To generate your first API key, you can use the following command:++ ```shell shell+ curl --request POST \+ --url https://<your-doku-url>/api/keys \+ --header 'Authorization: ""' \+ --header 'Content-Type: application/json' \+ --data '{+ "name": "Admin"+ }'+ ```++ Make sure to store the returned API key securely, as it's necessary for authorizing future API calls with Doku.++ <Info>+ During your initial request to generate an API key, you can leave the Authorization header empty (i.e., `""`). For subsequent requests, you will need to supply the generated API key.+ </Info>++ </Step>+ <Step title="Instrument your code">+ Choose the appropriate SDK for your application's programming language and follow the steps to integrate monitoring with just a couple of lines of code.+ <Tabs>+ <Tab title="Python">+ <Steps>+ <Step title="Install the dokumetry Python SDK using pip">+ ```shell+ pip install dokumetry+ ```+ </Step>+ <Step title="Add the following two lines to your application code:">+ Add the snippet below to your Python application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.++ ```python+ import dokumetry++ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")+ ```++ Example Usage for monitoring `OpenAI` Usage:++ ```python+ from openai import OpenAI+ import dokumetry++ client = OpenAI(+ api_key="YOUR_OPENAI_KEY"+ )++ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")++ chat_completion = client.chat.completions.create(+ messages=[+ {+ "role": "user",+ "content": "What is LLM Observability",+ }+ ],+ model="gpt-3.5-turbo",+ )+ ```++ Refer to the `dokumetry` [Python SDK repository](https://github.com/dokulabs/dokumetry-python) or the [DokuMetry Docs](/0.0.4/dokumetry/python/intro) for more advanced configurations and use cases.+ </Step>+ </Steps>+ </Tab>+ <Tab title="NodeJS">+ <Steps>+ <Step title="Install the dokumetry NodeJS SDK using npm">+ ```shell+ npm install dokumetry+ ```+ </Step>+ <Step title="Add the following two lines to your application code">+ Add the snippet below to your NodeJS application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.+ ```javascript+ import DokuMetry from 'dokumetry';++ DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})+ ```++ Example Usage for monitoring `OpenAI` Usage:++ ```javascript+ import OpenAI from 'openai';+ import DokuMetry from 'dokumetry';++ const openai = new OpenAI({+ apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]+ });++ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: openai, dokuURL: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const chatCompletion = await openai.chat.completions.create({+ messages: [{ role: 'user', content: 'What are the key to effective observability?' }],+ model: 'gpt-3.5-turbo',+ });+ }++ main();+ ```++ Refer to the `dokumetry` [NodeJS SDK repository](https://github.com/dokulabs/dokumetry-node) or the [DokuMetry Docs](/0.0.4/dokumetry/node/introduction) for more advanced configurations and use cases.+ </Step>+ </Steps>+ </Tab>+ </Tabs>+ </Step>+</Steps>++## (Optional) Export Data+<Card title="Integrations" href="/0.0.4/integrations/intro" icon='connectdevelop'>+Connect to your existing Observablity Platform+</Card>++You're all set! Following these steps should have you on your way to effectively monitoring your LLM applications. If you have any questions or need support, reach out to our [community](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA).\ No newline at end of filediff --git a/docs/README.md b/docs/README.mdnew file mode 100644index 00000000..c89c478d--- /dev/null+++ b/docs/README.md@@ -0,0 +1,32 @@+# Mintlify Starter Kit++Click on `Use this template` to copy the Mintlify starter kit. The starter kit contains examples including++- Guide pages+- Navigation+- Customizations+- API Reference pages+- Use of popular components++### Development++Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command++```+npm i -g mintlify+```++Run the following command at the root of your documentation (where mint.json is)++```+mintlify dev+```++### Publishing Changes++Install our Github App to autopropagate changes from youre repo to your deployment. Changes will be deployed to production automatically after pushing to the default branch. Find the link to install on your dashboard.++#### Troubleshooting++- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies.+- Page loads as a 404 - Make sure you are running in a folder with `mint.json`diff --git a/docs/favicon.png b/docs/favicon.pngnew file mode 100644index 00000000..52424074Binary files /dev/null and b/docs/favicon.png differdiff --git a/docs/logo/dark.png b/docs/logo/dark.pngnew file mode 100644index 00000000..7e16d176Binary files /dev/null and b/docs/logo/dark.png differdiff --git a/docs/logo/light.png b/docs/logo/light.pngnew file mode 100644index 00000000..8a915e61Binary files /dev/null and b/docs/logo/light.png differdiff --git a/docs/mint.json b/docs/mint.jsonnew file mode 100644index 00000000..f72b5184--- /dev/null+++ b/docs/mint.json@@ -0,0 +1,310 @@+{+ "$schema": "https://mintlify.com/schema.json",+ "versions": ["0.0.4", "0.0.3"],+ "name": "Doku",+ "logo": {+ "dark": "/logo/dark.png",+ "light": "/logo/light.png"+ },+ "favicon": "favicon.png",+ "colors": {+ "primary": "#FFA500",+ "light": "#FFA500",+ "dark": "#FFA500",+ "anchors": {+ "from": "#FFA500",+ "to": "#FFA500"+ }+ },+ "topbarLinks": [+ {+ "name": "Contact Us",+ "url": "mailto:[email protected]"+ }+ ],+ "modeToggle": {+ "default": "dark"+ },+ "feedback": {+ "thumbsRating": true,+ "suggestEdit": true+ },+ "anchors": [+ {+ "name": "Community",+ "icon": "slack",+ "url": "https://dokulabs.slack.com"+ },+ {+ "name": "GitHub",+ "icon": "github",+ "url": "https://github.com/dokulabs/"+ }+ ],+ "navigation": [+ {+ "group": "Get Started",+ "pages": [+ "0.0.4/introduction",+ "0.0.4/quickstart",+ "0.0.4/installation",+ "0.0.4/configuration"+ ],+ "version": "0.0.4"+ },+ {+ "group": "DokuMetry",+ "version": "0.0.4",+ "pages": [+ "0.0.4/dokumetry/introduction",+ {+ "group": "Python",+ "version": "0.0.4",+ "icon": "python",+ "pages": [+ "0.0.4/dokumetry/python/intro",+ {+ "group": "Examples",+ "version": "0.0.4",+ "pages": [+ {+ "group": "OpenAI",+ "version": "0.0.4",+ "pages": [+ "0.0.4/dokumetry/python/examples/openai/chat",+ "0.0.4/dokumetry/python/examples/openai/image",+ "0.0.4/dokumetry/python/examples/openai/embeddings",+ "0.0.4/dokumetry/python/examples/openai/audio",+ "0.0.4/dokumetry/python/examples/openai/fine-tuning",+ "0.0.4/dokumetry/python/examples/openai/completions"+ ]+ },+ {+ "group": "Cohere",+ "version": "0.0.4",+ "pages": [+ "0.0.4/dokumetry/python/examples/cohere/chat",+ "0.0.4/dokumetry/python/examples/cohere/generate",+ "0.0.4/dokumetry/python/examples/cohere/co-summarize",+ "0.0.4/dokumetry/python/examples/cohere/embed"+ ]+ },+ {+ "group": "Anthropic",+ "version": "0.0.4",+ "pages": [+ "0.0.4/dokumetry/python/examples/anthropic/anthropic-completions"+ ]+ }+ ]+ }+ ]+ },+ {+ "group": "NodeJS",+ "version": "0.0.4",+ "icon": "node-js",+ "pages": [+ "0.0.4/dokumetry/node/introduction",+ {+ "group": "Examples",+ "version": "0.0.4",+ "pages": [+ {+ "group": "OpenAI",+ "version": "0.0.4",+ "pages": [+ "0.0.4/dokumetry/node/examples/openai/chat",+ "0.0.4/dokumetry/node/examples/openai/image",+ "0.0.4/dokumetry/node/examples/openai/embeddings",+ "0.0.4/dokumetry/node/examples/openai/audio",+ "0.0.4/dokumetry/node/examples/openai/fine-tuning",+ "0.0.4/dokumetry/node/examples/openai/chatCompletions"+ ]+ },+ {+ "group": "Cohere",+ "version": "0.0.4",+ "pages": [+ "0.0.4/dokumetry/node/examples/cohere/chat",+ "0.0.4/dokumetry/node/examples/cohere/generate",+ "0.0.4/dokumetry/node/examples/cohere/summarize",+ "0.0.4/dokumetry/node/examples/cohere/embed"+ ]+ },+ {+ "group": "Anthropic",+ "version": "0.0.4",+ "pages": [+ "0.0.4/dokumetry/node/examples/anthropic/anthropic-completions"+ ]+ }+ ]+ }+ ]+ }+ ]+ },+ {+ "group": "Integrations",+ "pages": [+ "0.0.4/integrations/intro",+ "0.0.4/integrations/grafanacloud",+ "0.0.4/integrations/datadog",+ "0.0.4/integrations/new-relic"+ ],+ "version": "0.0.4"+ },+ {+ "group": "API Reference",+ "pages": [+ "0.0.4/api-reference/introduction",+ {+ "group": "API Keys",+ "icon": "key",+ "pages": [+ "0.0.4/api-reference/endpoint/api-keys/create",+ "0.0.4/api-reference/endpoint/api-keys/get",+ "0.0.4/api-reference/endpoint/api-keys/delete"+ ],+ "version": "0.0.4"+ }+ ],+ "version": "0.0.4"+ },+ {+ "group": "Get Started",+ "pages": [+ "0.0.3/introduction",+ "0.0.3/quickstart",+ "0.0.3/installation",+ "0.0.3/configuration"+ ],+ "version": "0.0.3"+ },+ {+ "group": "DokuMetry",+ "version": "0.0.3",+ "pages": [+ "0.0.3/dokumetry/introduction",+ {+ "group": "Python",+ "version": "0.0.3",+ "icon": "python",+ "pages": [+ "0.0.3/dokumetry/python/intro",+ {+ "group": "Examples",+ "version": "0.0.3",+ "pages": [+ {+ "group": "OpenAI",+ "version": "0.0.3",+ "pages": [+ "0.0.3/dokumetry/python/examples/openai/chat",+ "0.0.3/dokumetry/python/examples/openai/image",+ "0.0.3/dokumetry/python/examples/openai/embeddings",+ "0.0.3/dokumetry/python/examples/openai/audio",+ "0.0.3/dokumetry/python/examples/openai/fine-tuning",+ "0.0.3/dokumetry/python/examples/openai/chatCompletions"+ ]+ },+ {+ "group": "Cohere",+ "version": "0.0.3",+ "pages": [+ "0.0.3/dokumetry/python/examples/cohere/chat",+ "0.0.3/dokumetry/python/examples/cohere/generate",+ "0.0.3/dokumetry/python/examples/cohere/summarize",+ "0.0.3/dokumetry/python/examples/cohere/embed"+ ]+ },+ {+ "group": "Anthropic",+ "version": "0.0.3",+ "pages": [+ "0.0.3/dokumetry/python/examples/anthropic/completions"+ ]+ }+ ]+ }+ ]+ },+ {+ "group": "NodeJS",+ "version": "0.0.3",+ "icon": "node-js",+ "pages": [+ "0.0.3/dokumetry/node/introduction",+ {+ "group": "Examples",+ "version": "0.0.3",+ "pages": [+ {+ "group": "OpenAI",+ "version": "0.0.3",+ "pages": [+ "0.0.3/dokumetry/node/examples/openai/chat",+ "0.0.3/dokumetry/node/examples/openai/image",+ "0.0.3/dokumetry/node/examples/openai/embeddings",+ "0.0.3/dokumetry/node/examples/openai/audio",+ "0.0.3/dokumetry/node/examples/openai/fine-tuning",+ "0.0.3/dokumetry/node/examples/openai/completions"+ ]+ },+ {+ "group": "Cohere",+ "version": "0.0.3",+ "pages": [+ "0.0.3/dokumetry/node/examples/cohere/chat",+ "0.0.3/dokumetry/node/examples/cohere/generate",+ "0.0.3/dokumetry/node/examples/cohere/summarize",+ "0.0.3/dokumetry/node/examples/cohere/co-embed"+ ]+ },+ {+ "group": "Anthropic",+ "version": "0.0.3",+ "pages": [+ "0.0.3/dokumetry/node/examples/anthropic/completions"+ ]+ }+ ]+ }+ ]+ }+ ]+ },+ {+ "group": "Integrations",+ "pages": [+ "0.0.3/integrations/introduction",+ "0.0.3/integrations/grafanacloud",+ "0.0.3/integrations/datadog",+ "0.0.3/integrations/new-relic"+ ],+ "version": "0.0.3"+ },+ {+ "group": "API Reference",+ "pages": [+ "0.0.3/api-reference/introduction",+ {+ "group": "API Keys",+ "icon": "key",+ "pages": [+ "0.0.3/api-reference/endpoint/api-keys/create",+ "0.0.3/api-reference/endpoint/api-keys/get",+ "0.0.3/api-reference/endpoint/api-keys/delete"+ ],+ "version": "0.0.3"+ }+ ],+ "version": "0.0.3"+ }+ ],+ "footerSocials": {+ "github": "https://github.com/dokulabs/",+ "slack": "https://dokulabs.slack.com"+ }+}