---
title: "Using GLM Flash on Cadenya"
url: "https://cadenya.com/handwritten/using-glm-on-cadenya"
description: "Using GLM 5.3 Flash on Cadenya offers a great balance of token throughput and cost for building agentic functionality."
---

```
$ whoami
> Robert Ross
```

Cadenya supports using any model in your agent variations, including open-weight models. The mystery of using these open-weight models has faded considerably, especially with companies such as [Modal](https://modal.com/) offering point-and-click options to deploy them.

This (short) post goes into how you can connect GLM 5.3 Flash, hosted on Modal, to Cadenya and use it for your agent.

## Creating the endpoint

Modal has made it dead simple to create a private endpoint that follows the OpenAI API’s chat completion format. First, you’ll need to be logged in to your Modal account.

1.  Go to `https://modal.com/endpoints/{workspaceSlug}/main`.
2.  Click “Create Endpoint.”

![Creating an endpoint in Modal](/_astro/modal-create-endpoint-1.BJJ-xkPY_1KdPab.webp?dpl=dpl_7NpqJqVHKqA6Y8JKewxYBQuGMFBe)

Once you’re on the Create Endpoint page, you can select GLM and then the Flash version.

> _Note:_ Really, any model will work in this tutorial, but we’re focused on GLM.

![Creating an endpoint in Modal](/_astro/modal-create-endpoint-2.CpaMn_Ip_Z1Lgkju.webp?dpl=dpl_7NpqJqVHKqA6Y8JKewxYBQuGMFBe)

Select the GLM Flash model, give the endpoint a different name if you like (your prerogative), and click “Create Endpoint.”

## Proxy tokens

Modal requires proxy tokens to access these endpoints. These token pairs can be found at `https://modal.com/settings/{workspaceSlug}/proxy-auth-tokens`. **Save the token pair for the next step.**

## Add the AI provider to Cadenya

Cadenya supports adding OpenAI-compatible providers, including Modal. We can configure a new AI provider with our shiny new endpoint and proxy tokens to start using GLM in a few steps.

1.  Go to [https://app.cadenya.com/w/default/aiProviders](https://app.cadenya.com/w/default/aiProviders).
2.  Click “Add AI Provider” in the top right.

Fill in the form with these values:

AI provider Read-only · Copy where available

Name

 Copy

Modal - GLM

External ID

 Copy

modal-glm

Provider

 Copy

OpenAI Compatible

Select this option from the Provider dropdown.

Base URL

 Copy

{your-modal-shared-endpoint-url}/v1

Replace the placeholder with your Modal shared endpoint URL. Be sure to include /v1 at the end.

Authorization

Bearer {ws-token-id}.{ws-token-secret} Copy

Add a header named Authorization. Replace the placeholders with the proxy token pair you saved earlier.

Here’s what mine looks like at this point:

![Creating an AI Provider in Cadenya](/_astro/modal-create-endpoint-3.D-AfqWBA_2gezT4.webp?dpl=dpl_7NpqJqVHKqA6Y8JKewxYBQuGMFBe)

Once you save it, you’ll be dropped into the AI provider’s details page.

## Adding the model

Click the “Add Model” button in the bottom left of the AI provider’s details page, and we’ll enter our details for GLM Flash.

![Creating an AI Provider in Cadenya](/_astro/modal-create-endpoint-4.C9L8et4s_ZknKi3.webp?dpl=dpl_7NpqJqVHKqA6Y8JKewxYBQuGMFBe)

Modal has a dedicated page for each model in its library with all the details we need to fill in this form.

You can find the [GLM 5.3 Flash details here](https://modal.com/library/zai/glm-5-3-flash), for example.

Model details Read-only · Copy where available

Name

 Copy

GLM-5.3-Flash

Model ID

 Copy

zai-org/GLM-5.3-Flash

This must match exactly; otherwise, chat completions will fail.

Vendor

 Copy

z-ai

Family

 Copy

glm

Max Input Tokens

 Copy

1000000

1 million tokens.

Max Output Tokens

 Copy

64000

Turn on `Prompt Caching` in the capabilities, too.

Pricing Read-only · Copy where available

Input

 Copy

0.45

USD per million tokens.

Output

 Copy

1.50

USD per million tokens.

Save the model, and let’s hook it up to an agent variation in Cadenya.

## Wiring it up to an agent

Now you’ll need to create an agent and a variation in Cadenya to use this model. If you already have both, you can skip this part.

Go to the [New Agents page in Cadenya](https://app.cadenya.com/w/default/agents/create) and create a new agent.

### The agent

We can create a straightforward agent called “GLM Test” in Cadenya (no structured outputs or episodic memory required).

GLM Test Read-only · Copy where available

Name

 Copy

Data Classifier

Description

 Copy

An agent to test GLM on Modal with data classification

Click “Create Agent.”

### The variation

You’ll be redirected to add the first variation to the newly created GLM Test agent. We can use these sample values to configure it:

Default Read-only · Copy where available

Name

 Copy

GLM Test

System Prompt

 Copy

You are a support request classification agent. Your role is to analyze incoming support requests and assign them a single, relevant tag that categorizes the type of issue. When a user provides a support request: 1. Carefully read and understand the content of the request. 2. Identify the primary category or type of issue being reported. 3. Assign a single, clear tag that best represents the issue. 4. Return the tag along with a brief explanation of why that tag applies. Common support request tags include: - Technical: software bugs, system errors, performance issues - Billing: payment problems, invoices, subscription issues - Account: login problems, password resets, account access - Feature Request: new functionality suggestions - Documentation: unclear guides or help resources - Integration: problems connecting with other systems - Other: issues that don't fit standard categories Always respond with: - The assigned tag - A one-sentence reason for the classification - Any secondary tags if relevant, but prioritize a single primary tag Be consistent, fair, and accurate in your classifications. If a request is ambiguous, select the tag that addresses the most critical or urgent aspect of the issue.

Model

 Copy

GLM

Find the model we added above and select it.

## Watch it fly

Once you have an agent configured, we can dispatch an objective to it. Click the kebab menu in the top right, then click “Run.” Once the dialog appears, you can write a fake customer support message:

```
Hello, my order has not arrived, and I need help. It's a shoe order, and I badly need my kicks for a wedding, or my family might disavow me. I can't be having that.
```

[Watch the GLM agent run an objective in Cadenya.](/_astro/modal-run-objective.BB7XYF-R.mp4)

## GLM with tool calls

Cadenya is built for calling tools, and GLM Flash is very accurate at tool calling for how fast it is.

Now, let’s add a tool set to our workspace to use the [free-faker-mcp](https://github.com/cadenya/free-faker-mcp) project. This is an MCP server hosted at `https://free.cadenya.com/faker-mcp` that provides tools you can easily try in your agents.

### Adding the tool set

Visit the [Create Tool Set](https://app.cadenya.com/w/workspace_01M272W32Y1WVQ0475ZAE9TJV6/toolSets/create) page in your workspace. From there, we’ll add our Faker tool set.

Faker Tool Set Read-only · Copy where available

Name

 Copy

Faker Tools

Description

 Copy

Fake Data Generation

Adapter

MCP

URL

 Copy

https://free.cadenya.com/faker-mcp

The MCP settings in your tool set should look like this:

![MCP Settings](/_astro/modal-create-endpoint-6.BYCGQKlj_MYTMY.webp?dpl=dpl_7NpqJqVHKqA6Y8JKewxYBQuGMFBe)

Save the tool set, and you’re ready to use it in your agent!

### Adding it to your variation

Head back to the Agents → GLM page and assign your tool set to your variation. Once you’re on the agent page, find the “Add Assignment” button and search for the Faker Tools tool set you just created.

### Watching GLM use the tools

Follow the steps from earlier to give the agent a new objective with a prompt like this:

```
Hello, I need a fake name generated for me.
```

The new objective will be dispatched to the agent, and we’ll see it call the Faker Tools tool set to generate a fake name.

![GLM using the Faker Tools tool set](/_astro/modal-create-endpoint-7.T9Q792HF_v6ibN.webp?dpl=dpl_7NpqJqVHKqA6Y8JKewxYBQuGMFBe)

## Wrapping up

Using open-weight models is not scary with tools like Modal on the market. Cadenya is a great way to quickly try these fast, cheap models with low risk, too.

[Sign up for Cadenya](https://app.cadenya.com/signup)