puter icon indicating copy to clipboard operation
puter copied to clipboard

[Feature request] Passthrough for advanced chat completion parameters

Open urroxyz opened this issue 11 months ago • 4 comments

This feature request concerns Puter.js' AI chat completion API. (Sorry, I know you're tired of hearing these.)

I think Puter.js is great, and I'm looking to integrate it directly into my website. The only issue is that, despite being feature-rich, the high-level API doesn't seem to expose the raw OpenRouter configuration, or any provider's, for that matter. This means I can't utilize important schema options for things like structured generation or provider-level routing.

I am trying to use puter.ai.chat with standard options like response_format (for JSON) or provider (for routing), but they seem to be ignored by the current API implementation. No provider routing also means no ZDR, which is an important acknowledgement for my user base.

And, oh yeah, it'd be really nice if I could enable reasoning for Claude, or control CoT budget for Gemini.

I would like to request that these additional arguments in the options object be exposed for the standard chat call.

Here is the code I would like to be able to run:

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat(`Generate some data based on the file.`, { 
            model: "meta-llama/llama-3.1-70b-instruct",
            
            // New arguments that would make the experience much better
            response_format: { type: "json_object" },
            // + stuff for thinking, like thinkingLevel or Budget, depending on the model
            provider: { 
                order: ["deepinfra", "together"], // Or whatever providers are supported
                allow_fallbacks: false
            }
        }).then(puter.print);
    </script>
</body>
</html>

Thank you so much.

urroxyz avatar Dec 28 '25 05:12 urroxyz

Hi, I would like to work on this issue. Could you please assign it to me?

TechSakshi646 avatar Dec 28 '25 08:12 TechSakshi646

@TechSakshi646 Thank you for the interest. I don't believe I have permissions to do that, so you may want to ping someone who does. (Sorry if you weren't talking to me!)

urroxyz avatar Dec 28 '25 08:12 urroxyz

it appears @voxathon has taken this up in their PR, I'll assign them if they consent to it

ProgrammerIn-wonderland avatar Jan 06 '26 16:01 ProgrammerIn-wonderland

We're gonna close this for the time being, well revisit again at a later date

Salazareo avatar Jun 18 '26 22:06 Salazareo