Metadata-Version: 2.4
Name: ai_verse
Version: 1.0.2
Summary: Production-ready AI SDK for Security Scanning, Resume Intelligence, Voice Intelligence, REST APIs, CLI, and Multi-Provider LLM Integration.
Author-email: Mohiadeen Shifaul Kareem MI <shifaulkareem06@mail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/i-amshifa-06/ai_verse
Project-URL: Repository, https://github.com/i-amshifa-06/ai_verse
Project-URL: Documentation, https://i-amshifa-06.github.io/ai_verse
Project-URL: Issues, https://github.com/i-amshifa-06/ai_verse/issues
Project-URL: Changelog, https://github.com/i-amshifa-06/ai_verse/blob/main/CHANGELOG.md
Keywords: ai,llm,openrouter,openai,anthropic,gemini,grok,ollama,azure-openai,cybersecurity,phishing,smishing,resume,ats,speech-to-text,voice-ai,ocr,multimodal,fastapi,cli,python-sdk
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.12.0
Requires-Dist: rich>=13.7.0
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: requests>=2.32.0
Requires-Dist: fastapi>=0.115.0
Requires-Dist: uvicorn>=0.35.0
Requires-Dist: pydantic>=2.11.0
Requires-Dist: python-multipart>=0.0.20
Provides-Extra: ocr
Requires-Dist: PyMuPDF>=1.24.0; extra == "ocr"
Requires-Dist: pdfplumber>=0.11.0; extra == "ocr"
Requires-Dist: pypdf>=5.0.0; extra == "ocr"
Requires-Dist: pytesseract>=0.3.13; extra == "ocr"
Requires-Dist: Pillow>=11.0.0; extra == "ocr"
Provides-Extra: audio
Requires-Dist: faster-whisper>=1.1.0; extra == "audio"
Provides-Extra: dev
Requires-Dist: pytest>=8.4.0; extra == "dev"
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
Requires-Dist: black>=25.0.0; extra == "dev"
Requires-Dist: ruff>=0.12.0; extra == "dev"
Requires-Dist: mypy>=1.17.0; extra == "dev"
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=6.1.0; extra == "dev"
Requires-Dist: mkdocs-material>=9.6.0; extra == "dev"
Provides-Extra: all
Requires-Dist: PyMuPDF>=1.24.0; extra == "all"
Requires-Dist: pdfplumber>=0.11.0; extra == "all"
Requires-Dist: pypdf>=5.0.0; extra == "all"
Requires-Dist: pytesseract>=0.3.13; extra == "all"
Requires-Dist: Pillow>=11.0.0; extra == "all"
Requires-Dist: faster-whisper>=1.1.0; extra == "all"
Dynamic: license-file

# ai_verse

<p align="center">
  <img src="https://raw.githubusercontent.com/i-amshifa-06/ai_verse/main/docs/assets/banner.png" alt="ai_verse banner" width="600" />
</p>

<p align="center">
  <a href="https://pypi.org/project/ai_verse/"><img src="https://img.shields.io/pypi/v/ai_verse.svg" alt="PyPI Version"></a>
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10%2B-blue.svg" alt="Python Version"></a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
  <a href="https://github.com/i-amshifa-06/ai_verse/actions"><img src="https://github.com/i-amshifa-06/ai_verse/actions/workflows/tests.yml/badge.svg" alt="CI Build Status"></a>
  <a href="https://github.com/i-amshifa-06/ai_verse/actions"><img src="https://github.com/i-amshifa-06/ai_verse/actions/workflows/docker.yml/badge.svg" alt="Docker Build"></a>
</p>

**ai_verse** is an open-source, production-ready AI SDK, Command Line Interface (CLI), enterprise REST API server, and containerized microservice platform for Python.

---

## Features

- **Multi-Provider Engine**: Supports **OpenRouter**, **OpenAI**, **Anthropic**, **Google Gemini**, **xAI Grok**, **Local Ollama**, and **Azure OpenAI**.
- **Automatic Fallback Chain**: Transparent failover across backup providers if primary models experience downtime.
- **AI Security Scanners**: Integrated scanners for **SMS Smishing**, **WhatsApp Scams**, **Phishing Emails**, **Websites**, **Payment Receipts**, **QR Codes**, and **Android APK Malware**.
- **Document & Vision Intelligence**: 4-stage PDF/OCR extraction pipeline (PyMuPDF -> pdfplumber -> pypdf -> pytesseract) for **ATS Resume Analysis** and **Receipt Processing**.
- **Voice Intelligence**: Real speech-to-text audio transcription powered by `faster-whisper`.
- **Enterprise REST API Server**: Async FastAPI server (`/api/v1`) with OpenAPI/Swagger documentation (`/docs`) and file upload endpoints.
- **Rich CLI Tool**: Command-line application `ai-verse` powered by Typer and Rich.
- **Plugin Framework**: Dynamic plugin loader, manager, and lifecycle hooks (`before_request`, `after_request`, `before_scan`, `after_scan`).
- **Caching System**: High-performance in-memory (`MemoryCache`) and persistent disk (`DiskCache`) caching with TTL support.
- **Production Containerization**: Multi-stage Docker image running under non-root user `appuser` (UID 10001) with healthchecks.

