{"author":"killianlucas","children":[{"author":"killianlucas","children":[{"author":"pplonski86","children":[{"author":"killianlucas","children":[],"created_at":"2023-08-30T18:48:47.000Z","created_at_i":1693421327,"id":37326995,"options":[],"parent_id":37325160,"points":null,"story_id":37315866,"text":"Yes, you can iterate on the code being written by asking for changes\u2014 very much like ChatGPT. If it starts writing code you don&#x27;t want, you can hit CTRL-C to stop generating, and give it your feedback right away.<p>And yes, `$: interpreter` runs in confirmation mode by default. You&#x27;ll need to approve every block of code before it&#x27;s run (bypass this with the `-y` flag).","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T16:59:49.000Z","created_at_i":1693414789,"id":37325160,"options":[],"parent_id":37316164,"points":null,"story_id":37315866,"text":"Congrats. Is there any way to provide feedback for LLM? Is there any way to ask for approval before code execution?","title":null,"type":"comment","url":null},{"author":"jawerty","children":[],"created_at":"2023-08-31T15:02:05.000Z","created_at_i":1693494125,"id":37338262,"options":[],"parent_id":37316164,"points":null,"story_id":37315866,"text":"Killian, you&#x27;re killin it!","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T00:41:04.000Z","created_at_i":1693356064,"id":37316164,"options":[],"parent_id":37315866,"points":null,"story_id":37315866,"text":"Hey HN! Over the summer I built Open Interpreter, a CLI that lets you ask Code-Llama to write and run code.<p>It executes multiple languages (Python, Shell, HTML&#x2F;CSS, Node JS) then sends the output back to the language model.<p>It\u2019s essentially an open-source, local implementation of OpenAI\u2019s Code Interpreter, but without limits on file-size, runtime timeouts, or web access.<p>Everything is streamed beautifully to your terminal and rendered with Markdown and syntax highlighting.<p>Try it out and let me know what you tried!<p>- Killian","title":null,"type":"comment","url":null},{"author":"Multiplayer","children":[{"author":"killianlucas","children":[{"author":"d4rkp4ttern","children":[{"author":"killianlucas","children":[{"author":"d4rkp4ttern","children":[],"created_at":"2023-08-31T11:06:28.000Z","created_at_i":1693479988,"id":37335338,"options":[],"parent_id":37327626,"points":null,"story_id":37315866,"text":"Very interesting, thanks for the details!","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T19:28:07.000Z","created_at_i":1693423687,"id":37327626,"options":[],"parent_id":37320941,"points":null,"story_id":37315866,"text":"Thanks! Custom built, it&#x27;s actually Tailwind CSS that I made on the <a href=\"https:&#x2F;&#x2F;play.tailwindcss.com&#x2F;\" rel=\"nofollow noreferrer\">https:&#x2F;&#x2F;play.tailwindcss.com&#x2F;</a> playground lol. You can write HTML with tailwind there, then just copy the &quot;generated CSS&quot; at the bottom, paste it into a style.css, paste your HTML into a index.html, then upload to github pages.<p>All static, no building stuff, just that playground + github pages.<p>The Open Interpreter site is actually open-sourced here if you want to copy it: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;KillianLucas&#x2F;open-interpreter-website\">https:&#x2F;&#x2F;github.com&#x2F;KillianLucas&#x2F;open-interpreter-website</a>","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T12:23:08.000Z","created_at_i":1693398188,"id":37320941,"options":[],"parent_id":37316187,"points":null,"story_id":37315866,"text":"I&#x27;d actually love to know how you made the web-site, it has the distinctly openAI-look, with large clear lettering etc. Is that custom built or did you use a theme in a framework? Thanks","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T00:44:55.000Z","created_at_i":1693356295,"id":37316187,"options":[],"parent_id":37316166,"points":null,"story_id":37315866,"text":"aw thanks! I made it with Rotato, highly recommend that. Lots of the animation I actually used Open Interpreter to put together (e.g. &quot;Make a square gif out of these images, cropping out the whitespace in each frame&quot;, etc)<p>Let me know if you get the chance to try it!","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T00:41:51.000Z","created_at_i":1693356111,"id":37316166,"options":[],"parent_id":37315866,"points":null,"story_id":37315866,"text":"This looks really fantastic.  Also, how&#x2F;who made that beautiful video?","title":null,"type":"comment","url":null},{"author":"quickthrower2","children":[{"author":"killianlucas","children":[],"created_at":"2023-08-30T03:20:41.000Z","created_at_i":1693365641,"id":37317281,"options":[],"parent_id":37317237,"points":null,"story_id":37315866,"text":"Thank you so much!<p>Yes, both \u2014 anywhere you can run Python.<p>For app control, we pass in some system information (like OS) into the system message. The LLM then knows to use Applescript for Mac, PowerShell for Windows, `cal` and `alpine` for Linux, etc.","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T03:14:36.000Z","created_at_i":1693365276,"id":37317237,"options":[],"parent_id":37315866,"points":null,"story_id":37315866,"text":"The demo is on Mac, does this work on Windows or Linux?<p>How does it figure out how to use apps like email and calendar?<p>Looks like magic though.","title":null,"type":"comment","url":null},{"author":"redindian75","children":[{"author":"killianlucas","children":[],"created_at":"2023-08-30T08:43:12.000Z","created_at_i":1693384992,"id":37319217,"options":[],"parent_id":37319048,"points":null,"story_id":37315866,"text":"thanks!  there&#x27;s something magic about LLMs running code, I think.","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T08:14:52.000Z","created_at_i":1693383292,"id":37319048,"options":[],"parent_id":37315866,"points":null,"story_id":37315866,"text":"video looks amazing... almost like magic -","title":null,"type":"comment","url":null},{"author":"robinduckett","children":[{"author":"killianlucas","children":[],"created_at":"2023-08-30T18:49:12.000Z","created_at_i":1693421352,"id":37327001,"options":[],"parent_id":37320715,"points":null,"story_id":37315866,"text":"Thanks so much!","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T11:59:37.000Z","created_at_i":1693396777,"id":37320715,"options":[],"parent_id":37315866,"points":null,"story_id":37315866,"text":"This is absolutely slick. Well done!","title":null,"type":"comment","url":null},{"author":"pedrovhb","children":[{"author":"pplonski86","children":[{"author":"killianlucas","children":[],"created_at":"2023-08-30T19:24:58.000Z","created_at_i":1693423498,"id":37327576,"options":[],"parent_id":37325234,"points":null,"story_id":37315866,"text":"Same! One path forward with Open Interpreter is to make a &quot;self-writing Jupyter notebook&quot; with the same UI as Jupyter\u2014 edit code, rearrange it, export as a py, etc. Any thoughts on how you&#x27;d do that deeper notebook&#x2F;LLM integration, or what it might need?","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T17:03:29.000Z","created_at_i":1693415009,"id":37325234,"options":[],"parent_id":37321174,"points":null,"story_id":37315866,"text":"Do you have any demo or github with  your prototype? Ive checked your blog but no recent posts.<p>I was also thinking about deeper notebook and LLM integration for linear scripts.","title":null,"type":"comment","url":null},{"author":"killianlucas","children":[],"created_at":"2023-08-30T19:21:49.000Z","created_at_i":1693423309,"id":37327544,"options":[],"parent_id":37321174,"points":null,"story_id":37315866,"text":"dozens of great ideas in here pedro.<p>&gt; The main feature allows specific code chunks to be referenced and edited&#x2F;removed&#x2F;appended to.<p>Do you know if it works to just include in the system message something like &quot;When editing a function, don&#x27;t rewrite the whole thing, be sure to edit modules piecemeal e.g. Foo.NestedFooClass.bar_method = ...&quot;?<p>&gt; imports could be auto-added when missing and unambiguous<p>GREAT idea. You&#x27;re write, tons of low hanging fruit here. A preprocess.py file should probably be added to Open Interpreter with all these ideas\u2014 what do LLMs tend to fail at that we can programmatically correct in each code block? Then just run that on each block it writes before asking the user for approval to run it.<p>&gt; logit warping to boost tokens corresponding to names&#x2F;keywords valid in the current scope<p>WOAH. Have you heard of outlines? (<a href=\"https:&#x2F;&#x2F;normal-computing.github.io&#x2F;outlines&#x2F;\" rel=\"nofollow noreferrer\">https:&#x2F;&#x2F;normal-computing.github.io&#x2F;outlines&#x2F;</a>) Lets you put in any Regex you want, then as the LLM is generating, logit bias is used to conform the output to that Regex. Works for local models. I can totally imagine pairing some linting function with outlines to get models to write automatically linted code on the first pass.<p>For my thing, I abandoned IPython since I wanted a more uniform approach to multiple programming languages. Open Interpreter keeps a single subprocess open with `python -i` to get a live Python interpreter that displays a real-time output. It&#x27;s acts the same as IPython, but I can just swap out that command (for example, with `node -i`) to get different languages. I think this also gets around the issues with cell magic, which as you&#x27;ve said, might confuse it\u2014 instead we just ask the model to tell us what language it wants to use + the code it wants to run in a single function call.<p>Have thought a lot about letting the user edit code. The next version of Open Interpreter = an electron app with a UI so you can edit code before it runs, better copy&#x2F;paste, convo history, etc.<p>&gt; with a broken backspace key<p>By the way, have you heard of this idea of training models to use a backspace key? Powerful stuff. We could think about implementing this in preprocess.py \u2014 another pass by GPT-4 or whatever to edit things it thinks isn&#x27;t going to work. To the user it would just look like GPT-4 has a <i>working</i> backspace key.<p>Would love to see your github on these if you&#x27;re willing to share! Open Interpreter is MIT license so ideally I could make it attractive enough &#x2F; similar enough to your project to simply join up &#x2F; contribute some of these ideas.","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T12:45:43.000Z","created_at_i":1693399543,"id":37321174,"options":[],"parent_id":37315866,"points":null,"story_id":37315866,"text":"That&#x27;s nice! I&#x27;ve been thinking a lot about models running code lately, and using GPT-4 with its code interpreter to try out ideas quickly. Have you considered, as OpenAI does, using IPython for this?<p>What strikes me is that there isn&#x27;t yet a great interface for models to explore and edit code. Using the interactive interpreter mode in ChatGPT is a rather frustrating cycle of trying something, it not working properly, and the model continuing to debug it. Each time it does, it has to rewrite the whole code again. Then it has to redefine even unchanged functions to update definitions that reference them. Half of the time, it redefines a class with &quot;# ... (same as above)&quot; and only after executing does it realize the other methods were actually needed, requiring another redefinition. This is quite wasteful, given the current technology&#x27;s context size and output speed limitations.<p>I&#x27;ve been building some tools to make the process faster. Initially, I wrote some IPython extensions and tricked the model into installing them. For instance, IPython allows you to set up an extension that preprocesses cell input before running it. ChatGPT&#x27;s interactive interpreter <i>can</i> use IPython magics like `%%writefile` or `%%bash`, but it runs into silly issues too often. It has a nearly irresistible urge to start the code cell with a comment spelling out it&#x27;s now going to write file XYZ, which invariably breaks magic and means it can&#x27;t write to files without having to make a big multiline string literal and writing to disk with code. To fix this, I made a quick IPython extension to strip off any leading comment lines in a cell where a cell magic was detected.<p>Despite these improvements, the whole process is still really dull. I built a script to generate importable Python modules, including arbitrary pip packages and other code, all crammed into a b64-encoded tar.gz string that automatically extracts and runs the pip install commands when imported. That&#x27;s a long workaround and it really shouldn&#x27;t be this difficult.<p>I pivoted and am now writing a more generic interface for models to write, explore, edit, and run code and tests. I have several half-prototyped ideas, but it&#x27;s starting to take shape. The main feature allows specific code chunks to be referenced and edited&#x2F;removed&#x2F;appended to. This is done by letting the model specify it wants to replace some chunk of code identified by a class&#x2F;function&#x2F;method qualified name, or by sections delimited by `# section: &lt;name&gt;` and `# endsection` comments. This way, it can replace just `Foo.NestedFooClass.bar_method` in xyz_module without redefining the whole module.<p>Then there&#x27;s still a bunch of other low-hanging fruit to implement that I believe can significantly improve the whole process. Automated tests or other analysis like mypy&#x2F;pyright could be run after an edit, documentation could be provided for the relevant objects after an uncaught exception, imports could be auto-added when missing and unambiguous, and better search and exploration tools could be provided to avoid printing out full codebases hogging precious context. Local models offer even more possibilities. For example, early stopping on syntax or name errors could be implemented, along with logit warping to boost tokens corresponding to names&#x2F;keywords valid in the current scope. A lot of these things are already built, just packaged for humans instead (say, the Jedi autocomplete suggestions could be used for identifying tokens to boost).<p>Right now, models are effectively stuck writing code in Notepad with a broken backspace key, and it could be a lot easier than that.","title":null,"type":"comment","url":null},{"author":"kodeninja","children":[{"author":"killianlucas","children":[],"created_at":"2023-08-31T00:14:22.000Z","created_at_i":1693440862,"id":37330883,"options":[],"parent_id":37330334,"points":null,"story_id":37315866,"text":"Let me know how it goes!<p>It works without it, but it will struggle with those tasks (<a href=\"https:&#x2F;&#x2F;github.com&#x2F;KillianLucas&#x2F;open-procedures&#x2F;tree&#x2F;main&#x2F;procedures\">https:&#x2F;&#x2F;github.com&#x2F;KillianLucas&#x2F;open-procedures&#x2F;tree&#x2F;main&#x2F;pr...</a>) because of GPT-4&#x27;s training data cutoff.<p>If you give it the right info (e.g &quot;use Selenium without web package manager&quot;) it works without it. Sometimes it experiments and figures it out anyway.<p>As I use it, do I find lots of tasks it fails at just because of the training data cutoff, so that db is just meant to provide it with up-to-date documentation.<p>Running OI in `--local` mode will disable it though!","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T23:11:30.000Z","created_at_i":1693437090,"id":37330334,"options":[],"parent_id":37315866,"points":null,"story_id":37315866,"text":"This looks very cool! Trying it out now.<p>Question: Is <a href=\"https:&#x2F;&#x2F;open-procedures.replit.app&#x2F;\" rel=\"nofollow noreferrer\">https:&#x2F;&#x2F;open-procedures.replit.app&#x2F;</a> absolutely needed for OI to work?","title":null,"type":"comment","url":null}],"created_at":"2023-08-30T00:03:09.000Z","created_at_i":1693353789,"id":37315866,"options":[],"parent_id":null,"points":82,"story_id":37315866,"text":"Hey HN. Over the summer I built Open Interpreter, a CLI that lets you ask Code-Llama or GPT-4 to write&#x2F;run code.<p>It runs multiple languages (Python, Shell, HTML&#x2F;CSS, Node JS rn) then sends the output back to the language model.<p>It\u2019s essentially an open-source, local implementation of OpenAI\u2019s Code Interpreter. No limits on file size, runtime timeouts, or web access.<p>Everything is streamed beautifully, rendered with Markdown, and syntax highlighted.<p>Try it out and let me know what you tried! - Killian","title":"Show HN: Open Interpreter \u2013 CodeLlama in your terminal, executing code","type":"story","url":"https://openinterpreter.com/"}
