mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3198] [Engine] Return the ability to run local models with --host 0.0.0.0 WITHOUT api keys #1295
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1295
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EternalNooblet on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3198
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 --versionto 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]$
@github-actions[bot] commented on GitHub (Oct 19, 2026):
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:
strata --version).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
@EternalNooblet commented on GitHub (Oct 19, 2026):
/reopen
@github-actions[bot] commented on GitHub (Oct 19, 2026):
Not reopened yet. Still missing:
strata --version).Edit the issue and comment
/reopenagain. Details: CONTRIBUTING.md@github-actions[bot] commented on GitHub (Oct 19, 2026):
Thanks, this follows the format now.
@EternalNooblet commented on GitHub (Oct 19, 2026):
/reopen
@aa956 commented on GitHub (Oct 19, 2026):
+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:
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.
@Gerporgl commented on GitHub (Oct 19, 2026):
+1 I agree, I have the same setup.
@jeremy-windsor commented on GitHub (Oct 19, 2026):
please remove this requirement or add a flag to disable it.
@LegendaryFire commented on GitHub (Oct 20, 2026):
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_KEYenvironment variable should disable the requirement altogether.@Niko1221 commented on GitHub (Oct 20, 2026):
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
@xashr commented on GitHub (Oct 20, 2026):
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.
@aa956 commented on GitHub (Oct 20, 2026):
Thank you for the explanation.
I'll ask for proxy side solution first as it looks like the best place to resolve it.
llama-swapdoes support specifying API key for the external engines that the proxy does not manage (like proxying any address, e.g. openrouter orStratarunning 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 ggufor in our casepodman 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.
@superjamie commented on GitHub (Oct 20, 2026):
For anyone who wants to patch this out themselves, the check is:
github.com/Niko1221/Strata@9ae93f7b1f/serve/server.py (L7811-L7813)@LegendaryFire commented on GitHub (Oct 20, 2026):
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: hostwhich 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.
@erkrali commented on GitHub (Oct 20, 2026):
Please just count me in: another person running inside podman-composer with an internal-only network and
llama-swapas 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_KEYenv 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:
e526688seems to do exactly this?@superjamie commented on GitHub (Oct 20, 2026):
That looks to resolve it.
Hooray, thank you @Niko1221 for reconsidering and implementing the option for no API key.
@Niko1221 commented on GitHub (Oct 21, 2026):
Thanks, you are right, and this is fixed. Starting with 0.2.2 (out now),
--host 0.0.0.0starts without a key if you say so: add--no-api-keytostrata 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).@superjamie commented on GitHub (Oct 22, 2026):
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-keyin config args, the engine reports no such option exists and exits.@OcBuddy commented on GitHub (Oct 22, 2026):
How can i do that trough docker?
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-keythereA run of the script shown above outputs the following.
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.
@superjamie commented on GitHub (Oct 22, 2026):
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 😢)
@Niko1221 commented on GitHub (Oct 24, 2026):
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.@phs commented on GitHub (Oct 24, 2026):
This is fixed? On
0.2.3-cuda13I still getI'm running the default entry point and default command (
run) but adding--host 0.0.0.0 --no-api-key. What am I missing?@LegendaryFire commented on GitHub (Oct 24, 2026):
Strata inside a container is completely busted right now.
@phs commented on GitHub (Oct 24, 2026):
There we go. The entry point script swallows and ignores the arguments, so we need to call
strata launchdirectly. 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 asleep infin the background.@phs commented on GitHub (Oct 25, 2026):
..it took a while to peel layers off the onion, but here's one-shot that dispenses with
strata launchand callsstrata servedirectly, relieving the need for the sleep.@LegendaryFire commented on GitHub (Oct 25, 2026):
Bugs like this are why I think it would be in best interest to separate the engine away from the harness. https://github.com/Niko1221/Strata/issues/3330
@Luiszzzor commented on GitHub (Nov 3, 2026):
so this still doesn't work with strata container without entrypoint workarounds? ^^ it's a must have for gateways like llama-swap