codeburn icon indicating copy to clipboard operation
codeburn copied to clipboard

Support Non GPT Azure Foundry Models

Open cloudant42 opened this issue 6 months ago • 1 comments

Hi,

I am using code burn mainly with models hosted in Azure Foundry.

It is working perfectly for all GPT models so far, that I use with the codex cli, but I noticed that I get only partial information for other models hosted in foundry such as Kimi2.6 or deepseek models that I use with open code.

I think in general the API response that is used to share the token usage is similar for all models in Azure foundry. At the moment the only thing I see in codeburn are the number of calls, but no information related to token usage.

Would be awesome if this is also working. Thanks!

cloudant42 avatar May 29 '26 09:05 cloudant42

Thanks for the detailed report. I dug into this, and the missing token usage is an OpenCode-side issue rather than something CodeBurn can recover.

CodeBurn reads token usage straight from what OpenCode stores per message (message.tokens / usage). For models served through an openai-compatible provider (which is how Azure Foundry non-GPT models like Kimi and DeepSeek are configured), OpenCode currently writes zero tokens even though the Foundry API returns usage in the response. So there is nothing in OpenCode's session files for CodeBurn to display, which is why you see call counts but no tokens. When OpenCode does record usage (for example its native openai provider), CodeBurn shows it correctly.

This is a known OpenCode bug: the usage is present in the API response, but OpenCode fails to parse and persist it for openai-compatible providers (it ends up as 0). See https://github.com/anomalyco/opencode/issues/423.

Next step: update OpenCode and CodeBurn and retest. That issue was fixed for some openai-compatible providers (LM Studio, Ollama); if Azure Foundry now records tokens, CodeBurn will pick them up automatically. If it still shows zero, the fix needs to land in OpenCode. Happy to double-check if you can paste one assistant message from ~/.local/share/opencode/storage/message/<session>/<id>.json showing its tokens field.

iamtoruk avatar Jun 19 '26 17:06 iamtoruk