迷你部落格

短文隨想

篩選: opencode 全部標籤

  • My token budget is starting to burn fast. Here are the token optimizations I've done to reduce the cost for OpenCode.

    • Install RTK.
      • Reduce shell output. See here for the supported commands.
    • Install Codegraph.
      • Remember to codegraph init new repository !
      • Make sure that the MCP server is live.
    • Install OpenSlimedit.
      • The code source is very tiny. It basically compress built-in tool descriptions that are frequently used, and perform additional little optimisations here and there.
    • Use cheaper models for subagents.

    Excluded plugins

    • Dynamic Context Pruning Plugin : Not particularily convinced that it would reduce cost. Especially when I read their section Impact on Prompt Caching that kinda confirm my skepticism :

      Trade-off: Pruning reduces context size but can increase cache misses. The cost balance depends on your conversation, compression frequency, and provider pricing.

      Cache misses were exactly a significant part of my tokens cost. No point to risk it only to figure out what "intelligently" managed conversation ever mean.

    • OpenCode Snip : Used to reduce the output of shell commands. Most certainly redunding with RTK.

    發布於 2 週前 · 更新於 上週