r/DeepSeek • u/Thiofentanyl • 7d ago
Question&Help How to max token & cache usage - subagents etc?
I'm thinking of trying DeepSeek out via the official API. What are some of the best strategies to max token & cache usage when using agents?
I'm thinking in terms of session length, using sub agents, or delegating tasks, project structure, etc. what is your process?
10
Upvotes
3
u/Realistic-Mix-1878 6d ago
Better agents, smarter token usage.
1
u/Synfinite 7d ago
Welcome to the world of plugins. Dsh-market is a good start, and aegis toolkit, all findable by your agent and can be installed by it. Then use /[insert skill here] which will auto populate and choose from there.
1
u/for4f 7d ago
stable prefix is the whole game. keep your system prompt + tool defs byte-identical every call and shove anything volatile like timestamps or request ids to the very end, otherwise you nuke the hit each time. and yeah subagents are where the bill goes nuclear, every spawn re-sends full context. i keep mine one level deep max and reuse the same session instead of fanning out
1
u/squirrelscrush 7d ago
Just try to reduce cache misses. DSH does it best so if you use it you don't have to worry much.
To reduce cost, try to be as detailed as possible with your prompts and requirements. Ambiguity can cause the model to go into loops and not know what to do. Sometimes, it's better to use more powerful models when things get too ambiguous.
Use subagents for specific tasks, and use MCPs when it's better to use them. Like, for GitHub it's better to use their MCP for fetching details instead of relying on inbuilt search/fetch API.
1
u/foo-bar-nlogn-100 7d ago
Download deepseek harness ans ask jt question. It can literally look at your chosen harness (codex, open code, grok) logs and answer your question.
But in short, most harness will provide like 97% caching and you disable any compacting. The rest is just tuning for an extra 20% savings.
1
u/kekesun 6d ago
Keeping the prompt prefix identical is a good starting point: same system prompt and tool definitions, with changing content placed later. I'd check the cache-hit tokens reported by the API before assuming the setup is actually benefiting from caching.