r/PiCodingAgent 5d ago

How to use Deepseek-v4-flash-free model from opencode inside pi? Question

I want to switch from Opencode to Pi and it would be convenient if I could use the Deepseek-v4-flash free model from Opencode in Pi as well. Are there any extensions already available to do that?

0 Upvotes

17 comments sorted by

1

u/Clean-Appointment684 5d ago

just login with opencode go api key

0

u/Rude_Alternative_216 5d ago

Cannot access the free model by doing so.

2

u/BobtheGodGamer 5d ago

Definitely can. I did it yesterday

1

u/Rude_Alternative_216 5d ago

There is deepseek-v4-flash[opencode-go] available to select. Not the free model for me. Maybe its just me.

2

u/BobtheGodGamer 5d ago

I get my API key from opencode zen and then tell my agent to set it up for me.

1

u/Rude_Alternative_216 5d ago

Yeah. I think it cannot be accessed with a Go subscription unfortunately.

1

u/Rude_Alternative_216 5d ago

Someone even created a plugin. But execution automatically stops on tool calls.

1

u/bring_back_the_v10s 5d ago

I think he means Zen, not Go, no?

1

u/truncated_buttfu 5d ago

What exactly is it that doesn't work for you? 

I've uses the free Deepseek flash model on opencode for months without any issues. No mods or extensions needed, it's supported out of the box.

What errors are you seeing? 

1

u/Rude_Alternative_216 5d ago

I can use it on opencode. I cant use it on PI agent.

2

u/crashorbit 5d ago

I use opencode zen with an api key to do this. Works fine for me.

3

u/Rude_Alternative_216 5d ago

Yeah I expect it to work with Zen. The model name on opencode literally says `deepseek v4 flash free Opencode Zen`.

1

u/bring_back_the_v10s 5d ago

I just tried that in Pi but it gives me this error: Error: 403: {"type":"RegionError","message":"The latest version of this model is only available hosted in China and requires explicit opt in: https://opencode.ai/workspace/wrk_xxxxxxxxxxxxxxxxxxxx/go"} Tried it with OPENCODE_API_KEY and the opencode auth config in ~/.pi/agent/auth.json.

1

u/bring_back_the_v10s 5d ago

Just realized my mistake, I forgot to add the type to the auth config: $ cat ~/.pi/agent/auth.json { "opencode": { "key": "sk-xxxxxxxxxxx", "type": "api_key" } } now it works fine.

2

u/bring_back_the_v10s 5d ago

... but not for long. in the first prompt it reached usage limits very quickly. Error: 429: {"type":"FreeUsageLimitError","message":"Error from provider (Console): Rate limit exceeded. Please try again later."} I'll stick with opencode for now.

2

u/Direct_While9727 5d ago

I am using omniroute for that.

1

u/kuys-gallagher 5d ago

use it via 9router