[Feature Request]: Leverage prompt caching by swapping instructions & content #1699
y0hnn
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What needs to be done?
We should first give the instructions in the prompt, then give the URL & Content : https://github.com/unclecode/crawl4ai/blob/main/crawl4ai/prompts.py
What problem does this solve?
We could leverage prompt caching. Depending on the provider, the cached tokens for input can ben up to 90% cheaper than normal input tokens. In my use-case, I'm crawling a lot of different pages with the same instructions set.
If we change the prompt to be :
We could also leverage on prompt caching for the HTML content which is quite the same (for example common body structure).
Target users/beneficiaries
Everyone using LLM Extraction. It would be cheaper at the end. For example with OpenAI : https://platform.openai.com/docs/pricing
Current alternatives/workarounds
No response
Proposed approach
No response
Beta Was this translation helpful? Give feedback.
All reactions