Skip to main content

openstackai Distribution Guide

Installation Methods

1. Install from PyPI (Coming Soon)

# Basic installation
pip install openstackai

# With OpenAI support
pip install openstackai[openai]

# With Azure support (recommended for enterprise)
pip install openstackai[azure]

# All features
pip install openstackai[all]

2. Install from Source

# Clone the repository
git clone https://github.com/gitpavleenbali/PYAI.git
cd PYAI

# Install in development mode
pip install -e .[all]

3. Install from ZIP Distribution

  1. Download openstackai-X.X.X-release.zip
  2. Extract to your preferred location
  3. Install:
    cd openstackai-X.X.X-release
    pip install .

Optional Dependencies

ExtraIncludesUse Case
openaiopenai SDKOpenAI API access
anthropicanthropic SDKClaude API access
azureazure-identity, azure-search-documents, openaiAzure OpenAI & AI Search
webaiohttp, requests, beautifulsoup4Web scraping & fetching
docspypdf, python-docxDocument processing
langchainlangchain, langchain-communityLangChain integration
semantic-kernelsemantic-kernelMicrosoft SK integration
vectorchromadb, faiss-cpu, pinecone, qdrantVector databases
allEverything aboveFull functionality
devpytest, black, ruff, mypy, pre-commitDevelopment tools

Example Installations

# For Azure enterprise deployment
pip install openstackai[azure,web,docs]

# For RAG applications
pip install openstackai[openai,vector,web]

# For LangChain users
pip install openstackai[openai,langchain]

# For development
pip install -e .[all,dev]

Building from Source

Prerequisites

  • Python 3.9+
  • Git
  • pip

Build Commands (Windows PowerShell)

# Build wheel and sdist
.\build.ps1 build

# Create ZIP distribution
.\build.ps1 zip

# Full build (clean + build + zip)
.\build.ps1 all

# Install locally
.\build.ps1 install

# Run tests
.\build.ps1 test

Build Commands (Cross-platform)

# Install build tools
pip install build wheel

# Build distribution packages
python -m build

# Output: dist/openstackai-X.X.X.tar.gz and dist/openstackai-X.X.X-py3-none-any.whl

Package Structure

openstackai-X.X.X-release/
├── openstackai/ # Main package
│ ├── __init__.py # Package root
│ ├── py.typed # PEP 561 marker
│ ├── easy/ # One-liner functions
│ ├── core/ # Core components
│ ├── skills/ # Agent skills
│ ├── blueprint/ # Blueprints & patterns
│ ├── instructions/ # Instruction builders
│ ├── integrations/ # External integrations
│ ├── orchestrator/ # Workflow orchestration
│ └── usecases/ # Pre-built templates
├── examples/ # Example scripts
├── docs/ # Documentation
├── README.md # Main documentation
├── LICENSE # MIT License
├── pyproject.toml # Package configuration
└── setup.py # Backward compatibility

Verification

After installation, verify openstackai is working:

# Basic verification
import openstackai
print(f"openstackai version: {openstackai.__version__}")

# Check available functions
from openstackai import ask, agent, research
print("Core functions available!")

# Test with mock (no API key needed)
from openstackai.easy.config import config
config.enable_mock(True)

response = ask("Hello!")
print(f"Mock response: {response}")

Azure Setup

For Azure OpenAI deployment:

1. Create Azure Resources

# Create resource group
az group create --name rg-openstackai --location eastus2

# Create Azure OpenAI resource
az cognitiveservices account create \
--name openstackai-openai \
--resource-group rg-openstackai \
--kind OpenAI \
--sku S0 \
--location eastus2

# Deploy a model
az cognitiveservices account deployment create \
--name openstackai-openai \
--resource-group rg-openstackai \
--deployment-name gpt-4o-mini \
--model-name gpt-4o-mini \
--model-version "2024-07-18" \
--model-format OpenAI \
--sku-capacity 10 \
--sku-name Standard

2. Configure openstackai

from openstackai.easy.config import config

# Option 1: Using Azure AD (recommended)
config.use_azure(
endpoint="https://openstackai-openai.openai.azure.com",
deployment="gpt-4o-mini",
api_version="2024-02-15-preview"
)

# Option 2: Using API key
config.use_azure(
endpoint="https://openstackai-openai.openai.azure.com",
deployment="gpt-4o-mini",
api_key="your-api-key"
)

3. Use openstackai

from openstackai import ask

# Now uses Azure OpenAI
response = ask("What is Azure?")
print(response)

Publishing to PyPI

1. Prepare for Release

# Update version in pyproject.toml
# Update CHANGELOG.md
# Commit all changes
git add -A
git commit -m "Release vX.X.X"
git tag vX.X.X
git push origin main --tags

2. Build Distribution

.\build.ps1 clean
.\build.ps1 build

3. Upload to PyPI

# Install twine
pip install twine

# Upload to Test PyPI first
twine upload --repository testpypi dist/*

# Test installation
pip install --index-url https://test.pypi.org/simple/ openstackai

# If successful, upload to production PyPI
twine upload dist/*

Enterprise Distribution

For enterprise/internal distribution:

Azure DevOps Artifacts

# azure-pipelines.yml
trigger:
- main

pool:
vmImage: 'ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.11'

- script: |
pip install build twine
python -m build
displayName: 'Build Package'

- task: TwineAuthenticate@1
inputs:
artifactFeed: 'MyOrg/MyFeed'

- script: |
twine upload -r MyFeed --config-file $(PYPIRC_PATH) dist/*
displayName: 'Publish to Artifacts'

Local Package Repository

# Create local package folder
mkdir /path/to/packages

# Copy wheel file
cp dist/openstackai-*.whl /path/to/packages/

# Install from local
pip install --find-links=/path/to/packages openstackai

Troubleshooting

Common Issues

Import Error: No module named 'openstackai'

  • Ensure you installed in the correct Python environment
  • Check: pip show openstackai

Azure Authentication Error

  • Run az login to authenticate
  • Ensure azure-identity is installed: pip install azure-identity

Optional dependency not found

  • Install the specific extra: pip install openstackai[extra_name]

Getting Help