←back to thread

MCP Run Python

(github.com)
173 points xrd | 7 comments | | HN request time: 1.524s | source | bottom
Show context
behnamoh ◴[] No.43718268[source]
So their method of sandboxing Python code is to spin up a JS runtime (deno), run Pyodide on it, and then run the Python code in Pyodide.

Seems a lot of work to me. Is this really the best way to create and run Python sandboxes?

replies(11): >>43718335 #>>43718770 #>>43718841 #>>43719300 #>>43719370 #>>43719672 #>>43719881 #>>43721408 #>>43722369 #>>43723869 #>>43726452 #
1. anentropic ◴[] No.43718841[source]
It's what ChatGPT does apparently...

https://simonwillison.net/2024/Dec/10/chatgpt-canvas/

replies(1): >>43719683 #
2. simonw ◴[] No.43719683[source]
Not exactly - ChatGPT has two ways it can run Python code. It can use Pyodide and run it directly in the user's browser (for Canvas), and it can also run Python code on one of their servers in a Jupyter environment in a locked-down Kubernetes container (their "Code Interpreter" tool).

To my knowledge they don't yet have a run-Python-in-WASM-on-the-server implementation.

replies(1): >>43720046 #
3. jamestimmins ◴[] No.43720046[source]
What’s the purpose of Jupyter here? Isn’t that optimized for notebooks, which presumably wouldn’t be relevant on the server?
replies(1): >>43720399 #
4. simonw ◴[] No.43720399{3}[source]
I think it's more about tapping into the Jupyter ecosystem of visualization libraries etc, plus the fact that there's lots of data analyst examples in the training data that come from notebooks.
replies(2): >>43722315 #>>43722467 #
5. jamestimmins ◴[] No.43722315{4}[source]
That's an interesting dynamic of the training data impacting the architecture. I wonder if this is a one-off or we see that in other areas as well.
replies(1): >>43727310 #
6. __mharrison__ ◴[] No.43722467{4}[source]
So that's why it writes such bad pandas code...
7. fzzzy ◴[] No.43727310{5}[source]
I think this is inevitable. Whatever is most highly represented (correctly) will become even more dominant.