aiforge-framework 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. aiforge_framework-0.3.0/PKG-INFO +18 -0
  2. aiforge_framework-0.3.0/README.md +109 -0
  3. aiforge_framework-0.3.0/pyproject.toml +34 -0
  4. aiforge_framework-0.3.0/setup.cfg +4 -0
  5. aiforge_framework-0.3.0/src/aiforge_framework.egg-info/PKG-INFO +18 -0
  6. aiforge_framework-0.3.0/src/aiforge_framework.egg-info/SOURCES.txt +56 -0
  7. aiforge_framework-0.3.0/src/aiforge_framework.egg-info/dependency_links.txt +1 -0
  8. aiforge_framework-0.3.0/src/aiforge_framework.egg-info/requires.txt +14 -0
  9. aiforge_framework-0.3.0/src/aiforge_framework.egg-info/top_level.txt +1 -0
  10. aiforge_framework-0.3.0/src/aipipe/__init__.py +49 -0
  11. aiforge_framework-0.3.0/src/aipipe/agents/__init__.py +5 -0
  12. aiforge_framework-0.3.0/src/aipipe/agents/agent.py +547 -0
  13. aiforge_framework-0.3.0/src/aipipe/agents/runner.py +18 -0
  14. aiforge_framework-0.3.0/src/aipipe/agents/task.py +9 -0
  15. aiforge_framework-0.3.0/src/aipipe/core/__init__.py +3 -0
  16. aiforge_framework-0.3.0/src/aipipe/core/context.py +30 -0
  17. aiforge_framework-0.3.0/src/aipipe/embeddings/__init__.py +5 -0
  18. aiforge_framework-0.3.0/src/aipipe/embeddings/client.py +79 -0
  19. aiforge_framework-0.3.0/src/aipipe/embeddings/config.py +38 -0
  20. aiforge_framework-0.3.0/src/aipipe/embeddings/factory.py +31 -0
  21. aiforge_framework-0.3.0/src/aipipe/exceptions.py +34 -0
  22. aiforge_framework-0.3.0/src/aipipe/llm/__init__.py +5 -0
  23. aiforge_framework-0.3.0/src/aipipe/llm/client.py +930 -0
  24. aiforge_framework-0.3.0/src/aipipe/llm/config.py +417 -0
  25. aiforge_framework-0.3.0/src/aipipe/llm/factory.py +198 -0
  26. aiforge_framework-0.3.0/src/aipipe/logs/__init__.py +3 -0
  27. aiforge_framework-0.3.0/src/aipipe/logs/logger.py +17 -0
  28. aiforge_framework-0.3.0/src/aipipe/mcp/__init__.py +4 -0
  29. aiforge_framework-0.3.0/src/aipipe/mcp/client.py +38 -0
  30. aiforge_framework-0.3.0/src/aipipe/mcp/config.py +23 -0
  31. aiforge_framework-0.3.0/src/aipipe/memory/__init__.py +4 -0
  32. aiforge_framework-0.3.0/src/aipipe/memory/in_memory.py +58 -0
  33. aiforge_framework-0.3.0/src/aipipe/memory/memory.py +17 -0
  34. aiforge_framework-0.3.0/src/aipipe/observability/__init__.py +5 -0
  35. aiforge_framework-0.3.0/src/aipipe/observability/events.py +22 -0
  36. aiforge_framework-0.3.0/src/aipipe/observability/trace.py +35 -0
  37. aiforge_framework-0.3.0/src/aipipe/observability/tracker.py +28 -0
  38. aiforge_framework-0.3.0/src/aipipe/observibility/__init__.py +3 -0
  39. aiforge_framework-0.3.0/src/aipipe/security/__init__.py +5 -0
  40. aiforge_framework-0.3.0/src/aipipe/security/detectors/__init__.py +5 -0
  41. aiforge_framework-0.3.0/src/aipipe/security/detectors/injection.py +25 -0
  42. aiforge_framework-0.3.0/src/aipipe/security/detectors/pii.py +25 -0
  43. aiforge_framework-0.3.0/src/aipipe/security/detectors/secrets.py +21 -0
  44. aiforge_framework-0.3.0/src/aipipe/security/manager.py +83 -0
  45. aiforge_framework-0.3.0/src/aipipe/security/policy.py +27 -0
  46. aiforge_framework-0.3.0/src/aipipe/security/result.py +21 -0
  47. aiforge_framework-0.3.0/src/aipipe/tools/__init__.py +5 -0
  48. aiforge_framework-0.3.0/src/aipipe/tools/executor.py +13 -0
  49. aiforge_framework-0.3.0/src/aipipe/tools/registry.py +39 -0
  50. aiforge_framework-0.3.0/src/aipipe/tools/tool.py +66 -0
  51. aiforge_framework-0.3.0/src/aipipe/workflows/__init__.py +3 -0
  52. aiforge_framework-0.3.0/src/aipipe/workflows/workflow.py +35 -0
  53. aiforge_framework-0.3.0/tests/test_core.py +23 -0
  54. aiforge_framework-0.3.0/tests/test_imports.py +8 -0
  55. aiforge_framework-0.3.0/tests/test_llm_config.py +26 -0
  56. aiforge_framework-0.3.0/tests/test_ollama.py +210 -0
  57. aiforge_framework-0.3.0/tests/test_security.py +21 -0
  58. aiforge_framework-0.3.0/tests/test_tools.py +14 -0
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: aiforge-framework
3
+ Version: 0.3.0
4
+ Summary: Provider-independent AI pipeline framework
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: pydantic>=2.7
7
+ Requires-Dist: pyyaml>=6.0
8
+ Requires-Dist: langchain<2,>=1.0
9
+ Requires-Dist: langchain-core<2,>=1.0
10
+ Requires-Dist: langchain-ollama<2,>=1.0
11
+ Requires-Dist: langchain-openai<2,>=1.0
12
+ Requires-Dist: langchain-google-genai<5,>=4.0
13
+ Requires-Dist: langgraph<2,>=1.0
14
+ Requires-Dist: ollama>=0.6
15
+ Requires-Dist: mcp<3,>=2.0
16
+ Provides-Extra: test
17
+ Requires-Dist: pytest>=8.0; extra == "test"
18
+ Requires-Dist: pytest-asyncio>=0.23; extra == "test"
@@ -0,0 +1,109 @@
1
+ # aipipe 0.3.0
2
+
3
+ Provider-independent AI framework with modules for:
4
+
5
+ - agents
6
+ - core
7
+ - embeddings
8
+ - llm
9
+ - mcp
10
+ - observability
11
+ - security
12
+ - tools
13
+ - workflows
14
+ - exceptions
15
+ - logs
16
+ - tests
17
+
18
+ ## Architecture
19
+
20
+ Application
21
+ |
22
+ v
23
+ aipipe
24
+ |
25
+ +-- llm
26
+ +-- embeddings
27
+ +-- agents
28
+ +-- tools
29
+ +-- memory
30
+ +-- security
31
+ +-- observability
32
+ +-- mcp
33
+ +-- workflows
34
+ +-- logs
35
+ +-- core
36
+
37
+ `aipipe` contains generic infrastructure only. Domain-specific logic such
38
+ as quiz security belongs in the consuming application.
39
+
40
+ ## Ollama modes
41
+
42
+ ### 1. Local Ollama / signed-in cloud model
43
+
44
+ After:
45
+
46
+ ollama signin
47
+
48
+ you can use cloud-backed models through the local Ollama service:
49
+
50
+ ollama run gemma4:cloud
51
+
52
+ Configuration:
53
+
54
+ provider: ollama
55
+ model: gemma4:cloud
56
+ base_url: http://localhost:11434
57
+
58
+ No API key is sent to localhost.
59
+
60
+ ### 2. Direct Ollama Cloud API
61
+
62
+ Configuration:
63
+
64
+ provider: ollama
65
+ model: gemma4:31b
66
+ base_url: https://ollama.com
67
+ api_key_env: OLLAMA_API_KEY
68
+
69
+ Never commit or print the API key.
70
+
71
+ ## Basic API
72
+
73
+ from aipipe import LLM
74
+
75
+ llm = LLM.from_config("config/llm.yaml")
76
+ print(llm.generate("Reply with exactly: HELLO"))
77
+
78
+ `LLM.from_config()` accepts:
79
+
80
+ - LLMConfig
81
+ - YAML path
82
+ - dictionary
83
+
84
+ ## Tests
85
+
86
+ Run all framework tests:
87
+
88
+ pytest -q
89
+
90
+ Run local signed-in Ollama tests:
91
+
92
+ pytest -q tests/test_ollama.py -m ollama_local
93
+
94
+ Run direct Cloud API tests:
95
+
96
+ pytest -q tests/test_ollama.py -m ollama_api
97
+
98
+ Run core tests only:
99
+
100
+ pytest -q tests/test_core.py tests/test_security.py tests/test_tools.py
101
+
102
+ The direct Cloud API test is intentionally a real inference test. A 401 is
103
+ reported as a failure; model-list access alone is not considered inference
104
+ health.
105
+
106
+ ## Logs
107
+
108
+ Runtime logs are written through `aipipe.logs`. Applications can configure
109
+ the logger without exposing prompts, responses, or secrets.
@@ -0,0 +1,34 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "aiforge-framework"
7
+ version = "0.3.0"
8
+ description = "Provider-independent AI pipeline framework"
9
+ requires-python = ">=3.11"
10
+
11
+ dependencies = [
12
+ "pydantic>=2.7",
13
+ "pyyaml>=6.0",
14
+ "langchain>=1.0,<2",
15
+ "langchain-core>=1.0,<2",
16
+ "langchain-ollama>=1.0,<2",
17
+ "langchain-openai>=1.0,<2",
18
+ "langchain-google-genai>=4.0,<5",
19
+ "langgraph>=1.0,<2",
20
+ "ollama>=0.6",
21
+ "mcp>=2.0,<3",
22
+ ]
23
+
24
+ [project.optional-dependencies]
25
+ test = [
26
+ "pytest>=8.0",
27
+ "pytest-asyncio>=0.23",
28
+ ]
29
+
30
+ [tool.setuptools]
31
+ package-dir = {"" = "src"}
32
+
33
+ [tool.setuptools.packages.find]
34
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: aiforge-framework
3
+ Version: 0.3.0
4
+ Summary: Provider-independent AI pipeline framework
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: pydantic>=2.7
7
+ Requires-Dist: pyyaml>=6.0
8
+ Requires-Dist: langchain<2,>=1.0
9
+ Requires-Dist: langchain-core<2,>=1.0
10
+ Requires-Dist: langchain-ollama<2,>=1.0
11
+ Requires-Dist: langchain-openai<2,>=1.0
12
+ Requires-Dist: langchain-google-genai<5,>=4.0
13
+ Requires-Dist: langgraph<2,>=1.0
14
+ Requires-Dist: ollama>=0.6
15
+ Requires-Dist: mcp<3,>=2.0
16
+ Provides-Extra: test
17
+ Requires-Dist: pytest>=8.0; extra == "test"
18
+ Requires-Dist: pytest-asyncio>=0.23; extra == "test"
@@ -0,0 +1,56 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/aiforge_framework.egg-info/PKG-INFO
4
+ src/aiforge_framework.egg-info/SOURCES.txt
5
+ src/aiforge_framework.egg-info/dependency_links.txt
6
+ src/aiforge_framework.egg-info/requires.txt
7
+ src/aiforge_framework.egg-info/top_level.txt
8
+ src/aipipe/__init__.py
9
+ src/aipipe/exceptions.py
10
+ src/aipipe/agents/__init__.py
11
+ src/aipipe/agents/agent.py
12
+ src/aipipe/agents/runner.py
13
+ src/aipipe/agents/task.py
14
+ src/aipipe/core/__init__.py
15
+ src/aipipe/core/context.py
16
+ src/aipipe/embeddings/__init__.py
17
+ src/aipipe/embeddings/client.py
18
+ src/aipipe/embeddings/config.py
19
+ src/aipipe/embeddings/factory.py
20
+ src/aipipe/llm/__init__.py
21
+ src/aipipe/llm/client.py
22
+ src/aipipe/llm/config.py
23
+ src/aipipe/llm/factory.py
24
+ src/aipipe/logs/__init__.py
25
+ src/aipipe/logs/logger.py
26
+ src/aipipe/mcp/__init__.py
27
+ src/aipipe/mcp/client.py
28
+ src/aipipe/mcp/config.py
29
+ src/aipipe/memory/__init__.py
30
+ src/aipipe/memory/in_memory.py
31
+ src/aipipe/memory/memory.py
32
+ src/aipipe/observability/__init__.py
33
+ src/aipipe/observability/events.py
34
+ src/aipipe/observability/trace.py
35
+ src/aipipe/observability/tracker.py
36
+ src/aipipe/observibility/__init__.py
37
+ src/aipipe/security/__init__.py
38
+ src/aipipe/security/manager.py
39
+ src/aipipe/security/policy.py
40
+ src/aipipe/security/result.py
41
+ src/aipipe/security/detectors/__init__.py
42
+ src/aipipe/security/detectors/injection.py
43
+ src/aipipe/security/detectors/pii.py
44
+ src/aipipe/security/detectors/secrets.py
45
+ src/aipipe/tools/__init__.py
46
+ src/aipipe/tools/executor.py
47
+ src/aipipe/tools/registry.py
48
+ src/aipipe/tools/tool.py
49
+ src/aipipe/workflows/__init__.py
50
+ src/aipipe/workflows/workflow.py
51
+ tests/test_core.py
52
+ tests/test_imports.py
53
+ tests/test_llm_config.py
54
+ tests/test_ollama.py
55
+ tests/test_security.py
56
+ tests/test_tools.py
@@ -0,0 +1,14 @@
1
+ pydantic>=2.7
2
+ pyyaml>=6.0
3
+ langchain<2,>=1.0
4
+ langchain-core<2,>=1.0
5
+ langchain-ollama<2,>=1.0
6
+ langchain-openai<2,>=1.0
7
+ langchain-google-genai<5,>=4.0
8
+ langgraph<2,>=1.0
9
+ ollama>=0.6
10
+ mcp<3,>=2.0
11
+
12
+ [test]
13
+ pytest>=8.0
14
+ pytest-asyncio>=0.23
@@ -0,0 +1,49 @@
1
+ from .exceptions import (
2
+ AIPipeError,
3
+ ConfigurationError,
4
+ ProviderError,
5
+ SecurityError,
6
+ )
7
+ from .core import AIContext
8
+ from .llm import LLM, LLMConfig, LLMResponse
9
+ from .embeddings import Embeddings, EmbeddingConfig
10
+ from .agents import Agent, AgentRunner, Task
11
+ from .tools import Tool, ToolRegistry, ToolExecutor
12
+ from .memory import Memory, InMemoryMemory
13
+ from .mcp import MCPClient, MCPConfig, MCPServerConfig
14
+ from .security import SecurityManager, SecurityPolicy, SecurityResult
15
+ from .observability import Event, Trace, Tracker
16
+ from .workflows import Workflow
17
+ from .logs import get_logger
18
+
19
+ __all__ = [
20
+ "AIPipeError",
21
+ "ConfigurationError",
22
+ "ProviderError",
23
+ "SecurityError",
24
+ "AIContext",
25
+ "LLM",
26
+ "LLMConfig",
27
+ "LLMResponse",
28
+ "Embeddings",
29
+ "EmbeddingConfig",
30
+ "Agent",
31
+ "AgentRunner",
32
+ "Task",
33
+ "Tool",
34
+ "ToolRegistry",
35
+ "ToolExecutor",
36
+ "Memory",
37
+ "InMemoryMemory",
38
+ "MCPClient",
39
+ "MCPConfig",
40
+ "MCPServerConfig",
41
+ "SecurityManager",
42
+ "SecurityPolicy",
43
+ "SecurityResult",
44
+ "Event",
45
+ "Trace",
46
+ "Tracker",
47
+ "Workflow",
48
+ "get_logger",
49
+ ]
@@ -0,0 +1,5 @@
1
+ from .agent import Agent
2
+ from .task import Task
3
+ from .runner import AgentRunner
4
+
5
+ __all__ = ["Agent", "Task", "AgentRunner"]