---

## Architecture

```
                  ┌───────────────────────────────┐
                  │       AI Facade (AI())        │
                  └──────────────┬────────────────┘
                                 │
         ┌───────────────────────┼───────────────────────┐
         ▼                       ▼                       ▼
┌──────────────────┐   ┌──────────────────┐   ┌──────────────────┐
│  Security Scans  │   │     Doc & Vision │   │Voice Intelligence│
└──────────────────┘   └──────────────────┘   └──────────────────┘
         │                       │                       │
         └───────────────────────┼───────────────────────┘
                                 ▼
                     ┌───────────────────────┐
                     │   Provider Factory    │
                     └───────────┬───────────┘
                                 │
       ┌───────────┬───────────┼───────────┬───────────┐
       ▼           ▼           ▼           ▼           ▼
┌─────────────┐┌─────────┐┌──────────┐┌─────────┐┌───────────┐
│ OpenRouter  ││ OpenAI  ││Anthropic ││ Gemini  ││  Ollama   │
└─────────────┘└─────────┘└──────────┘└─────────┘└───────────┘
```

---

## Installation & Clone

```bash
git clone https://github.com/i-amshifa-06/ai_verse.git
cd ai_verse
pip install ai_verse
```

For extra features:
```bash
# Install with audio processing support (faster-whisper)
pip install ai_verse[audio]

# Install with document OCR support (pytesseract & pdfplumber)
pip install ai_verse[ocr]
```

---

## Environment Setup

Copy `.env.example` to `.env` or set your API key:

```bash
export OPENROUTER_API_KEY="sk-or-v1-your_openrouter_api_key_here"
```

For other providers:
- `OPENAI_API_KEY`: OpenAI API Key
- `ANTHROPIC_API_KEY`: Anthropic Claude API Key
- `GOOGLE_API_KEY`: Google Gemini API Key
- `XAI_API_KEY`: xAI Grok API Key
- `OLLAMA_BASE_URL`: Local Ollama endpoint (default `http://localhost:11434`)

---

## Quick Start Examples

### 1. Python SDK

```python
from ai_verse import AI

# Initialize AI facade with OpenAI (or default OpenRouter)
ai = AI(provider="openai")

# Chat Completion
response = ai.chat("Explain zero trust network architecture in 2 sentences.")
print(response.data["text"])

# SMS Smishing Scan
sms_res = ai.scan_sms("URGENT: Your account is locked. Verify at http://bit.ly/fake")
print(f"Risk Score: {sms_res.data['risk_score']}/100 | Risk Level: {sms_res.data['risk_level']}")

# Resume Analysis
resume_res = ai.analyze_resume("resume.pdf", job_description="AppSec Engineer")
print(f"ATS Score: {resume_res.data['ats_score']}%")
```

---

### 2. Command Line Interface (CLI)

```bash
ai-verse chat "Explain quantum computing in simple terms."
ai-verse scan sms "Verify account at http://bit.ly/fake"
ai-verse resume analyze resume.pdf --job-description "AppSec Engineer"
ai-verse doctor
```

---

### 3. FastAPI REST API Server

```bash
uvicorn ai_verse.api.main:app --host 0.0.0.0 --port 8000 --reload
```

Visit `http://localhost:8000/docs` for Swagger UI.

---

### 4. Production Docker

```bash
docker build -f docker/Dockerfile -t ai-verse:latest .

docker run -d --name ai-verse-server \
  -p 8000:8000 \
  -e OPENROUTER_API_KEY="your_api_key_here" \
  ai-verse:latest
```

---

## Showcase & Frontend Integrations

Complete cross-platform showcase examples available under [`examples/showcase/`](examples/showcase/):
- **React / Next.js**: [`examples/showcase/nextjs_route_snippet.ts`](examples/showcase/nextjs_route_snippet.ts)
- **Flutter**: [`examples/showcase/flutter_client.dart`](examples/showcase/flutter_client.dart)
- **Electron**: [`examples/showcase/electron_preload.js`](examples/showcase/electron_preload.js)
- **Node.js**: [`examples/showcase/nodejs_client.js`](examples/showcase/nodejs_client.js)

---

## Documentation

Full documentation is available at [https://i-amshifa-06.github.io/ai_verse](https://i-amshifa-06.github.io/ai_verse) or under [`docs/`](docs/):
- [Developer Guide](docs/DEVELOPER_GUIDE.md)
- [Provider Guide](docs/PROVIDER_GUIDE.md)
- [Plugin Guide](docs/PLUGIN_GUIDE.md)
- [API Reference](docs/api_reference.md)
- [Benchmarks](docs/benchmarks.md)

---

## Contributing

We welcome community contributions! Please read [`CONTRIBUTING.md`](CONTRIBUTING.md) and [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).

---

## License

`ai_verse` is licensed under the [MIT License](LICENSE).
