Skip to content

grok-ai-toolkit

Python

Python wrapper and CLI for xAI Grok.

A lightweight Python API wrapper and CLI for xAI's Grok language models. Supports chat, text completion, and vision analysis with local images and URLs.

python grok xai cli

[features]

Vision Analysis

Process local images and URLs

Interactive Chat

Conversation history management

Streaming Responses

Real-time output

Configurable

Temperature, tokens, penalties

[install]

git clone https://github.com/RMNCLDYO/grok-ai-toolkit.git
cd grok-ai-toolkit
pip install -r requirements.txt

[usage]

# CLI
python cli.py --chat
python cli.py --text --prompt "Write a story"
python cli.py --vision --prompt "Describe" --image_path photo.jpg

# Python
from grok import Chat, Text, Vision
Chat().run()
Vision().run(prompt="Describe", image_url="https://...")

[requirements]

[license]

This project is licensed under the MIT license.

[links]