Skip to main content

A Python API Wrapper for Z.AI (GLM).

Project description

GLM4Free

A Python-only client for Z.AI (GLM) that allows you to interact with the LLM for free, requests only.

Features

  • Python Only: No Node.js, Selenium, or heavy dependencies.
  • Stream Support: Real-time streaming of AI responses.
  • Thinking Mode: Toggle "Thinking" process.
  • Web Search: Toggle capability to search the web.
  • CLI & API: Use it as a library or a command-line tool.

Installation

pip install GLM4Free

🎯 Usage

📖 As a Library

from GLM4Free.client import ZChat

# Initialize
bot = ZChat()
bot.initialize()

# Chat
print("AI: ", end="")
bot.chat("Hello! Who are you?")

# Enable Web Search
bot.use_web_search = True
bot.chat("What is the latest Python version?")

👥 CLI

You can run the chat interface directly from your terminal:

glm4free

🔧 Commands

Inside the CLI, you can use:

  • /search: Toggle Web Search
  • /thinking: Toggle Thinking Mode
  • /new: Start a new conversation
  • /history: View conversation history
  • /exit: Quit

🚨Disclaimer

This is an unofficial client for educational purposes. It is not affiliated with Z.AI. Use responsibly.

🤝 Contributing

We welcome contributions! We are still missing upload functionality, feel free to pull request !

📄 License

This project is licensed under the MIT License.

💖 Support

If you find this project helpful:

  • ⭐ Star this repository
  • 🐛 Report issues
  • 💡 Suggest new features
  • 🤝 Contribute code

Enhanced using AI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glm4free-0.1.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glm4free-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file glm4free-0.1.1.tar.gz.

File metadata

  • Download URL: glm4free-0.1.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for glm4free-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e9d8a3e87a608f94f55ee3edf608abd609b3443e1a1985a89f2530c39968c651
MD5 71668ef1ce2205aa76c2dc446ff98bd4
BLAKE2b-256 5a046a0c76da4f41550c82332be0b46883d92b756ca4e77345208a99378f3581

See more details on using hashes here.

File details

Details for the file glm4free-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: glm4free-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for glm4free-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 764e5d1cc8a69b4ab8297d83f6e7b1341e8818b3a178f65da1e475a9390bbe29
MD5 d95da9bc65c49de536ae9deb53b3eb53
BLAKE2b-256 dd783f6293622c56178bcc89b8dff8f1b35b6d865f457c6ed5e0973ec95504a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page