# Phi 4 vs GLM 5.4

Source: https://openrouter.ai/compare/microsoft/phi-4/z-ai/glm-5.4

## Overview

| Attribute | Phi 4 | GLM 5.4 |
| --- | --- | --- |
| Author | Microsoft | Z.ai |
| Reasoning | No | Yes |
| Input modalities | Text | Text, Image, Video |
| Output modalities | Text | Text |
| Input price | $0.07/M tokens | $0.40/M tokens |
| Output price | $0.14/M tokens | $2.464/M tokens |
| Context window | 16,384 tokens | 1,048,576 tokens |
| Openness Index | 50.0 | Not available |
| GPQA Diamond score | 57.5% | Not available |
| Latency (p50) | 0.83 s | 0.56 s |
| Throughput (p50) | 86.0 tok/s | 133.0 tok/s |

## Phi 4 or GLM 5.4: which should you choose?

### Choose Phi 4 for:

- lower token prices

### Choose GLM 5.4 for:

- a longer context window (1,048,576 vs 16,384 tokens)
- faster output (133.0 vs 86.0 tok/s)
- a quicker first token (0.56 s vs 0.83 s)

## Model pages

- [Phi 4](https://openrouter.ai/microsoft/phi-4) ([llms.txt](https://openrouter.ai/microsoft/phi-4/llms.txt))
- [GLM 5.4](https://openrouter.ai/z-ai/glm-5.4) ([llms.txt](https://openrouter.ai/z-ai/glm-5.4/llms.txt))
