Comments (15)
My thoughts exactly.
If someone wants to tackle this.
Suggested Implementation:
- ALL API calls should be centralised through a single method that counts tokens and adds to a dollar amount based on the model used.
- Store this in its own file and remove openai imports from everywhere else so that the API can't be called accidentally.
Displaying
- Total dollar amount spent should be constantly displayed to the user.
- Total dollar amount spent could be displayed to the AI. Perhaps it could even be given a budget, and the dollar amount would count down as it spends money. This could create a sense of urgency in a HustleGPT style task.
If you'd like to work on this (please do!), assign it to yourself so we don't both work on the same thing.
from auto-gpt.
could use this?
https://github.com/openai/tiktoken
from auto-gpt.
I can pick this, but first, I'll spend a little time on #4 .
from auto-gpt.
I'll submit a pull request later tonight.
I'm very close, now. Auto-GPT is beginning to behave with the appropriate behavior of hurrying up when the budget is nearly depleted, and shutting itself down when the budget is exceeded.
Too tired to finish this tonight, though. I'll give another update tomorrow night.
from auto-gpt.
Woohoo, it's merged in! 🎉
@rob-luke would you be interested in tackling the final task of making the total running cost visible to the user?
See #762 (comment)
from auto-gpt.
I agree with all @Torantulino's ideas here. In that case, it might be a reason to use a real TUI instead of a simple set of print statements for this application. It could have a top-bar that contains running price for example.
I'd also make a flag in the cli that allows for rate limiting the application: Sleep 10 seconds between requests, for example. Some tasks the AI may be given may not require frequent polling. For example I'm using the bot for research, and notifications of major news events. Major news event searching may only need the bot to check the internet every day. This polling frequency option will be critical for giving some applications amazing speed, and others sort of dumb infrequent inexpensive speed.
from auto-gpt.
I'm going to start work on this now, @Torantulino . please assign this to me so others don't work on the same issue.
I'll start with a fresh fork.
from auto-gpt.
@Vwing shoot me a DM on the discord :)
from auto-gpt.
Thanks for tackling this issue @Vwing.
I would be pleased to add the feature of making the running costs visible to the user, I can get that done this week. But if someone else starts to tackle it first, let me know so we don't duplicate work 🚀
from auto-gpt.
hey @0xcha05 are you currently working on this issue?
from auto-gpt.
I went ahead and implemented this in my own fork (branch "running_cost"). I'll submit a pull request later tonight.
Here it is in action, but also an example of it not working quite right.
I think I'll prompt engineer it a bit before submitting the pull request. I find that it works better if I send its remaining budget in the system message context, and yell at it if it goes over budget
create_chat_message(
"system", f"Your remaining budget is ${remaining_budget:.3f}" + (" BUDGET EXCEEDED! SHUT DOWN." if remaining_budget < 0 else "")),
from auto-gpt.
Okay! It's working, now. It prints the running cost, the AI is aware of the running cost, and the user can optionally provide a budget (of which the AI is also aware, and behaves appropriately).
Please refer to my pull request. #762
from auto-gpt.
Fixed in #762
from auto-gpt.
@Pwuts The final aspect of the initial problem description is addressed in #3313 which isn't merged yet.
from auto-gpt.
has anybody thought about exposing this in a shell prompt-style manner at runtime, per agent (task/job) ?
from auto-gpt.
Related Issues (20)
- Poetry install failed, Onnxruntime failed HOT 8
- Port `autogpt.file_storage` functionality from AutoGPT to Forge
- Error installing dependencies HOT 4
- auto code
- Docker image not optimized for native [mac] ARM
- Command web_search returned an error with docker HOT 5
- AutoGPT Misinterprets "429 Too Many Requests" Error as Rate Limiting Instead of Insufficient API Quota HOT 2
- We are bubbling up the full response. Revisit this.
- Evaluate against the SWE-bench benchmark HOT 2
- Security advisory link broken
- github ConnectTimeoutError HOT 1
- the deletion of $ENV_PATH in autogpts/forge/setup script might fail the launching of an agent HOT 1
- use proxy for selenium
- using different duckduckgo backend
- Auto
- Multidict dependency does nor compile on MacOS Sonoma 14.4.1 after "./run agent start [AGENTNAME] HOT 7
- Image slider
- Sign in with Google error (" 400: redirect_uri_mismatch".) (also with Github sign in)
- Keyboard shortcut for 'Send a single message'
- Unable to install on mac (Poetry Issue, Old Bug Fixes did not work) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-gpt.