oughtinc / ice

Interactive Composition Explorer: a debugger for compositional language model programs
https://ice.ought.org
MIT License
529 stars 66 forks source link

Add support for jupyter proxy #306

Closed sam-cohan closed 1 year ago

github-actions[bot] commented 1 year ago

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

stuhlmueller commented 1 year ago

Neat! Let me know when it's ready for review?

sam-cohan commented 1 year ago

@stuhlmueller Unfortunately I don't know the combination of all these technologies very well so still struggling to make this work elegantly. The main issue I am having right now is that by having the relative "./" in the config you can no longer directly go to the traces because it will try to load the assets from relative path. As it stands, the only way to get to the traces is to always start at the index and then click through to the traces. This is obviously very annoying to do every time. An alternative approach that seems to work well locally is to use hard-coded paths (i.e. remove the base: "./", line from ui/vite.config.ts), but in order for that to work behind jupyter proxy, we have to replace the line with base: "/proxy/8935/", which would mean we would require to have two packages: one for local and the other for proxy situations. In fact, even with hardcoding base: "/proxy/8935/", when behind a proxy, I am still only able to get to traces by going through the index page and all other pages find their way to the index through the catch_all() in app.py. I just don't know enough about these technologies to quickly fix these issues. Perhaps someone one your team knows these well and can use this PR as a base to quickly fix those problems?