Skip to main content

Production AI SDK, CLI, REST API, and Multimodal Intelligence Platform for Python.

Project description

ai_verse

ai_verse banner

PyPI Version Python Version License: MIT CI Build Status Docker Build

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

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

For extra features:

# 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:

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

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)

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

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

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/:


Documentation

Full documentation is available at https://i-amshifa-06.github.io/ai_verse or under docs/:


Contributing

We welcome community contributions! Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md.


License

ai_verse is licensed under the MIT License.

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

ai_verse-1.0.0.tar.gz (85.8 kB view details)

Uploaded Source

Built Distribution

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

ai_verse-1.0.0-py3-none-any.whl (99.7 kB view details)

Uploaded Python 3

File details

Details for the file ai_verse-1.0.0.tar.gz.

File metadata

  • Download URL: ai_verse-1.0.0.tar.gz
  • Upload date:
  • Size: 85.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for ai_verse-1.0.0.tar.gz
Algorithm Hash digest
SHA256 633106543ff3ff3eed4fb703053b444aae88dc0bec9010cd2d1eef4069a8bfd0
MD5 bacbdbd91d3bc9238f6d6e4ef60448ce
BLAKE2b-256 93ec11f9ed8da0daf6a991e3369809b431570c0cbc1f7b60544dedc4d6ec4fca

See more details on using hashes here.

File details

Details for the file ai_verse-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ai_verse-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 99.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for ai_verse-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a558364251cfdeb5b5c963fe7c29d5ed8278224810e345864c3fd5d9f584aa7c
MD5 20c6121a59fead48870c3e63362c3642
BLAKE2b-256 c3b3920477c0d4918b0cb1e74f889022d19612f4a889a1ced6c55bd86654b5b8

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