Docstrings as immutable variables
Just realized you can do:
def cat(): “orange”
print(cat.__doc__)
Not sure why you’d want to do this but this is a thing you can do
Just realized you can do:
def cat(): “orange”
print(cat.__doc__)
Not sure why you’d want to do this but this is a thing you can do
here it is with comments: https://github.com/dbowm91/optimizations/blob/main/soupexplained.py
EDIT: What it does (not malware) is it >!prints the word “soup” 86 times in random color!<
I get a bit more than 1b tokens/week. The cache hit is probably doing the work and is around 95% for me. I get around 40TPS depending on time of day
When m3 came out I was skeptical about the usage change but it’s a leap over what m2.7 can do. One of the better capability:cost options out there. Biggest complaint is it’s slow. Not just TPS, but time to first token, so each back and forth can feel super slow sometimes. peak times like early morning/afternoon EST are not great
Trying to squeeze the most out of it:
in opencode I cap the max content length to around 200k. I’ve experimented around 160-240k and 180-220k work fine for me. Compaction isn’t ideal but the combo of this model and opencode seem to handle it well
I also use RTK, plugins like dynamic context seems to reduce cache hit too much to be worth it here
In opencode I set subagents to mimo 2.5. I use gpt models for planning/reviewing m3s work, m3 works well as the orchestrator.
Anyway that’s my take, works in my current setup and I can run it on a couple long sessions at a time like this throughout the day, so I’m happy with what I can get out of it
main reason i made it was to load balance opencode go subs, but i also route minimax.io and generalcompute through it now. wanted it to be a proxy so i could route other machines through it over lan/tailscale.
has options to reduce write-wear on microsd's, dns caching, stack is python fastapi with granian running single process with default setup. dashboard is lightweight and no external JS assets. also contains 2 eggs AND red isn't the only color, just the best one.
notable feature: lists all models you have access too and doesn't provide any useful information about them.
Also, the metrics might not all be possible right now, but they are metrics.
long context uses a lot more usage on the minimax plans and it gets increasingly dumb past 200k. started noticing some of the subagents well into 300-400k context getting stuck on trivial things and burning tokens, getting very slow, overriding it to 220k seems to keep it sane
{
"$schema": "https://opencode.ai/config.json",
"model": "minimax/MiniMax-M3",
"provider": {
"minimax": {
"npm": "@ai-sdk/anthropic",
"options": {
"baseURL": "https://api.minimax.io/anthropic/v1",
"apiKey": "<MINIMAX_API_KEY>"
},
"models": {
"MiniMax-M3": {
"name": "MiniMax-M3",
"limit": {
"context": 220000,
"output": 16000
}
}
}
}
},
}