Sign inSign up

ajeetraina777/sbx-kit-deepagents:0.7.21

Multi-platform
Manifest digest

sha256:12424ac3aa728316eac1cd904bd1bf2ce049cc0d5c437cfa5876c6dd35e97216

Last pushed

about 7 hours by ajeetraina777

Type

Sandbox Kit

Manifest digest

sha256:12424ac3aa728316eac1cd904bd1bf2ce049cc0d5c437cfa5876c6dd35e97216

yaml
schemaVersion: "3"
displayName: DeepAgents (Docker Model Runner)
description: Adds the deepagents agent harness (planning, a virtual filesystem, sub-agents) to a sandbox, pre-wired to a local Docker Model Runner for the LLM — no cloud credentials and no hosted tracing.
sourceUrl: https://github.com/ajeetraina/docker-sbx-deepagents
version: 0.7.21
licenses:
    - Apache-2.0
kind: mixin
provides:
    - [email protected]
capabilities:
    - type: com.docker.sandbox/network-policy@1
      config:
        install:
            allow:
                - pypi.org
                - files.pythonhosted.org
        runtime:
            allow:
                - host.docker.internal:12434
                - localhost:12434
    - type: com.docker.sandbox/agent-context@1
      config:
        contentFile: /usr/share/sandbox/kit/deepagents/deepagents-context.md
    - type: com.docker.sandbox/lifecycle@1
      config:
        files:
            - content: |
                #!/usr/bin/env python3
                """Minimal deepagents agent wired to the local Docker Model Runner.

                No cloud credentials: the model is an OpenAI-compatible client pointed
                at the Model Runner on the host. Edit DEEPAGENTS_MODEL or the system
                prompt to taste, then: python3 ~/deepagents_quickstart.py
                """
                import os

                from langchain_openai import ChatOpenAI

                from deepagents import create_deep_agent

                model = ChatOpenAI(
                    model=os.environ.get("DEEPAGENTS_MODEL", "ai/qwen3"),
                    base_url=os.environ.get(
                        "OPENAI_BASE_URL", "http://host.docker.internal:12434/engines/v1"
                    ),
                    api_key=os.environ.get("OPENAI_API_KEY", "dmr"),
                    temperature=0,
                )

                agent = create_deep_agent(
                    model=model,
                    system_prompt="You are a concise assistant. Plan before you act.",
                )

                if __name__ == "__main__":
                    result = agent.invoke(
                        {"messages": [{"role": "user", "content": "In two sentences, what is a sandbox?"}]}
                    )
                    print(result["messages"][-1].content)
              description: Minimal deepagents agent wired to the local Docker Model Runner
              mode: "0755"
              overwrite: false
              path: /home/agent/deepagents_quickstart.py
        install:
            - command: python3 -c "import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)" || { echo 'deepagents needs Python >= 3.11 on the composed base' >&2; exit 1; }
              description: Fail early with an actionable message if the base Python is too old
              user: "1000"
            - command: pip install --break-system-packages 'deepagents==0.7.21' langchain-openai
              description: Install deepagents plus langchain-openai (the OpenAI-compatible client for the Model Runner)
              env:
                - HTTP_PROXY
                - HTTPS_PROXY
              user: "1000"
            - command: python3 -c "import importlib.metadata as m, sys; sys.exit(0 if m.version('deepagents') == '0.7.21' else 1)" || { echo 'deepagents version mismatch — the pinned provide is a claim about content' >&2; exit 1; }
              description: Re-read the installed version and fail on mismatch — a pinned provide must be true
              user: "1000"