Skip to content

[Engine] Return the ability to run local models with --host 0.0.0.0 WITHOUT api keys #3198

Closed

Description

@EternalNooblet

Please add some sort of override for this. I access my strata remotely and was not forced to add the API key until the last update.

There is no 'strata' command anywhere. I used the update.sh script in the source dir i cloned from github. There is no strata --version to run. The version on my machine is the latest because I ran the update.sh a few minutes ago.

RTX360 12GB, 32GB RAM, cachyos

[papa@cachyos-pc Strata]$ ./bin/strata --version
strata 0.2.0-beta (build 0.1.45.3; python 3.14.7 at /usr/bin/python3)
[papa@cachyos-pc Strata]$

Activity

  1. github-actions commented on Oct 19, 2026

    @github-actions

    Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

    • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".
    • Add the Strata version (Settings > About, or strata --version).
    • Add your graphics card with its VRAM, your RAM and your operating system.

    Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

    Details: CONTRIBUTING.md

  2. changed the title [-]Return the ability to run local models with --host 0.0.0.0 WITHOUT api keys[/-] [+][Engine] Return the ability to run local models with --host 0.0.0.0 WITHOUT api keys[/+] on Oct 19, 2026
  3. EternalNooblet commented on Oct 19, 2026

    @EternalNooblet
    Author

    /reopen

  4. github-actions commented on Oct 19, 2026

    @github-actions

    Not reopened yet. Still missing:

    • Add the Strata version (Settings > About, or strata --version).

    Edit the issue and comment /reopen again. Details: CONTRIBUTING.md

  5. github-actions commented on Oct 19, 2026

    @github-actions

    Thanks, this follows the format now.

  6. EternalNooblet commented on Oct 19, 2026

    @EternalNooblet
    Author

    /reopen

  7. aa956 commented on Oct 19, 2026

    @aa956

    +1. I run Strata in a Podman container with no ports exposed to the host - it is only reachable via the internal container network by my router proxy (llama-swap).

    Because the container network is already isolated, enforced API keys add no meaningful security benefit for this architecture, but they introduce significant operational friction. I'd now have to choose between:

    • Patching llama-swap to inject keys into requests for the engines it manages
    • Patching Strata itself to remove the requirement
    • Or, the simplest option, removing my proxy API key entirely and manually replicating the same keys across the 10+ engines in my stack (llama.cpp, vllm, tabbyAPI, ComfyUI, ik_llama.cpp, stable-diffusion.cpp, etc.) to maintain transparent client access. This would probably reduce my security by losing the single API key at the router level.

    This setup worked without friction until v0.1.45.
    I understand the safety rationale for users exposing servers directly to the internet, but for containerized/proxied setups like this, the API key is redundant at the engine level.

  8. Gerporgl commented on Oct 19, 2026

    @Gerporgl

    +1. I run Strata in a Podman container with no ports exposed to the host - it is only reachable via the internal container network by my router proxy (llama-swap).

    +1 I agree, I have the same setup.

  9. jeremy-windsor commented on Oct 19, 2026

    @jeremy-windsor

    please remove this requirement or add a flag to disable it.

  10. LegendaryFire commented on Oct 20, 2026

    @LegendaryFire

    I agree, this is less than ideal especially considering every single client that loads the web interface will need the API key manually entered before they can see stats or use the model - this just isn't a realistic scenario. One would typically expect an authentication gate of some sort instead of a shared API key.

    Running in a docker container, using parts from the example docker compose file. At minimum, setting an empty API_KEY environment variable should disable the requirement altogether.

  11. Niko1221 commented on Oct 20, 2026

    @Niko1221
    Owner

    Thanks for the detail on how you run it. The key is not a bug we can switch off: Strata will not listen on an address other than this computer without an API key, because anyone who can reach the port can then use your model and its tools, and a home or office network is not always as closed as it looks. So we do not plan an override, but the key is easy to make. The simplest way is strata launch --access lan: it makes a key for you and prints the address and the key (from a source install: ./setup.sh --host 0.0.0.0 --api-key your-key writes it into the config). You can also pick the key yourself: "api_key": "your-key" in strata-.json, or the STRATA_API_KEY environment variable, and use the same key on the client side. For a router in front of several engines (llama-swap, as in your container setup), the router can send the same key to Strata in the Authorization: Bearer header or x-api-key, so you keep one key per engine without replacing yours. If that does not work with your router, tell us what it can and cannot add to a request.

    This is in Strata 0.2.1: https://github.com/Niko1221/Strata/releases/tag/v0.2.1

  12. xashr commented on Oct 20, 2026

    @xashr

    This is a good feature to prevent beginners from exposing their api endpoint unprotected by default.
    But please add a flag to allow access without api key for people who know what they are doing.
    I already hacked it into the code, but an official solution would be appreciated.

  13. aa956 commented on Oct 20, 2026

    @aa956

    Thank you for the explanation.

    I'll ask for proxy side solution first as it looks like the best place to resolve it.

    llama-swap does support specifying API key for the external engines that the proxy does not manage (like proxying any address, e.g. openrouter or Strata running on another machine), but does not support API keys for engines the proxy starts and stops itself by starting/stopping a local process (e.g. llama-server --model gguf or in our case podman start localhost/strata).

    I do not recall the rationale for that decision by llama-swap, it may just be caused by most engines allowing/defaulting to empty API key.

  14. superjamie commented on Oct 20, 2026

    @superjamie

    For anyone who wants to patch this out themselves, the check is:

    Strata/serve/server.py

    Lines 7811 to 7813 in 9ae93f7

    if a.host not in ("127.0.0.1", "localhost", "::1") and not preflight_api_key:
    print("[strata] a non-loopback bind requires an inference API key", file=sys.stderr, flush=True)
    return 2

  15. LegendaryFire commented on Oct 20, 2026

    @LegendaryFire

    Appreciate the speedy response. I'd say that is quite standard behavior for most services which are containerized and don't have an authentication layer, typically they will print a log line in all capital letters mentioning that they are running unauthenticated and recommend taking some action.

    I'd honestly say it's actually harder for one to expose the container across their network since one would need to deliberately either port map from the individual container ports, to ports on their host machine, or intentionally map the entire host network to the container with network_mode: host which would be the equivalent of simply installing it on your computer. No port mapping, no network access altogether.

    On top of that, one would still need to include a port forward on their router or set up a zero-trust tunnel in order to expose the instance to the web. So I think having the container step makes it more secure than a simple install.

  16. erkrali commented on Oct 20, 2026

    @erkrali

    Please just count me in: another person running inside podman-composer with an internal-only network and llama-swap as the only entry point from the outside. There is literally nothing else that can access this server other than the gateway.

    My concern is that while the change now is trivial (just commenting out three lines), this could eventually become more complex as other parts of the code start to depend on this.

    My suggestion: if you're concerned about users just forgetting to add a key, keep the current behaviour a default, but add an escape hatch --no-api-key, (STRATA_NO_API_KEY env variable for docker) that makes the user intent explicit.

    People running this kind of setup locally are also the ones more likely to be able to just disable it on our local copy of the code, so please don't make our life harder than necessary.

    EDIT: It seems I got ninja'd: e526688 seems to do exactly this?

  17. superjamie commented on Oct 20, 2026

    @superjamie

    That looks to resolve it.

    Hooray, thank you @Niko1221 for reconsidering and implementing the option for no API key.

  18. Niko1221 commented on Oct 21, 2026

    @Niko1221
    Owner

    Thanks, you are right, and this is fixed. Starting with 0.2.2 (out now), --host 0.0.0.0 starts without a key if you say so: add --no-api-key to strata launch, or put "api_key": "none" in the config. It starts and prints one warning that anyone who can reach the port can use the model. We still recommend a key on a network (the Terminal makes one by default).

  19. superjamie commented on Oct 22, 2026

    @superjamie

    I tried but could not get this working.

    Putting "api_key": "none" in the model config is erased by the Docker container.

    Putting --env 'API_KEY=none' is ignored by the container.

    Putting --no-api-key in config args, the engine reports no such option exists and exits.

  20. OcBuddy commented on Oct 22, 2026

    @OcBuddy

    21. Thanks, you are right, and this is fixed. Starting with 0.2.2 (out now), --host 0.0.0.0 starts without a key if you say so: add --no-api-key to strata launch, or put "api_key": "none" in the config. It starts and prints one warning that anyone who can reach the port can use the model. We still recommend a key on a network (the Terminal makes one by default).

    How can i do that trough docker?

    here=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
    
    docker run --rm --gpus all \
      -p 0.0.0.0:8080:8080 \
      --ulimit memlock=-1 \
      --shm-size 2g \
      --stop-timeout 120 \
      -v "$(realpath ../Strata-data):/data/Strata-data" \
      -e FAMILY=coder \
      -e MODEL=IQ1_M \
      -e API_KEY=none \
      -e HOST=0.0.0.0 \
      strata
    

    I think we need a ENV based toggle for that. NO_API_KEY=true or NO_API_KEY=1
    Is there one? And one for HOST, i added it but i think it currently does nothing or is overridden.

    PS: I do not want to edit repo files like code or the entrypoint, so it won't break on every git pull
    PS: The -- parameters in the above script are for docker run, i can't add --no-api-key there

    A run of the script shown above outputs the following.

    ❯ ./go.sh
    [!] API_KEY is short (4 characters). Use 16 or more; 'openssl rand -hex 24' makes a good one.
    [!] HOST is from the older image and is ignored here. See docs/DOCKER.md ("From the older image").
    Starting Strata: IQ1_M (preset 'docker').
        Checking the engine for this computer…
        Engine 0.1.46.3 (cuda) is installed.
        Getting coder IQ1_M ready (a download may be large; it continues where it stopped if interrupted)…
        Getting your model ready
        Checking your computer
        Getting the helper packages ready
        Checking the engine for this PC
        Getting the model files: 59.3 of 59.3 GB
        Preparing your model for Strata (one time)
        Preparing the draft layer
        Saving the model's settings
        coder IQ1_M is ready.
        Writing this launch's settings…
        Settings are saved.
        Starting the engine and loading the model. The first start can take a few minutes.
        Loading the model… 15 s
        The model is loaded and answering.
        Ready: http://127.0.0.1:8080, http://172.17.0.2:8080
        Strata is serving.
    
    Strata is serving.
      This computer  http://127.0.0.1:8080/v1
      Network        http://172.17.0.2:8080/v1
      Anthropic apps http://127.0.0.1:8080   (Claude Code: ANTHROPIC_BASE_URL, no /v1 at the end)
      API key        ••••••••   (show it: strata launch --show-key --preset "docker")
      Watch it:    STRATA_API_KEY=$(strata launch --show-key) strata monitor --url http://127.0.0.1:8080 --credential-env STRATA_API_KEY
      Connect an app:  strata connect opencode      Stop:  strata launch --stop --preset "docker"
    Serving on port 8080. Watch it: docker exec -it <container> strata monitor    Stop: docker stop <container>
    
    

    On a side-note:
    An ability to disable the the limitation of 0700 and single user rights would be nice because currently docker runs as root inside, and wants all files as root:root 0700. That would allow me to use same files for local runs and docker runs.

  21. superjamie commented on Oct 22, 2026

    @superjamie

    If you need a new entrypoint command instead of the script, you can pass the command as docker run --entrypoint strata --options...

    (I tried to figure this out too, but trawling through the LLM slop code is so exhausting 😢)

  22. Niko1221 commented on Oct 24, 2026

    @Niko1221
    Owner

    This is fixed in Strata 0.2.2. Please update to the latest release (in the Terminal: strata update; in the app: download the newest installer from the releases page). If it still happens on the latest version, reply here and we will reopen it. Thank you for the report.

  23. phs commented on Oct 24, 2026

    @phs

    This is fixed? On 0.2.3-cuda13 I still get

    [!] A new API key was made, because the server is shared beyond this computer. It is saved with the preset; show it with: strata launch --show-key
    
    $ podman run --rm --gpus all -p 127.0.0.1:8080:8080 --ulimit memlock=-1:-1 --shm-size 2g --stop-timeout 120 -e MODEL_PATH=/models -v ./qwen-flash-next-iq3s:/models -v ./strata-data:/data/state -e MODEL=IQ3_S ghcr.io/niko1221/strata:0.2.3-cuda13 run --host 0.0.0.0 --no-api-key
    Starting Strata: IQ3_S from /models (preset 'docker').
    [!] A new API key was made, because the server is shared beyond this computer. It is saved with the preset; show it with: strata launch --show-key
        Checking the engine for this computer…
        Engine 0.1.48 (cuda) is installed.
        Preparing qwen IQ3_S from your model files…
        Getting your model ready
        Checking your computer
        Getting the helper packages ready
        Checking the engine for this PC
        Getting the model files
        The model files are on this computer; checking them
        Preparing your model for Strata (one time)
        Preparing the model data for the engine (one time)
    ^CStop requested: shutting down.
    strata: Stopped.
    ^C^CStop requested: shutting down.
    Nothing from `strata launch` is running.
    

    I'm running the default entry point and default command (run) but adding --host 0.0.0.0 --no-api-key. What am I missing?

  24. LegendaryFire commented on Oct 24, 2026

    @LegendaryFire

    Strata inside a container is completely busted right now.

  25. phs commented on Oct 24, 2026

    @phs

    There we go. The entry point script swallows and ignores the arguments, so we need to call strata launch directly. This also means we can dispense with all the environment variables, they turn into launch arguments instead.

    Since there is no e.g. --foreground, we actually need to put the watch loop from the entry point script back. So add the trap for clean shutdown and put a sleep inf in the background.

    $ podman run --rm --gpus all -p 127.0.0.1:8080:8080 --ulimit memlock=-1:-1 --shm-size 2g --stop-timeout 120 -v ./qwen-flash-next-iq3s:/models -v ./strata-data:/data/state --entrypoint /bin/sh ghcr.io/niko1221/strata:0.2.3-cuda13 -c 'trap "strata launch --stop; exit 0" TERM INT; strata launch --no-tui --access lan --no-api-key --port 8080 --data-dir /data/state --model IQ3_S --model-path /models || exit 1; sleep inf & wait $!'
    [!] No API key: anyone who can reach this port can use the model and its tools (they can read and change files on this computer). Leave --no-api-key out to get a key.
        Checking the engine for this computer…
        Engine 0.1.48 (cuda) is installed.
        Preparing qwen IQ3_S from your model files…
        Getting your model ready
        Checking your computer
        Getting the helper packages ready
        Checking the engine for this PC
        Downloading the small tools used to prepare models
        Getting the model files
        The model files are on this computer; checking them
        Preparing your model for Strata (one time)
        Preparing the draft layer
        Saving the model's settings
        qwen IQ3_S is ready.
        Writing this launch's settings…
        Settings are saved.
        Starting the engine and loading the model. The first start can take a few minutes.
        Loading the model… 15 s
        The model is loaded and answering.
        Ready: http://127.0.0.1:8080, http://192.168.0.55:8080
        Strata is serving.
    
    Strata is serving.
      This computer  http://127.0.0.1:8080/v1
      Network        http://192.168.0.55:8080/v1
      Anthropic apps http://127.0.0.1:8080   (Claude Code: ANTHROPIC_BASE_URL, no /v1 at the end)
      Watch it:    strata monitor --url http://127.0.0.1:8080
      Connect an app:  strata connect opencode      Stop:  strata launch --stop --preset "IQ3_S 128K"
    ^CStopped iq3_s-128k.
    
  26. phs commented on Oct 25, 2026

    @phs

    ..it took a while to peel layers off the onion, but here's one-shot that dispenses with strata launch and calls strata serve directly, relieving the need for the sleep.

    podman run --rm --gpus all --init -p 127.0.0.1:8080:8080 --ulimit memlock=-1:-1 --shm-size 2g --stop-timeout 120 -v ./qwen-flash-next-iq3s:/models:ro -v ./strata-data:/data/state --entrypoint /bin/sh ghcr.io/niko1221/strata:0.2.3-cuda13 -c 'STRATA_CONTROL_INSTALL=1 /opt/strata/terminal/python/bin/python3 /opt/strata/terminal/setup.py --setup --family qwen --model IQ3_S --context 131072 --gguf-dir /models --data-dir /data/state --host 0.0.0.0 --port 8080 --api-key none --yes --no-start --no-browser || exit 1; exec strata serve --profile /data/install/strata-iq3_s.json'
    
  27. LegendaryFire commented on Oct 25, 2026

    @LegendaryFire

    Bugs like this are why I think it would be in best interest to separate the engine away from the harness. #3330

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions