AI on demand: zai-org/GLM-5.3-Flash

From MediaWiki
Jump to navigation Jump to search

Calling the model

# Set your personal key:
STONEY_KEY=sk-...

# Set the desired model:
MODEL=zai-org/GLM-5.3-Flash

# Set your prompt:
PROMPT='Hello.'

# Set maximum amount of tokens:
MAX_TOKENS=1000

curl https://llm.stoney-cloud.com/v1/chat/completions \
        --silent --fail --show-error \
        --header "Authorization: Bearer $STONEY_KEY" \
        --header 'Content-Type: application/json'   \
        --data '{
                "model": "'"$MODEL"'",
                "messages": [
                        {"role": "user", "content": "'"$PROMPT"'"}
                ],
                "max_tokens": '"$MAX_TOKENS"'
        }' \
        | jq

Example output:

{
  "id": "chatcmpl-b823aeb93ca47bab",
  "object": "chat.completion",
  "created": 1789132434,
  "model": "zai-org/GLM-5.3-Flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm GLM, a large language model trained by Z.ai. Nice to meet you, and I hope you're having a great day.\n\nDo you have any questions or topics of interest I can help you with? Whether it's a knowledge inquiry, creative writing, or everyday conversation, I'm happy to provide assistance.",
        "refusal": null,
        "annotations": null,
        "audio": null,
        "function_call": null,
        "reasoning": "Let me consider how to respond to this greeting appropriately.\n\nThe user has initiated the conversation with a simple \"Hello,\" which calls for a warm and professional response. Since this is the beginning of our interaction, it's important to create a welcoming atmosphere that encourages open communication. I should acknowledge their greeting in a friendly way and express my readiness to assist them with any questions or concerns they might have.\n\nI need to craft a response that not only reciprocates the greeting but also clearly communicates my purpose as an AI assistant designed to be helpful, informative, and supportive. This will help set the right tone for our conversation and make the user feel comfortable sharing what they need help with.\n\nThe response should be concise yet inviting, leaving room for the user to specify their needs or questions without feeling overwhelmed by too much information at once."
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": 154827,
      "token_ids": null,
      "routed_experts": null
    }
  ],
  "service_tier": null,
  "system_fingerprint": "vllm-0.28.1rc1.dev400+g8b6de0eb9-tp2-dp4-6f5a0747",
  "usage": {
    "prompt_tokens": 14,
    "total_tokens": 248,
    "completion_tokens": 234,
    "prompt_tokens_details": null,
    "completion_tokens_details": {
      "reasoning_tokens": 165
    }
  },
  "prompt_logprobs": null,
  "prompt_token_ids": null,
  "prompt_text": null,
  "kv_transfer_params": null,
  "ec_transfer_params": null,
  "metrics": null
}