Get help from the marimo community

Updated 2 weeks ago

is there a way to use openai without storing the api key in the marimo.toml in plain text?

i am using a shared server to run the notebooks on, and don't like the idea of having api keys stored on plain text in files accessible by all.
so i wondered, is there a way to use openai without storing the api key in the marimo.toml in plain text?
M
r
5 comments
you could set up a proxy server that just forwards requests to API and adds your api key.

and then change the base url to point to that server.

thats what we do on https://marimo.app/
interesting. do you have an example to point to maybe?
example of a proxy server? not on hand, since its in a larger repo. what language are you looking for it?
so basically i can just drop the key from the configuration and use it like so:
Plain Text
[ai.open_ai]
# api_key = "sk-proj-..."
model = "gpt-4-turbo"
base_url = "http://my-own-endpoint/"

and have some simple let's say FastAPI endpoint forwarding the requests with my key in them?
think that might work
ty
Yea exactly. You might need to stub the key as well (and then replace it in the proxy server)
Add a reply
Sign up and join the conversation on Discord