Baltor Get started

Models

GLM 4.7 Flash

By Z.ai. 31.2 billion parameters, a context window of 202,752 tokens and the licence mit.

Facts

Released
2026-01-19 the day the repository was first published on Hugging Face Hugging Face, read
Licence
mit the licence the model card declares Hugging Face, read
Open weights
Yes the weights are published in this Hugging Face repository Hugging Face, read
Parameters
31.2 billion counted from the safetensors weight files Hugging Face, read
Active parameters
5.2 billion estimate estimated from the expert counts and sizes in the configuration model configuration, read
Knowledge cutoff
Unknown
Context window
  • 202,752 tokens the maximum position embeddings in the model configuration model configuration, read
  • 200,000 tokens the context length OpenRouter lists OpenRouter, read
Longest output
  • 117,964 tokens the largest output OpenRouter's first provider allows OpenRouter, read
Tool calling
  • Yes OpenRouter lists tools among the supported parameters OpenRouter, read
Structured output
  • Yes OpenRouter lists structured outputs among the supported parameters OpenRouter, read
Reasoning controls
  • Yes OpenRouter lists reasoning controls OpenRouter, read
Inputs and outputs
text in, text out Hugging Face, read
Good for
  • Reasoning: OpenRouter lists reasoning controls for it OpenRouter, read

Prices

Prices in US dollars per million tokens, as each source lists them
ProviderInputOutputContextAs ofSource
Hugging Face direct0 USD0 USD200,000 older than 30 days; check the providermodels.dev, read
Deep Infra direct0.060 USD0.400 USD202,752 older than 30 days; check the providermodels.dev, read
Venice through OpenRouter0.060 USD0.400 USD128,000OpenRouter endpoints, read
Cloudflare through OpenRouter0.060 USD0.400 USD131,072OpenRouter endpoints, read
Jiekou.AI direct0.070 USD0.400 USD200,000models.dev, read
Novita through OpenRouter0.070 USD0.400 USD200,000OpenRouter endpoints, read
NovitaAI direct0.070 USD0.400 USD200,000 older than 30 days; check the providermodels.dev, read

Run it on your own hardware

Weights are the sizes of the files a source lists, or an estimate from the parameter count where none does. Memory is an estimate: weights plus KV cache plus 512 MiB and 5 percent of the weights for runtime buffers. Check it against your hardware.

QuantizationWeightsMemory at 8,192 tokensMemory at 32,768 tokens
UD-TQ1_07.8 GiB9.1 GiB10.3 GiB
UD-IQ1_S8.6 GiB10.0 GiB11.2 GiB
UD-IQ1_M9.1 GiB10.5 GiB11.7 GiB
UD-IQ2_XXS9.8 GiB11.2 GiB12.4 GiB
UD-IQ2_M10.2 GiB11.7 GiB12.9 GiB
Q2_K10.6 GiB12.0 GiB13.2 GiB
Q2_K_L10.6 GiB12.1 GiB13.3 GiB
UD-Q2_K_XL11.1 GiB12.5 GiB13.8 GiB
UD-IQ3_XXS12.0 GiB13.5 GiB14.8 GiB
Q3_K_S12.4 GiB13.9 GiB15.1 GiB
UD-Q3_K_XL12.8 GiB14.4 GiB15.6 GiB
Q3_K_M13.6 GiB15.2 GiB16.4 GiB
IQ4_XS15.2 GiB16.8 GiB18.1 GiB
MXFP4_MOE15.8 GiB17.5 GiB18.7 GiB
IQ4_NL16.0 GiB17.7 GiB18.9 GiB
Q4_016.0 GiB17.7 GiB19.0 GiB
Q4_K_S16.1 GiB17.8 GiB19.0 GiB
UD-Q4_K_XL16.3 GiB18.0 GiB19.3 GiB
Q4_K_M17.1 GiB18.8 GiB20.1 GiB
Q4_117.7 GiB19.5 GiB20.7 GiB
Q5_K_S19.4 GiB21.3 GiB22.5 GiB
Q5_K_M19.9 GiB21.8 GiB23.1 GiB
UD-Q5_K_XL20.2 GiB22.1 GiB23.4 GiB
Q6_K23.0 GiB25.1 GiB26.3 GiB
UD-Q6_K_XL24.4 GiB26.5 GiB27.7 GiB
Q8_029.7 GiB32.1 GiB33.3 GiB
UD-Q8_K_XL33.2 GiB35.8 GiB37.0 GiB
BF1655.8 GiB59.5 GiB60.7 GiB

Start it with a local runtime

  • Ollama
    ollama run hf.co/unsloth/GLM-4.7-Flash-GGUF:Q4_0
  • LM Studio
    lms get unsloth/GLM-4.7-Flash-GGUF
    lms server start
  • llama.cpp server
    llama-server -hf unsloth/GLM-4.7-Flash-GGUF:Q4_0 --jinja
  • vLLM
    vllm serve zai-org/GLM-4.7-Flash
  • SGLang
    sglang serve --model-path zai-org/GLM-4.7-Flash --port 30000

Use it from your harness

Set up for DeepInfra with the model zai-org/GLM-4.7-Flash. Each endpoint page has the same setup for its own address.

OpenCode

Put this in opencode.json in your project folder:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "deepinfra": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "DeepInfra",
      "options": {
        "baseURL": "https://api.deepinfra.com/v1/openai",
        "apiKey": "{env:DEEPINFRA_TOKEN}"
      },
      "models": {
        "zai-org/GLM-4.7-Flash": {
          "name": "GLM 4.7 Flash",
          "limit": {
            "context": 202752,
            "output": 117964
          }
        }
      }
    }
  }
}
  • OpenCode reads any OpenAI-compatible address through the @ai-sdk/openai-compatible package, and an address that speaks the Responses API through @ai-sdk/openai.

From OpenCode documentation, read .

Pi

Put this in ~/.pi/agent/models.json:

{
  "providers": {
    "deepinfra": {
      "baseUrl": "https://api.deepinfra.com/v1/openai",
      "api": "openai-completions",
      "apiKey": "$DEEPINFRA_TOKEN",
      "models": [
        {
          "id": "zai-org/GLM-4.7-Flash"
        }
      ]
    }
  }
}
  • The apiKey field can name an environment variable as $NAME.

From Pi documentation, read .

Codex

Codex speaks only the Responses API, and DeepInfra documents no Responses address. A gateway that offers one can sit in between.

  • Codex speaks the Responses API only: responses is the one supported wire API of a custom provider. Ollama and LM Studio are built in and start with --oss.

From Codex documentation, read .

Claude Code

Put this in ~/.claude/settings.json, or variables in your shell:

export ANTHROPIC_BASE_URL="https://api.deepinfra.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="$DEEPINFRA_TOKEN"
export ANTHROPIC_MODEL="zai-org/GLM-4.7-Flash"
claude
  • Claude Code sends Anthropic Messages requests to ANTHROPIC_BASE_URL. Anthropic says it does not support routing Claude Code to models other than Claude through any gateway, so some features may not work with another model.

From Claude Code documentation, read .

Other ways to reach it

Published results

These are results other people published. Baltor did not run them and does not rank models by them.