Skip to content

Added Langflow and Local AI sandboxes with their exploitation code#8

Open
gontarget wants to merge 3 commits intoGenAI-Security-Project:mainfrom
gontarget:locallmSandbox
Open

Added Langflow and Local AI sandboxes with their exploitation code#8
gontarget wants to merge 3 commits intoGenAI-Security-Project:mainfrom
gontarget:locallmSandbox

Conversation

@gontarget
Copy link

No description provided.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is something wrong going on with port mapping. I am not able to open it at http://localhost:7860.

Copy link
Collaborator

@felipepenha felipepenha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am requesting changes to ensure sandboxes are ready to spin up in any system.

fi
@if podman run -d \
--name $(CONTAINER_NAME) \
--network host \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not working. You will need to replace --network host by -p $(PORT):$(PORT).

run:
podman run -d \
--name $(CONTAINER_NAME) \
--network host \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to replace --network host by -p 8080:8080.

Comment on lines +11 to +14
RUN curl -fsSL \
https://github.com/mudler/LocalAI/releases/download/v2.17.1/local-ai-Linux-x86_64 \
-o local-ai \
&& chmod +x local-ai
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, replace by

RUN ARCH=$(uname -m) && \
    case "$ARCH" in \
        aarch64|arm64) BINARY="local-ai-Linux-arm64" ;; \
        x86_64)        BINARY="local-ai-Linux-x86_64" ;; \
        *) echo "Unsupported architecture: $ARCH"; exit 1 ;; \
    esac && \
    curl -fsSL "https://github.com/mudler/LocalAI/releases/download/v2.17.1/$BINARY" -o local-ai && \
    chmod +x local-ai

to ensure it works on most hardware.

run:
podman run -d \
--name $(CONTAINER_NAME) \
--network host \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, remove --network host, as this conflicts with the port mapping.

Comment on lines +15 to +17
RUN pip install --no-cache-dir \
"invokeai==5.3.0" \
--extra-index-url https://download.pytorch.org/whl/cpu
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, replace by

# Fix for bitsandbytes on arm64 (InvokeAI v5.3.0 requires bitsandbytes==0.43.3 which lacks arm64 Linux wheels)
# Since the lab is CPU-only, we create a dummy package to satisfy pip without crashing.
RUN ARCH=$(uname -m) && \
    case "$ARCH" in \
        aarch64|arm64) \
            echo "Building dummy bitsandbytes wheel for arm64..." && \
            mkdir -p /tmp/dummy-bnb && cd /tmp/dummy-bnb && \
            echo "from setuptools import setup; setup(name='bitsandbytes', version='0.43.3')" > setup.py && \
            pip install . && \
            rm -rf /tmp/dummy-bnb \
            ;; \
        x86_64) \
            echo "x86_64 architecture detected, no bitsandbytes workaround needed" \
            ;; \
        *) echo "Unsupported architecture: $ARCH"; exit 1 ;; \
    esac

# Install InvokeAI 5.3.0 (CPU-only, no GPU required for lab)
RUN pip install --no-cache-dir \
    "invokeai==5.3.0" \
    --extra-index-url https://download.pytorch.org/whl/cpu

to ensure it works on most hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants