A library for agent and environment protocol interactions
Project description
Interaxions
A modern, extensible framework for orchestrating AI agents and environments on Kubernetes/Argo Workflows, inspired by HuggingFace Transformers.
โจ Features
- ๐ฏ Job-Based Configuration - Unified
Jobschema for complete workflow definition - ๐ Dynamic Loading - Load components from built-in, local, or remote Git repositories
- ๐ Unified API - All
Auto*classes use consistentfrom_repo()interface - ๐ฆ Three-Layer Architecture - Scaffolds, Environments, and Workflows
- ๐ท๏ธ Version Control - Support for Git tags, branches, and commits
- ๐ Multi-Process Safe - File locks for concurrent access
- ๐พ Smart Caching - Three-level cache system for optimal performance
- ๐ Flexible Sources - GitHub, GitLab, HuggingFace, OSS, or custom sources
- โ Comprehensive Testing - 53 unit tests with pytest
๐ Quick Start
Installation
# Basic installation
pip install interaxions
# With optional dependencies
pip install interaxions[argo] # Argo Workflows support
pip install interaxions[hf] # HuggingFace datasets
pip install interaxions[oss] # OSS storage support
# For development
pip install -e ".[dev]"
Basic Usage (Job-Based API)
from interaxions import AutoWorkflow
from interaxions.schemas import Job, Scaffold, Environment, Workflow, Runtime, LiteLLMModel
# Define a complete job configuration
job = Job(
name="fix-django-bug",
description="Fix Django bug using SWE-agent",
tags=["swe-bench", "django"],
labels={"priority": "high", "team": "research"},
# Model configuration
model=LiteLLMModel(
type="litellm",
provider="openai",
model="gpt-4",
base_url="https://api.openai.com/v1",
api_key="your-api-key",
),
# Scaffold (agent) configuration
scaffold=Scaffold(
repo_name_or_path="swe-agent",
params={"max_iterations": 10},
),
# Environment configuration
environment=Environment(
repo_name_or_path="swe-bench",
environment_id="django__django-12345",
source="hf",
params={
"dataset": "princeton-nlp/SWE-bench",
"split": "test",
},
),
# Workflow configuration
workflow=Workflow(
repo_name_or_path="rollout-and-verify",
params={},
),
# Runtime configuration
runtime=Runtime(
namespace="experiments",
service_account="argo-workflow",
ttl_seconds_after_finished=3600,
),
)
# Create and submit workflow
workflow_template = AutoWorkflow.from_repo(job.workflow.repo_name_or_path)
workflow = workflow_template.create_workflow(job)
workflow.create() # Submit to Argo
Quick API (One-Step Loading)
from interaxions import AutoScaffold, AutoEnvironment, AutoWorkflow
# Load scaffold
scaffold = AutoScaffold.from_repo("swe-agent")
# Load environment (unified API)
env = AutoEnvironment.from_repo(
repo_name_or_path="swe-bench",
environment_id="django__django-12345",
source="hf",
dataset="princeton-nlp/SWE-bench",
split="test",
)
# Load workflow
workflow_template = AutoWorkflow.from_repo("rollout-and-verify")
๐ Core Concepts
1. Job - Unified Configuration
Job is the central schema that encapsulates all information needed to run a workflow:
from interaxions.schemas import Job
job = Job(
# Metadata
name="my-job",
description="Job description",
tags=["tag1", "tag2"],
labels={"key": "value"},
# Components (all use from_repo pattern)
model=..., # LLM configuration
scaffold=..., # Agent/scaffold configuration
environment=..., # Environment/data configuration
workflow=..., # Workflow orchestration
runtime=..., # Kubernetes/Argo settings
)
2. Three-Layer Architecture
Scaffolds (formerly Agents)
- High-level orchestration logic
- Can manage single or multiple agents internally
- Example:
swe-agent
Environments
- Test environments and evaluation datasets
- Support HuggingFace, OSS, and custom sources
- Example:
swe-bench
Workflows
- Define execution order and dependencies
- Generate Argo Workflows
- Example:
rollout-and-verify
3. Dynamic Loading
All components use the from_repo() pattern:
# Built-in
component = Auto*.from_repo("component-name")
# Local path
component = Auto*.from_repo("./my-component")
# Remote repository (GitHub)
component = Auto*.from_repo("username/repo-name")
# With specific version
component = Auto*.from_repo("username/repo", revision="v1.0.0")
๐จ Loading Sources
Built-in Components
from interaxions import AutoScaffold, AutoEnvironment, AutoWorkflow
# Load built-in components
scaffold = AutoScaffold.from_repo("swe-agent")
workflow = AutoWorkflow.from_repo("rollout-and-verify")
Environment Loading (Unified API)
from interaxions import AutoEnvironment
# From HuggingFace
env = AutoEnvironment.from_repo(
repo_name_or_path="swe-bench",
environment_id="django-123",
source="hf",
dataset="princeton-nlp/SWE-bench",
split="test",
)
# From OSS
env = AutoEnvironment.from_repo(
repo_name_or_path="swe-bench",
environment_id="django-123",
source="oss",
dataset="swe-bench-data",
split="test",
oss_region="cn-hangzhou",
oss_endpoint="oss-cn-hangzhou.aliyuncs.com",
oss_access_key_id="your-key-id",
oss_access_key_secret="your-secret",
)
Batch Loading (Factory Pattern)
from interaxions import AutoEnvironmentFactory
# Load factory once
factory = AutoEnvironmentFactory.from_repo("swe-bench")
# Create multiple environments efficiently
env1 = factory.get_from_hf("django-123", "dataset", "test")
env2 = factory.get_from_hf("flask-456", "dataset", "test")
env3 = factory.get_from_hf("numpy-789", "dataset", "test")
๐ง Environment Variables (Optional)
All environment variables have sensible defaults and are optional:
| Variable | Description | Default |
|---|---|---|
IX_HOME |
Base directory for Interaxions data | ~/.interaxions |
IX_HUB_CACHE |
Cache directory for hub modules | ~/.interaxions/hub |
IX_OFFLINE |
Enable offline mode (no network) | false |
IX_ENDPOINT |
Custom Git endpoint for remote repos | GitHub |
Example:
export IX_HOME=/custom/path
export IX_OFFLINE=true
๐ฆ Creating Custom Components
See Repository Standards for detailed requirements.
Minimum Requirements
Scaffold Repository:
my-scaffold/
โโโ config.yaml # type: my-scaffold
โโโ agent.py # Class inheriting from BaseScaffold
โโโ templates/ # Optional Jinja2 templates
โโโ main.j2
Environment Repository:
my-environment/
โโโ config.yaml # type: my-environment
โโโ env.py # Factory inheriting from BaseEnvironmentFactory
Workflow Repository:
my-workflow/
โโโ config.yaml # type: my-workflow
โโโ workflow.py # Class inheriting from BaseWorkflow
All components must implement:
from_repo(repo_name_or_path, revision)class methodcreate_task(job, **kwargs)orcreate_workflow(job, **kwargs)method
๐งช Testing
# Run unit tests (fast, reliable)
pytest -m unit
# Run all tests
pytest
# With coverage
pytest --cov=interaxions --cov-report=html
# View coverage report
open htmlcov/index.html
See tests/README.md for detailed testing documentation.
๐ Project Structure
interaxions/
โโโ scaffolds/ # Agent scaffold implementations
โ โโโ base_scaffold.py
โ โโโ swe_agent/
โโโ environments/ # Environment implementations
โ โโโ base_environment.py
โ โโโ swe_bench/
โโโ workflows/ # Workflow implementations
โ โโโ base_workflow.py
โ โโโ rollout_and_verify/
โโโ schemas/ # Pydantic schemas (Job, Scaffold, etc.)
โ โโโ job.py
โ โโโ models.py
โโโ hub/ # Dynamic loading system
โโโ auto.py # Auto* classes
โโโ hub_manager.py # Repository management
โโโ constants.py # Configuration
tests/ # Comprehensive test suite
โโโ unit/ # Unit tests (53 tests, all passing)
โโโ integration/ # Integration tests
โโโ e2e/ # End-to-end tests
โโโ conftest.py # Shared fixtures
examples/ # Usage examples
โโโ quickstart.py # Complete tutorial
๐ Development Workflow
# Clone repository
git clone https://github.com/Hambaobao/interaxions.git
cd interaxions
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest -m unit
# Run examples
python examples/quickstart.py
# Build package
python -m build
# Check package
twine check dist/*
๐ Documentation
- Repository Standards - Complete guide for creating custom components
- Testing Guide - Comprehensive testing documentation
- Examples - Example implementations and tutorials
๐ค Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass:
pytest -m unit - Submit a pull request
๐ License
MIT License - see LICENSE for details
๐ Acknowledgments
- Inspired by HuggingFace Transformers
- Built on Hera for Argo Workflows
- Powered by Pydantic for data validation
๐ Links
- Homepage: https://github.com/Hambaobao/interaxions
- Issues: https://github.com/Hambaobao/interaxions/issues
- PyPI: Coming soon
Made with โค๏ธ for the AI agent research community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interaxions-0.0.1.post1.tar.gz.
File metadata
- Download URL: interaxions-0.0.1.post1.tar.gz
- Upload date:
- Size: 39.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb0aaa89ee3bb8319957210a801637266213250d2a2d2fd50296c1ac49187054
|
|
| MD5 |
138a8c2e4a6a045f8af6133476b6f2ff
|
|
| BLAKE2b-256 |
dc398efde270a74dde5e0c649c01c63621cdce992ebbd6c06d6290cc55d6e7fc
|
Provenance
The following attestation bundles were made for interaxions-0.0.1.post1.tar.gz:
Publisher:
python-publish.yaml on Hambaobao/interaxions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interaxions-0.0.1.post1.tar.gz -
Subject digest:
cb0aaa89ee3bb8319957210a801637266213250d2a2d2fd50296c1ac49187054 - Sigstore transparency entry: 777505857
- Sigstore integration time:
-
Permalink:
Hambaobao/interaxions@a689f4804c6aedc1885d50698244e41eb2276ac8 -
Branch / Tag:
refs/tags/v0.0.1.post1 - Owner: https://github.com/Hambaobao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@a689f4804c6aedc1885d50698244e41eb2276ac8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file interaxions-0.0.1.post1-py3-none-any.whl.
File metadata
- Download URL: interaxions-0.0.1.post1-py3-none-any.whl
- Upload date:
- Size: 39.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc295fe3e81eb8b478851bc85be8a7a9105d4ca7b478326e4965cd7e6a56a375
|
|
| MD5 |
ae03f23edf24b0fd24493dd182914e56
|
|
| BLAKE2b-256 |
5f24fdcad279feacabf5217e02103eeb0921f94d0b47cf6affa3a1eb0d1db9a6
|
Provenance
The following attestation bundles were made for interaxions-0.0.1.post1-py3-none-any.whl:
Publisher:
python-publish.yaml on Hambaobao/interaxions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interaxions-0.0.1.post1-py3-none-any.whl -
Subject digest:
dc295fe3e81eb8b478851bc85be8a7a9105d4ca7b478326e4965cd7e6a56a375 - Sigstore transparency entry: 777505897
- Sigstore integration time:
-
Permalink:
Hambaobao/interaxions@a689f4804c6aedc1885d50698244e41eb2276ac8 -
Branch / Tag:
refs/tags/v0.0.1.post1 - Owner: https://github.com/Hambaobao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yaml@a689f4804c6aedc1885d50698244e41eb2276ac8 -
Trigger Event:
push
-
Statement type: