Trados AI Monitor
I’ve spoken a lot about AI and using it as a tool that can help you do things that were well outside of your current technical ability. I’ve also built some small things, some big things… I’ve shared some on github and some I just use myself on my personal computer. But after seeing a few requests for things here and there in the RWS Community I thought I’d have a go at building a bit more. One of these efforts I’ve had a go at is an application called “Trados AI Monitor” and I was motivated to create it after seeing many requests in the community around token usage when working with the OpenAI plugin from the RWS AppStore… and possibly other apps that also use the OpenAI APIs. I also used this as the trigger to publish something I’ve been building in the last few weeks to help share some of the things I’ve been working on in a more managed way… and also because I was interested in seeing if I could do some other things such as:
- build a licensing system
- provide support for anything I built
- … and many more things that cropped up as I started this!
So first of all I’ll mention the new link you’ll see in my top menu called L1oN-X. This is my Localization Exchange page where I’ve built a small appstore like feature to share stuff and where you’ll find the Trados AI Monitor to give it a whirl if you’re interested. There’s a fairly reasonable description of this application in the L10N-X so I’ll keep this article brief and just provide a rough explanation of what it’s intended to do, and then share a video of how it works in practice.
Contents
Trados AI Monitor
Whilst I’ve seen many posts asking about token usage and how OpenAI calculates stuff, it was this post from Yulia and the final comment from Jens that made me rethink the response I initially gave, which was to use Fiddler. It’s a very good tool, we use it at work, and it is excellent for debugging and seeing what requests and responses are being sent as network traffic between any application on your computer and whatever you’re connected to. I normally point people towards this tool, as we also have a simple article explaining how to use it in a very basic way. But, the old days when we had a free version of this, and it was readily available are nearly gone. I think you might be able to find the free version… not sure… but even if you can it’s really not that straight forward to use at first glance.
So I wondered if I could build one now that I have a tool available to me whose knowledge seems to have no limits when it comes to software development. Turns out I can… or at least it seems to do everything I have tried to make it do!! Here’s a few bullets of what I have tried to include:
Core Functionality
- Intercepts OpenAI API calls from Trados Studio in real-time, so you can see exactly what’s being sent and received
- Tracks token usage and calculates costs automatically based on the specific model being used (GPT-4, GPT-3.5, etc.)
- Stores every API call in a local SQLite database for historical analysis and auditing
- Displays live statistics showing total tokens, costs, and call counts as you navigate through your segments
User-Friendly Features
- Split-pane interface showing call list and detailed JSON request/response data
- Excel export for sharing usage reports with clients or management
- Editable reference fields so you can annotate calls with project names or notes
- “Explain” feature that uses OpenAI’s API to generate plain explanations of what each call did and why tokens were used
- Editable pricing table – adjust model costs to match your actual rates or OpenAI’s latest pricing
Attempted Corporate & IT Benefits
- Attempts to preserve existing proxy configurations (PAC (Proxy Auto-Configuration) files, bypass lists) rather than wiping them out – to be honest this feature needs more thorough testing than I can give it!
- Robust crash protection with watchdog process (a monitoring mechanism that ensures the PAC file remains available) that restores system settings if anything goes wrong – I tried to mirror some of the concepts that tools like Fiddler uses
- Added some code to try and handle certificate and firewall prompts properly – also needs more testing than I can give it
Built on Solid Foundations
- Multi-language support across 12 languages including RTL support for Arabic/Hebrew – all languages will need checking (hoping for feedback!!)… probably the English too!
- Modern, accessible UI with gradient styling
- Ed25519 cryptographic licensing system
- Self-contained deployment – no separate runtime installation needed (makes it a little larger than it could be but I wanted to avoid .NET version problems)
The application has been built to essentially gives translators, localization engineers and project managers complete transparency into Open AI use without needing technical tools like Fiddler. It also took me one weekend and a couple of early mornings to build it which (based on my limited experience) feels like fairly good going even for an experienced developer who really knows what they’re doing!
The app is free, I will support anyone who gives it a go (support them with this application) as I’d like it to at least become a useful application… and I’ll tell you now about the security warnings you’ll see on installation if you do try it, because I’m not going to pay for a commercial code-signing certificate – https://multifarious.filkin.com/installation-security/
In practice…
I created this video to run through the features and hope it sparks enough interest for some feedback… and of course I also hope it’s at least as useful in practice as it was a learning experience for me.
Duration: 27 mins 17 seconds