Blog

Baidu CoBuddy Is Now Available in Puter.js

On this page

Puter.js now supports CoBuddy, Baidu's code generation model released through the Qianfan platform and built for coding tasks and AI agent workflows.

What is CoBuddy?

CoBuddy is Baidu's code-focused language model, released on May 6, 2026 via the Qianfan platform. It is engineered for coding-centric agents and assistive coding tools where the model needs to plan, invoke tools, and iterate on code.

Key highlights:

  • 131K token context window — large enough to fit entire codebases and long agent traces
  • Up to 65K output tokens — room for extended generations and full file rewrites
  • Native tool calling — built-in support for agentic workflows where the model invokes external tools
  • Reasoning support — can produce step-by-step thinking traces alongside its answers
  • High throughput, low latency — optimized for responsive performance in interactive coding tools
  • Free — no input or output token cost

Examples

Code generation

puter.ai.chat("Write a Python function that checks if a string is a palindrome.",
  { model: 'baidu/cobuddy:free' }
);

Bug fixing

puter.ai.chat(`Fix this code that should reverse a linked list but doesn't work:
def reverse(head):
    prev = None
    while head:
        head.next = prev
        prev = head
        head = head.next
    return prev`,
  { model: 'baidu/cobuddy:free' }
);

Streaming with reasoning

const response = await puter.ai.chat(
  "Implement a debounce function in JavaScript and explain your approach.",
  { model: 'baidu/cobuddy:free', stream: true }
);

for await (const part of response) {
  if (part?.reasoning) puter.print(part?.reasoning);
  else puter.print(part?.text);
}

Get Started Now

Just add one library to your project:

// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';

Or add one script tag to your HTML:

<script src="https://js.puter.com/v2/"></script>

No API keys and no infrastructure setup. Start building with CoBuddy immediately.

Learn more:

Free, Serverless AI and Cloud

Start creating powerful web applications with Puter.js in seconds!

Get Started Now

Read the Docs Try the Playground