Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Interpreter v2.0 #328

Closed
mlejva opened this issue Mar 7, 2024 · 8 comments
Closed

Code Interpreter v2.0 #328

mlejva opened this issue Mar 7, 2024 · 8 comments

Comments

@mlejva
Copy link
Member

mlejva commented Mar 7, 2024

The current version of the code interpreter SDK allows to run Python code but each run has its own separate context. That means that subsequent runs can't reference to variables, definitions, etc from past code execution runs.

This is suboptimal for a lot of Python use cases with LLMs. Especially GPT-3.5 and 4 expects it runs in a Jupyter Notebook environment. Even when ones tries to convince it otherwise. In practice, LLMs will generate code blocks which have references to previous code blocks. This becomes an issue if a user wants to execute each code block separately which often is the use case.

Related #326

@im-calvin
Copy link

What's the status on this?

@mlejva
Copy link
Member Author

mlejva commented Mar 20, 2024

We have new code interpreter in works and some users are already using it. You can go ahead and start using it here - #326

It'll be soon released on the main branch.

If you give it a try, please share your feedback, it's tremendously helpful for us

@mlejva
Copy link
Member Author

mlejva commented Mar 20, 2024

@im-calvin let me know if you're asking about anything specific such as a feature that's blocking you

@im-calvin
Copy link

im-calvin commented Mar 20, 2024

Thanks for the update. I'm trying it out right now, I'm getting this error

RPC Error (-32000): error reading file '/root/.jupyter/kernel_id': open /root/.jupyter/kernel_id: no such file or directory

EDIT: I'm using version 0.12.6-stateful-code-interpreter.8 and calling sandbox.execPython(code) from within Typescript

@mlejva
Copy link
Member Author

mlejva commented Mar 20, 2024

@im-calvin Can you share the code? Are you using custom sandbox template?

@im-calvin
Copy link

im-calvin commented Mar 20, 2024

Here's my code & Dockerfile

# e2b.Dockerfile

# You can use most of the Debian-based base images
FROM ubuntu:22.04

# Install the ffmpeg tool/
RUN apt update \
  && apt install -y ffmpeg
const sandbox = await CodeInterpreterV2.create({
  template: "custom-sandbox",
  apiKey: process.env["E2B_API_KEY"],
});

const result = await sandbox.execPython(code);

@jakubno
Copy link
Member

jakubno commented Mar 20, 2024

I added section to the PR about custom templates. If there's anything unclear, let me know :)
#326

@mlejva
Copy link
Member Author

mlejva commented Apr 22, 2024

Implemented in a separate SDK - https://github.com/e2b-dev/code-interpreter

@mlejva mlejva closed this as completed Apr 22, 2024
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

No branches or pull requests

3 participants