Skip to main content

Flexible LLM interface for Ollama and more

Project description

ZunnoAI

A flexible, modular Python package for using Ollama LLMs (and more in future).
Easily run, batch, and manage local LLMs with a simple interface.
PyPI-ready, extensible, and professional.


๐Ÿš€ Features

  • Supports all Ollama models (e.g. gemma, llama, mistral, etc.)
  • Easy Python API: Just import and use
  • Batch inference: Run multiple prompts at once
  • History logging: Track your prompt/response history
  • Auto model selection: Use any local Ollama model by name
  • Ready for future: HuggingFace/OpenAI support coming soon
  • PyPI installable: Clean, modular, and production-ready

๐Ÿ“ฆ Installation

Clone the repo and install locally:

git clone <your-repo-url>
cd zunnoai
pip install .

๐Ÿง‘โ€๐Ÿ’ป Usage Examples

List available models

from zunnoai import Zunno

llm = Zunno("gemma:2b")
print("Available models:", llm.list_models())

Run a prompt

from zunnoai import Zunno

llm = Zunno("gemma:2b")
response = llm.run("Tell me a joke about AI.")
print("AI:", response)

Batch prompts

from zunnoai import Zunno

llm = Zunno("gemma:2b")
prompts = ["What is Python?", "What is machine learning?"]
results = llm.run_batch(prompts)
for i, res in enumerate(results):
    print(f"Prompt {i+1}: {prompts[i]}\nAI: {res}\n")

Show history

from zunnoai import Zunno

llm = Zunno("gemma:2b")
llm.run("Say hello!")
llm.show_history()

CLI Usage

python -m zunnoai list
python -m zunnoai pull llama3
python -m zunnoai run gemma:2b "What is AI?"
python -m zunnoai --help

---

### 2. **examples/example_usage.py** (Update karo)

```python
from zunnoai import Zunno

# List available models
llm = Zunno("gemma:2b")
print("Available models:", llm.list_models())

# Run a prompt
response = llm.run("Tell me a joke about AI.")
print("AI:", response)

# Batch prompts
prompts = ["What is Python?", "What is machine learning?"]
results = llm.run_batch(prompts)
for i, res in enumerate(results):
    print(f"Prompt {i+1}: {prompts[i]}\nAI: {res}\n")

# Show history
llm.show_history()

3. Docstrings (Optional but Professional)

Aap chahein toh Zunno class aur public methods mein docstrings bhi add kar sakte hain, jaise:

class Zunno:
    """
    Main interface for using Ollama LLMs via Python or CLI.
    """
    def list_models(self):
        """
        List all available Ollama models on the local server.
        Returns: list of model names (str)
        """
        ...

4. README.md โ€” Features, Requirements, Contributing, License (Already Provided)

Aapka README.md already kaafi strong hai, bas usage section ko polish kar lo.


Aap yeh changes kar lo.
Jab ho jaaye, toh batao โ€” agla step (PyPI publish ya koi aur feature) shuru karenge!

โš™๏ธ API Reference

  • Zunno(model_name, ollama_url=..., output_format=..., log_to_file=..., log_file=...)
  • run(prompt, stream=False, **kwargs)
  • run_batch(prompts, **kwargs)
  • show_history()
  • help()

๐Ÿ—๏ธ Project Structure

zunnoai/ โ”œโ”€โ”€ zunnoai/ โ”‚ โ”œโ”€โ”€ core/ โ”‚ โ”œโ”€โ”€ models/ โ”‚ โ”œโ”€โ”€ api/ โ”‚ โ”œโ”€โ”€ utils/ โ”‚ โ””โ”€โ”€ config.py โ”œโ”€โ”€ tests/ โ”œโ”€โ”€ examples/ โ”œโ”€โ”€ setup.py โ”œโ”€โ”€ README.md โ””โ”€โ”€ LICENSE


๐Ÿ“ Requirements

  • Python 3.7+
  • Ollama running locally
  • requests Python package

๐Ÿ› ๏ธ Extending

  • Add new models in zunnoai/models/
  • Add new APIs in zunnoai/api/
  • Utilities in zunnoai/utils/

๐Ÿค Contributing

  1. Fork this repo
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

๐Ÿ“„ License

MIT License


๐Ÿ™‹โ€โ™‚๏ธ Contact

For issues or suggestions, open an issue or contact the maintainer.

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

zunnoai-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

zunnoai-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file zunnoai-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for zunnoai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1f960ee7a9027a9c8851ea153755f2ac6df13799cbabc6b5e8fe0d79a9749b14
MD5 0895bb24245bcfd2e6d1d9a3f4a3746c
BLAKE2b-256 81552edca87bd05df767bd75a3c07b6ace0b5da244c13f20313ecbcd3485678b

See more details on using hashes here.

File details

Details for the file zunnoai-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for zunnoai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c6fa150118746eb9d20e18c2f961839155c101c92f939dcbe784bb59ef8307c
MD5 f09c58cf95ecbe40c7dba362de080d4f
BLAKE2b-256 3feb49e810e38d140a599dd2f0a5222e4f26b44ce1b250ee51caab9309eaea44

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