惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
爱范儿
爱范儿
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
有赞技术团队
有赞技术团队
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
罗磊的独立博客
D
Docker
美团技术团队
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
P
Proofpoint News Feed
博客园 - 聂微东
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
H
Help Net Security
T
Tailwind CSS Blog
S
Securelist
Google DeepMind News
Google DeepMind News
Scott Helme
Scott Helme
Jina AI
Jina AI
C
Cybersecurity and Infrastructure Security Agency CISA
Y
Y Combinator Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - Franky
S
Security @ Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
U
Unit 42
S
SegmentFault 最新的问题
Project Zero
Project Zero
P
Palo Alto Networks Blog
T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
F
Full Disclosure
P
Privacy & Cybersecurity Law Blog
J
Java Code Geeks
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园_首页
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
M
MIT News - Artificial intelligence
NISL@THU
NISL@THU
Recent Commits to openclaw:main
Recent Commits to openclaw:main
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
V
Vulnerabilities – Threatpost
S
Schneier on Security

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
GLM-5.2 open agent benchmark: 22% Less Tool Failure
Umair Bilal · 2026-06-25 · via DEV Community

Umair Bilal

This article was originally published on BuildZn.

Spent weeks battling flaky AI agents that just couldn't stick to the script. Multi-step tool use was a nightmare, constantly hallucinating API calls or just flat-out ignoring the defined tools. Everyone talks about the raw power of new open LLMs, but nobody benchmarks them for reliable agentic workflows. Turns out, GLM-5.2 for open agent benchmark testing drastically changed the game.

The Agent Reliability Problem: Why Open LLMs Flop on Tool Use

Look, building multi-agent systems, especially with Node.js, means your LLM needs to be a damn good engineer. It needs to follow instructions, use specific tools at the right time, and pass valid parameters. Most open source LLMs? They're chat bots first, tool-users second.

I've pushed Mixtral 8x7B hard on FarahGPT and NexusOS. For simple, one-shot tool calls, it's decent. But throw a complex, chained task at it — "find product, check stock, then update CRM" — and it often fumbles. You'd see things like:

  • Hallucinated API calls: Inventing a getProductInventory tool that doesn't exist.
  • Incorrect parameters: Calling updateCRM({ customer: 'Umair' }) instead of { customerId: 'bldzn_007' }.
  • Missing steps: Getting stuck after "find product" and just generating text instead of moving to "check stock."

This eats development time, costs API credits, and frustrates users. This isn't just theory; I've spent countless hours debugging agent.log files trying to figure out why my YouTube automation pipeline missed a step. My goal was to find an open model that could reliably execute complex AI agent tool use scenarios without constant babysitting.

How GLM-5.2 Cracks Multi-Step Tool Use in Node.js Agents

Here's the thing — GLM-5.2 isn't just another language model. It feels like it was designed with function calling and instruction adherence in mind. Its refined instruction following is genuinely better, and the improved function calling structure is a huge win for GLM-5.2 AI agent developers.

What changed?

  • Richer internal representation of tools: It seems to parse and understand JSON tool schemas with more depth. You give it a description field for your tool, and it actually uses that context.
  • Less "creative" tool names: Mixtral sometimes gets creative, trying to call check_stock_levels when your tool is just checkStock. GLM-5.2 sticks to the exact function name you define.
  • Better parameter adherence: If you specify productId as a string, it passes a string. If it's number, it's a number. This might sound basic, but you'd be surprised how often other models mess this up.

This isn't about raw intelligence; it's about predictable behavior. For an open source LLM agents builder like me, predictability is gold.

Benchmarking GLM-5.2 for Reliable AI Agent Tool Use

Okay, so enough talk. Let's get to the numbers.

I set up a benchmark on a Node.js backend for a multi-step financial agent. This agent's task was to:

  1. Retrieve User Portfolio: Call getUserPortfolio(userId: string).
  2. Analyze Gold Holdings: Call getGoldMarketData(region: string) based on portfolio.
  3. Suggest Trade: Call suggestTrade(userId: string, currentHoldings: number, marketData: object).
  4. Confirm Trade: Call confirmTrade(userId: string, tradeId: string) (if agent decides to proceed).

Each tool was a simple mock API call, returning predefined JSON. The critical part was ensuring the LLM called the correct tool, with the correct parameters, in the correct sequence, and didn't hallucinate.

Methodology:

  • Environment: Node.js backend on a Vercel instance (serverless functions), running GLM-5.2 via a custom API endpoint (Ollama-compatible local deployment on an RTX 4090 for inference, pushing results to the Vercel app). Mixtral 8x7B also run via Ollama.
  • Prompts: Identical system and user prompts for both models, clearly defining the available tools and task.
  • Runs: 100 complete agentic cycles for each model, varying userId and initial portfolio state.
  • Success Criteria: An agent run was marked "successful" only if all necessary tools were called in the correct order with valid parameters, and no hallucinated tools or incorrect parameters were observed.
  • Tool Failure Definition: Any deviation from the above, including:
    • Calling a non-existent tool.
    • Providing parameters with wrong types or missing required parameters.
    • Skipping a required step in the sequence.
    • Generating irrelevant text instead of a tool call when a tool was expected.

Results:

  • Mixtral 8x7B (Ollama): 56 successful multi-step agent runs out of 100.
    • Common failures: Parameter type mismatches (especially with number vs. string), occasional skipped confirmTrade calls, and ~15% hallucinated tool names like fetchGoldPrice instead of getGoldMarketData.
  • GLM-5.2 (Ollama): 78 successful multi-step agent runs out of 100.
    • Common failures: Mostly due to subtle misinterpretation of marketData object structure for suggestTrade, rarely hallucinated tools.
  • Conclusion: GLM-5.2 boosted multi-step tool-use reliability in my Node.js AI agents by 22% compared to Mixtral 8x7B, drastically reducing hallucinated API calls during benchmark tests. This translates to a significantly more robust agent and less debugging for me.

Here's a simplified Node.js example showing the tool definition and invocation pattern for GLM-5.2 (assuming an llmClient that handles the API interaction and tool parsing):

// agent.js
const tools = [
  {
    type: "function",
    function: {
      name: "getUserPortfolio",
      description: "Retrieves the current investment portfolio for a given user.",
      parameters: {
        type: "object",
        properties: {
          userId: {
            type: "string",
            description: "The unique identifier for the user.",
          },
        },
        required: ["userId"],
      },
    },
  },
  {
    type: "function",
    function: {
      name: "getGoldMarketData",
      description: "Fetches real-time gold market data for a specified region.",
      parameters: {
        type: "object",
        properties: {
          region: {
            type: "string",
            enum: ["US", "EU", "ASIA"], // GLM-5.2 loves enums
            description: "The geographical region for market data (e.g., 'US', 'EU', 'ASIA').",
          },
        },
        required: ["region"],
      },
    },
  },
  // ... more tools like suggestTrade, confirmTrade
];

async function runAgent(userId, initialPrompt) {
  let messages = [{ role: "user", content: initialPrompt }];

  // Initial call with tools
  let response = await llmClient.chat.completions.create({
    model: "glm-5.2", // or your custom model name in Ollama
    messages: messages,
    tools: tools,
    tool_choice: "auto", // Crucial for instructing GLM to use tools
    temperature: 0.1, // Keep it low for reliable tool use
  });

  let toolCalls = response.choices[0].message.tool_calls;

  if (toolCalls && toolCalls.length > 0) {
    for (const toolCall of toolCalls) {
      const functionName = toolCall.function.name;
      const functionArgs = JSON.parse(toolCall.function.arguments);

      console.log(`Agent calling tool: ${functionName} with args:`, functionArgs);

      // Execute the tool (this would be your actual API call)
      let toolOutput;
      switch (functionName) {
        case "getUserPortfolio":
          toolOutput = await mockGetUserPortfolio(functionArgs.userId);
          break;
        case "getGoldMarketData":
          toolOutput = await mockGetGoldMarketData(functionArgs.region);
          break;
        // ... handle other tools
        default:
          toolOutput = JSON.stringify({ error: `Unknown tool: ${functionName}` });
      }

      // Add tool output back to messages for the next turn
      messages.push({
        tool_call_id: toolCall.id,
        role: "tool",
        name: functionName,
        content: JSON.stringify(toolOutput),
      });

      // Continue the conversation with GLM-5.2 using the tool output
      response = await llmClient.chat.completions.create({
        model: "glm-5.2",
        messages: messages,
        tools: tools, // Pass tools again for multi-step
        tool_choice: "auto",
        temperature: 0.1,
      });

      toolCalls = response.choices[0].message.tool_calls; // Check for next tool call
      if (!toolCalls || toolCalls.length === 0) {
          messages.push(response.choices[0].message);
          console.log("Agent finished or generated text:", response.choices[0].message.content);
          break; // Agent decided to respond with text or finished
      }
    }
  } else {
    // Agent responded with text directly
    messages.push(response.choices[0].message);
    console.log("Agent responded with text:", response.choices[0].message.content);
  }
}

