code-interpreter icon indicating copy to clipboard operation
code-interpreter copied to clipboard

Need UV-based code-interpreter custom template

Open zhener562 opened this issue 1 year ago • 6 comments

Need UV-based code-interpreter custom template we care about install speed. every time make a new sandbox, we have to install different library via pip install. most of code excution time bottleneck is pip install. so we need much easer way to build costom template like code-interpreter but use uv as defalt. and we need to easely set pre-install library.

zhener562 avatar Nov 13 '25 07:11 zhener562

ENG-3301

linear[bot] avatar Nov 13 '25 07:11 linear[bot]

I need this really quick.

zhener562 avatar Nov 13 '25 07:11 zhener562

Hi there,

you can create custom code-interpreter template by using .from_template("code-interpreter-v1") when creating a custom template. Documentation for building custom template is available on the link here: https://e2b.dev/docs/sdk-reference/python-sdk/v2.6.4/template#template-base:~:text=TemplateBuilder%20class%20Example-,Template,-().from_template(.

An example of this code for building a UV based custom template is template = ( Template() .from_template("code-interpreter-v1") .apt_install(["curl", "git", "build-essential"]) .run_cmd("curl -LsSf https://astral.sh/uv/install.sh | sh") )

Please let me know if this is the solution you were looking for, or if I can help you in any other way.

Best, Tomas

beran-t avatar Nov 13 '25 13:11 beran-t

thank you for reply. If I want to set uv as default runtime on jupyter, I have to edit start up sh? how do I edit this file? maybe use this .run_cmd command to edit it directly right?

zhener562 avatar Nov 14 '25 08:11 zhener562

Yes, that would be needed in this case. Please also let me know if that helped you, I will note it down for similar requests in the future.

beran-t avatar Nov 14 '25 12:11 beran-t

Closing stale issue.

mishushakov avatar May 15 '26 15:05 mishushakov