Need UV-based code-interpreter custom template
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.
I need this really quick.
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
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?
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.
Closing stale issue.