🏗️ AI Foundation Kit
The Professional / Development-First Standard for AI/ML Applications
ai-foundation-kit is an enterprise-grade Python library designed to provide the bedrock for building scalable, robust, and maintainable AI systems. It unifies core utilities—logging, exception handling, file management, model loading, and configuration—under a single, cohesive namespace: AIFoundationKit.
Designed for: RAG, Generative AI, Agentic Workflows, Deep Learning, and Machine Learning.
📦 Installation
From PyPI (Recommended)
pip install ai-foundation-kit
From Source (Development)
git clone https://github.com/aignishant/ai-foundation-kit.git
cd ai-foundation-kit
pip install -e .
🏛️ Package Architecture
The package is structured under the AIFoundationKit namespace. Each submodule targets a specific domain of AI application development.
| Module | Import Path | Description | Key Components |
|---|---|---|---|
| Base | AIFoundationKit.base |
The Core Foundation. Essential utilities required by every application. | BaseFileManager, ApiKeyManager, AppException, Logger |
| RAG | AIFoundationKit.rag |
Retrieval-Augmented Generation. Tools for LLM loading and prompting. | ModelLoader, BaseProvider, GenericPrompts |
| GenAI | AIFoundationKit.genai |
Generative AI. (Upcoming) Specialized tools for image/video generation. | Planned |
| Agentic | AIFoundationKit.agentic |
Agentic AI. (Upcoming) Frameworks for autonomous agents. | Planned |
| ML | AIFoundationKit.ml |
Machine Learning. (Upcoming) Scikit-learn wrappers & utilities. | Planned |
| DL | AIFoundationKit.dl |
Deep Learning. (Upcoming) Torch/Tensorflow helpers. | Planned |
🛠️ Usage Guide
1. File Management (AIFoundationKit.base)
Stop writing boilerplate file readers. Use the BaseFileManager to handle PDFs, DOCX, JSON, and more seamlessly.
from AIFoundationKit.base.file_manager import BaseFileManager
file_manager = BaseFileManager()
# Read ANY file type (PDF, DOCX, CSV, TXT, etc.)
content = file_manager.read_file("path/to/document.pdf")
print(content[:100])
# Save files (handling bytes or file-like objects)
saved_path = file_manager.save_file(
file_obj=b"Binary data",
save_dir="data/uploads",
file_name="invoice.pdf"
)
2. Model Loading (AIFoundationKit.rag)
Instantly switch between Google Gemini, Groq, or your own custom providers without changing application logic.
from AIFoundationKit.rag.model_loader import ModelLoader
# Initialize (loads config.yaml automatically or uses defaults)
loader = ModelLoader()
# Load LLM (Gemini Pro by default or configured)
llm = loader.load_llm(model_name="gemini-1.5-pro")
# Load Embeddings
embeddings = loader.load_embeddings()
# Use in LangChain
chain = prompt | llm
3. API Key Management (AIFoundationKit.base)
Securely manage keys from Environment Variables or Secret Stores.
from AIFoundationKit.base.model import ApiKeyManager
key_mgr = ApiKeyManager()
google_key = key_mgr.get("GOOGLE_API_KEY")
4. Enterprise Logging & Exceptions
Standardized structured logging and error handling.
from AIFoundationKit.base.logger.custom_logger import logger
from AIFoundationKit.base.exception.custom_exception import AppException
try:
logger.info("Starting process", extra={"user_id": "12345"})
# ... logic ...
except Exception as e:
# Auto-wraps with standard error codes
raise AppException(f"Process failed: {str(e)}") from e
🔮 Futuristic Example: The Agentic Workflow
Here is a glimpse of how you can build an autonomous file analysis agent using AIFoundationKit.
from AIFoundationKit.base.file_manager import BaseFileManager
from AIFoundationKit.rag.model_loader import ModelLoader
from AIFoundationKit.rag.prompts import get_generic_prompt
async def run_autonomous_analyst(file_path: str):
# 1. Perception: Read the File
fm = BaseFileManager()
file_content = fm.read_file(file_path)
# 2. Brain: Initialize Neural Core (LLM)
loader = ModelLoader()
llm = loader.load_llm(provider="groq", model_name="llama-3.3-70b-versatile")
# 3. Cognition: Analyze with Generic Prompt
analysis_prompt = get_generic_prompt("summary")
chain = analysis_prompt | llm
result = chain.invoke({"input_text": file_content})
print("🤖 Analyst Report:")
print(result.content)
# Execution
# await run_autonomous_analyst("contracts/q4_financials.pdf")
📝 Changelog
| Version | Changes |
|---|---|
| v0.1.4 | • Update: Maintenance release. • Core: Same stable features as v0.1.1. |
| v0.1.3 | • Update: Bumped version due to PyPI conflict. • Core: Same stable features as v0.1.1. |
| v0.1.1 | • Update: Config/Readme update (Stable). • Core: Includes base (File/Key Utils), rag (Model Loading), logging, exceptions. |
| v0.1.0 | • Initial Release: Fresh launch of ai-foundation-kit (Stable).• Core: Includes base (File/Key Utils), rag (Model Loading), logging, exceptions. |
License
MIT License
Metadata
Release files for ai-foundation-kit 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ai_foundation_kit-0.1.6.tar.gz | 12.7 kB | Without provenance | Details for ai_foundation_kit-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ai_foundation_kit-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for ai_foundation_kit-0.1.6-py3-none-any.whl |
Total release size: 29.1 kB
Release files / ai_foundation_kit-0.1.6.tar.gz
| Download URL | ai_foundation_kit-0.1.6.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e844c442fed3a0b21c67255d7ccf9b182362b86f34e39ecea238c9e4b9a336ec
|
|
BLAKE2b-256 checksum How to use checksums |
8b561c4905254e73c62336de1d749fda5c917c83378e9a1619b2daf5d90a9c16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / ai_foundation_kit-0.1.6-py3-none-any.whl
| Download URL | ai_foundation_kit-0.1.6-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
086a46a1f59aaa962f9f4b8376ba8de753af197c8b019d456df33815487d57c5
|
|
BLAKE2b-256 checksum How to use checksums |
988056394b28dc19fa0f8f230d875de26dd2cf6be82011a701a5eedbb9d52631
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for ai-foundation-kit 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.