// Mock functions for demonstration
async function mockGetUserPortfolio(userId) {
  return { userId, holdings: [{ asset: 'gold', amount: 50 }] };
}

async function mockGetGoldMarketData(region) {
  return { region, price: 2300, trend: 'up' };
}

// Example usage
runAgent("umair_dev", "Analyze my gold portfolio and suggest a trade for the US market.");

This simple loop demonstrates the core interaction. The key here is the tool_choice: "auto" and consistently feeding the tool outputs back to the model.

What I Got Wrong First

Honestly, my first few runs with GLM-5.2 were still shaky. I assumed it would just "get" a generic tool structure like some closed models do. Unpopular opinion: Most agent frameworks abstract away too much of this critical prompt engineering for tool calls, making it harder to debug when things go sideways. Building a custom handler in Node.js, where you control the prompt and tool schema explicitly, often yields better, more transparent results for specialized tasks.

My initial mistake was defining the parameters block for a tool too loosely. Like this:

// Wrong way
{
  name: "suggestTrade",
  description: "Suggests a gold trade.",
  parameters: {
    type: "object",
    properties: {
      userId: { type: "string" },
      // ... didn't specify enum or detailed description
    }
  }
}

GLM-5.2, much like any good interpreter, prefers strict types and clear descriptions. If I didn't specify enum: ["US", "EU", "ASIA"] for the region parameter in getGoldMarketData, it would sometimes hallucinate regions like "North America" or "Global", leading to the mock API failing. I also hit an error string multiple times: "Function 'confirmTrade' called with arguments 'undefined'". This usually happened when the previous tool call output wasn't correctly fed back into the messages array, making the model lose context for subsequent calls. Always ensure your tool outputs are sent back as role: "tool" messages.

Optimizing GLM-5.2 for Low Latency Node.js LLM Benchmarks

Running these Node.js LLM benchmarks means you care about more than just accuracy; latency matters.
Here's a quick hit list for local GLM-5.2 deployments via Ollama:

  • Quantization: Always run quantized versions. I'm using GLM-5.2-Q4_K_M via Ollama. It's a sweet spot for performance and minimal accuracy loss.
  • Hardware: An RTX 4090 is obviously overkill for local testing, but even on my older 3080, GLM-5.2-Q4_K_M was hitting about 35 tok/s measured over 50 consecutive inference calls. This is crucial for fast agent iterations.
  • Batching (Ollama): If you're hitting your local Ollama instance with multiple requests, consider batching them at the application layer if your use case allows. This isn't a direct GLM-5.2 config but an ollama trick.
  • Temperature: Stick to temperature: 0.1 (or even 0) for tool use. You want deterministic output, not creative prose.

One minor point: for some GLM-5.2 variants, explicitly setting top_p: 0.9 alongside low temperature sometimes nudges it towards stricter token generation, though this isn't in their core docs as a tool-specific setting, it helps in general output quality.

FAQs

Is GLM-5.2 good for complex multi-step agents?

Yes, absolutely. My benchmarks show GLM-5.2 provides a significant reliability boost for complex, multi-step AI agent tool use scenarios compared to other open models like Mixtral 8x7B, largely due to its superior instruction following and function calling structure.

How does GLM-5.2 compare to Claude or OpenAI for tool use?

For raw instruction following and complex tool orchestration, top-tier closed models like Claude 3 Opus or GPT-4 Turbo still hold an edge. However, GLM-5.2 closes the gap considerably for open-source options, offering a much more reliable experience than previous open models, especially if you prioritize cost-effectiveness and local deployment.

What's the best way to run GLM-5.2 locally for Node.js agents?

The most straightforward way to run GLM-5.2 open agent benchmark tests locally is via Ollama. It provides a simple API endpoint that your Node.js backend can interact with, abstracting away the complexities of model loading and inference. Just download the appropriate GLM-5.2 model (e.g., glm-5.2-q4_k_m) using Ollama, and target it from your Node.js client.

Anyway, if you're building open source LLM agents on Node.js and hitting a wall with tool reliability, GLM-5.2 is a serious contender. The 22% improvement in successful tool execution isn't just a number; it's less debugging, faster iterations, and ultimately, more robust agent systems. Stop fighting your LLM to use tools correctly. Give this one a shot.