Production-oriented multi-agent system for reviewable, evidence-backed software engineering tasks.
This project requires Python 3.12 and uv.
uv sync --locked
uv run pre-commit install
Run the same fast quality checks used during local development:
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest
uv run pre-commit run --all-files
Pre-commit runs Ruff, Pyright, the unit-test suite, and secret scanning. Broader integration and adversarial suites remain separate so commits stay fast; CI will run the complete required test matrix.
The GitHub Actions CI workflow runs on pull requests, pushes to
main, and manual dispatch. It installs the locked CPU-only development environment and runs Ruff
lint/format checks, Pyright, unit tests, and detect-secrets. CI deliberately excludes the
local-huggingface extra: deterministic mock-model tests must pass without a GPU or local model files.
The versioned Pydantic contracts are exported from mas_swe.domain. Untrusted API and
agent data must enter through validate_job_request and validate_task_result so callers
receive domain-specific errors instead of leaking validation-library details across layers.
The initial threat model and data-flow diagram defines trust boundaries, security invariants, prioritized threats, and the verification work required in later phases. Controls marked as planned must not be treated as implemented protection.
Install the optional CUDA/Hugging Face runtime:
uv sync --extra local-huggingface --locked
The adapter defaults to Qwen/Qwen2.5-Coder-3B-Instruct, resolves it from the configured
Hugging Face cache with local_files_only=True, and loads FP16 weights without quantization
on the available 16 GB NVIDIA GPU. It never requires an API key or downloads model files
during inference. Explicit 8-bit and 4-bit modes remain available when lower memory use is needed.
import asyncio
from mas_swe.model_gateway import (
ChatMessage,
HuggingFaceLocalModelGateway,
MessageRole,
ModelRequest,
ResilientModelGateway,
)
async def run() -> None:
local_backend = HuggingFaceLocalModelGateway()
await local_backend.load()
gateway = ResilientModelGateway(local_backend)
response = await gateway.generate(
ModelRequest(
messages=(ChatMessage(role=MessageRole.USER, content="Explain this repository."),),
temperature=0,
)
)
print(response.content)
print(response.usage)
asyncio.run(run())
Call load() once during application startup so loading the model is not charged against a
generation timeout. ResilientModelGateway applies a per-attempt timeout, bounded exponential
backoff, typed errors, and normalized token/latency/attempt/cost accounting.
The official 3B model uses the Qwen Research License. Use it only for permitted non-commercial
work unless you obtain a commercial license; otherwise select a suitably licensed model through
HuggingFaceLocalConfig before a commercial release. See
ADR 0004 for the recorded decision.
Production-oriented multi-agent system for reviewable, evidence-backed software engineering tasks.
This project requires Python 3.12 and uv.
uv sync --locked
uv run pre-commit install
Run the same fast quality checks used during local development:
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest
uv run pre-commit run --all-files
Pre-commit runs Ruff, Pyright, the unit-test suite, and secret scanning. Broader integration and adversarial suites remain separate so commits stay fast; CI will run the complete required test matrix.
The GitHub Actions CI workflow runs on pull requests, pushes to
main, and manual dispatch. It installs the locked CPU-only development environment and runs Ruff
lint/format checks, Pyright, unit tests, and detect-secrets. CI deliberately excludes the
local-huggingface extra: deterministic mock-model tests must pass without a GPU or local model files.
The versioned Pydantic contracts are exported from mas_swe.domain. Untrusted API and
agent data must enter through validate_job_request and validate_task_result so callers
receive domain-specific errors instead of leaking validation-library details across layers.
The initial threat model and data-flow diagram defines trust boundaries, security invariants, prioritized threats, and the verification work required in later phases. Controls marked as planned must not be treated as implemented protection.
Install the optional CUDA/Hugging Face runtime:
uv sync --extra local-huggingface --locked
The adapter defaults to Qwen/Qwen2.5-Coder-3B-Instruct, resolves it from the configured
Hugging Face cache with local_files_only=True, and loads FP16 weights without quantization
on the available 16 GB NVIDIA GPU. It never requires an API key or downloads model files
during inference. Explicit 8-bit and 4-bit modes remain available when lower memory use is needed.
import asyncio
from mas_swe.model_gateway import (
ChatMessage,
HuggingFaceLocalModelGateway,
MessageRole,
ModelRequest,
ResilientModelGateway,
)
async def run() -> None:
local_backend = HuggingFaceLocalModelGateway()
await local_backend.load()
gateway = ResilientModelGateway(local_backend)
response = await gateway.generate(
ModelRequest(
messages=(ChatMessage(role=MessageRole.USER, content="Explain this repository."),),
temperature=0,
)
)
print(response.content)
print(response.usage)
asyncio.run(run())
Call load() once during application startup so loading the model is not charged against a
generation timeout. ResilientModelGateway applies a per-attempt timeout, bounded exponential
backoff, typed errors, and normalized token/latency/attempt/cost accounting.
The official 3B model uses the Qwen Research License. Use it only for permitted non-commercial
work unless you obtain a commercial license; otherwise select a suitably licensed model through
HuggingFaceLocalConfig before a commercial release. See
ADR 0004 for the recorded decision.