跳到正文
GitHub·· 6 天前AI 评分20

DAMIAO TECH AI 开源 Local AI Orchestrator Core 本地 AI 运行时原语

markmiaoxg008/LocalAIOrchestrator-Core-DAMIAO-TECH-AI

AI 导读

DAMIAO TECH AI 开源 Local AI Orchestrator Core,提供本地优先 AI 应用的原子化 Python 运行时原语,包含原子文件持久化、可执行文件解析与受控命令执行、本地/云端 provider 路由与故障转移、工作区迁移就绪检查,无需完整 AI-agent 框架。

正文

Local AI Orchestrator Core — DAMIAO TECH AI

Small, reusable Python runtime primitives for local-first AI applications. This project provides atomic persistence, safe executable resolution, simple local/cloud provider selection, and workspace readiness checks without requiring a full AI-agent framework.

Included

  • atomic file persistence
  • executable resolution and controlled command execution
  • provider routing with local/cloud failover
  • workspace migration readiness checks

Not Included

The following remain private and are intentionally not part of this repository:

  • higher-level orchestration
  • planner and task-contract logic
  • memory intelligence
  • capability evolution
  • computer interaction
  • repository intelligence
  • product-specific logic
  • private application architecture

Requirements

  • Python 3.11+
  • macOS or Linux for generic runtime components

Installation

Clone the repository, then install it in editable mode:

python3 -m pip install -e .

Tests

python3 -m pytest -q
python3 -m runtime.provider_router selftest

Public API Examples

Atomic Persistence

Write text atomically so readers never observe a partially written file:

from pathlib import Path
from runtime.atomic_file import atomic_write_text

atomic_write_text(Path("state.txt"), "ready")

Executable Resolution

Resolve and run an executable without invoking a shell:

from runtime.executable_resolution import resolve_executable, run_resolved_command

python = resolve_executable("python3")
result = run_resolved_command(["python3", "-c", "print(42)"])

print(python)
print(result["status"])  # PASS

Workspace Readiness

Check whether a workspace and its required public dependencies are ready:

from pathlib import Path
from runtime.workspace_migration import migration_readiness

readiness = migration_readiness(Path("."))
print(readiness["status"])  # PASS or BLOCKED

Provider Routing Example

Use the public routing primitive directly:

from runtime.provider_router import Provider, select_provider

providers = [
    Provider("local", available=False, local=True),
    Provider("cloud", available=True),
]

selected = select_provider(providers)
print(selected.name if selected else "none")  # cloud

A minimal public smoke check is also available:

python3 -m runtime.provider_router selftest

This validates the public provider-routing component in isolation. Higher-level routing policy and private DAMIAO TECH AI orchestration are intentionally outside the scope of this repository.

Status

Early-stage open-source runtime primitives extracted from an actively developed local-first AI orchestration project.

来源:GitHub · github.com