-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paperless-ai making continuouesly Openai requests ? #31
Comments
https://platform.openai.com/settings/organization/usage/activity Can you share a screenshot of you activity dashboard? The gpt-4o-mini costs are low so I dont see constant usage. |
Oh true, I see I defined gpt-4 instead of gpt-4o-mini, that should be fixed later. So let me break this up a bit where and when requests are sent to OpenAI API.
Thats about it. Maybe you container restarts all the time (error based)? |
I let the Container Run again for about 5 minutes and it made over 10 requests without Processing any documents. |
what is your SCAN_INTERVAL setting in the .env file in /app/data folder? |
How many tokens are used since then? for gpt-4o-mini? |
I really can not reproduce this behaviour. Also you are the first one with that issue. Really strange.... |
Maybe so much documents? |
Had the same issue, except that i realised, that it isn't using mini anymore. And yes, it looks like that gpt-4o is much more expensive. Btw. this would be a good hint for the documentation for the setup to check the prices, while different models costs different prices. |
@ChiliChonka but do you have the same thing that it constantly requests to OpenAI? |
By program code it is not possible that it does this without constantly new documents or without restarting the container every second. I repeat the parts where it pulls the API:
|
I have multiple requests, yes. But I cannot say exactly, what is the cause, while my health check fails many times and the container restarts. I will investigate as soon as I have a bit more time. Currently cooking for my family. Will be back in 4 hours. |
i thing i finally got it. it's the health check. does that make sense? is there any possibility in the code that there is a request in the health check? edit: looked at setupService.js myselft and if i read the code correctly, the test request is send to openai every health check? also, its send via model: "gpt-4",, which explains why i got so many gpt4 request (and not gpt4o-mini) my screenshot from yesterday shows 2000+ requests with gpt4o-mini because in the previous image the test was send with gpt-4o-mini (before this commit |
The docker itself is checking the healthy state of your container. I thought about the health check again, while it's checking /health I would say, if it is in the setup mode, the container is healthy and shouldn't fail on healthiness check. This is one thing. I'm not sure if it is also having an unhealthy state, if paperless ngx API is not responding correctly, which could lead to those issues as well. Does it also check for paperless ngx? |
i'm talking of this health check:
it's an endpoint of the application to check openai-requests, paperless-api responding and so on... |
Yeah that make sense, I already discovered that. Not long and I push an update. There are against my expaction really more OpenAI requests than I thought. There is a request everytime the cron routine fires. I mean that is not much of a problem unless you run the cron timer every minute. But unnecessary it is indeed, even every 1 hour for example. |
That's what docker is using to check the healthiness. if I didn't get it wrong, it's checking different things to tell the healthcheck, that everything's works as expected or not. We're talking about the same stuff... |
@clusterzx what is your idea/solution? |
Should be fixed with 3ef1bca |
Am I seeing it right, that you removed the healthcheck now? Any plans to put it back at some points with another implementation for the healthiness check? |
Yeah but only temporary. Main focus was to get rid of these other issues. The healthcheck will be reimplemented soon 😅 |
That's legit. You're doing a great job. |
Thank you doing what I can. |
Don't be worried about that. As i've mentioned i'm quite far with the first implementation. |
Addressing Fixes and new Features: Fixes: #66 #61 #58 #55 #53 #45 #59 #52 #49 #31 #37 #52 Added: - Big New Feature: Playground - Try your prompts on your documents and see how they perform. In Playground no data will be updated in Paperless. - Added Code and Markdown interpretation in Chat Mode. - Chat Mode now works with Ollama
I Just noticed heavy use of my Openai API Key just for today. I updated to latest Image this morning. No new documents.
When i stop the Container, the requests stop. Paperless-ai is the only application using the API Key. How can this be related ?
The text was updated successfully, but these errors were encountered: