Skip to content

Support for prompt caching #35

Open

Description

@simonw

https://openrouter.ai/docs/features/prompt-caching

Could be a tiny bit tricky to implement. I expect whatever mechanism I use for llm-anthropic will mostly work here too:

Activity

  1. irthomasthomas commented on Apr 26, 2025

    @irthomasthomas

    I've added prompt caching for anthropic models, and I am about to work on gemini. Do you want me to make a PR now, or wait until all models are done?

    irthomasthomas#18 (comment)

  2. irthomasthomas commented on Apr 27, 2025

    @irthomasthomas

    This is done.
    #37

  3. irthomasthomas commented on Apr 27, 2025

    @irthomasthomas

    In case it's of interest, here is the main thread where my llm based agent built the feature irthomasthomas#18

    The first attempt is also there in irthomasthomas#16 - this failed as I set it running in the wrong branch. I also switched models a few times to try and save money as the conversation grew. Gemini flash got confused, so I got it to write a post-game analysis and then included that in a fresh request, and that one went quite smoothly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions