Skip to content

Add CLI example for streaming Ollama responses live_ollama_cli.py #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bhuvanesh-m-dev
Copy link

🚀 Add a Live Streaming CLI for Real-Time Interaction with Ollama

This PR introduces a vibrant and interactive CLI tool located at examples/live_ollama_cli.py, designed to showcase how users can connect with Ollama's local REST API in a lively, character-by-character streaming experience — just like chatting with a real AI assistant.

🎯 Highlights:

  • ✨ Accepts prompts via command-line arguments or interactive input
  • 💬 Streams Ollama model responses letter-by-letter in real time
  • ⚡️ Feels like a live chat, not just a dump of text
  • 🧱 Built with clean Python and requests (no heavy dependencies)
  • 🧪 Simple UX with a “Thinking...” status and clean terminal output

📍 Use Case:
Perfect for developers who want a fast, minimal, and engaging way to test Ollama locally without writing a full app or using Python notebooks.

🧪 Tested with:

  • Model: tinyllama
  • API: http://localhost:11434

Thanks for checking this out! Hope this example helps more users start building cool interfaces with Ollama. 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant