The best Hacker News stories from Show from the past week
Latest posts:
Show HN: GPT Repo Loader – load entire code repos into GPT prompts
I was getting tired of copy/pasting reams of code into GPT-4 to give it context before I asked it to help me, so I started this small tool. In a nutshell, gpt-repository-loader will spit out file paths and file contents in a prompt-friendly format. You can also use .gptignore to ignore files/folders that are irrelevant to your prompt.<p>gpt-repository-loader as-is works pretty well in helping me achieve better responses. Eventually, I thought it would be cute to load itself into GPT-4 and have GPT-4 improve it. I was honestly surprised by PR#17. GPT-4 was able to write a valid an example repo and an expected output and throw in a small curveball by adjusting .gptignore. I did tell GPT the output file format in two places: 1.) in the preamble when I prompted it to make a PR for issue #16 and 2.) as a string in gpt_repository_loader.py, both of which are indirect ways to infer how to build a functional test. However, I don't think I explained to GPT in English anywhere on how .gptignore works at all!<p>I wonder how far GPT-4 can take this repo. Here is the process I'm following for developing:<p>- Open an issue describing the improvement to make<p>- Construct a prompt - start with using gpt_repository_loader.py on this repo to generate the repository context, then append the text of the opened issue after the --END-- line.<p>- Try not to edit any code GPT-4 generates. If there is something wrong, continue to prompt GPT to fix whatever it is.<p>- Create a feature branch on the issue and create a pull request based on GPT's response.<p>- Have a maintainer review, approve, and merge.<p>I am going to try to automate the steps above as much as possible. Really curious how tight the feedback loop will eventually get before something breaks!
Show HN: GPT Repo Loader – load entire code repos into GPT prompts
I was getting tired of copy/pasting reams of code into GPT-4 to give it context before I asked it to help me, so I started this small tool. In a nutshell, gpt-repository-loader will spit out file paths and file contents in a prompt-friendly format. You can also use .gptignore to ignore files/folders that are irrelevant to your prompt.<p>gpt-repository-loader as-is works pretty well in helping me achieve better responses. Eventually, I thought it would be cute to load itself into GPT-4 and have GPT-4 improve it. I was honestly surprised by PR#17. GPT-4 was able to write a valid an example repo and an expected output and throw in a small curveball by adjusting .gptignore. I did tell GPT the output file format in two places: 1.) in the preamble when I prompted it to make a PR for issue #16 and 2.) as a string in gpt_repository_loader.py, both of which are indirect ways to infer how to build a functional test. However, I don't think I explained to GPT in English anywhere on how .gptignore works at all!<p>I wonder how far GPT-4 can take this repo. Here is the process I'm following for developing:<p>- Open an issue describing the improvement to make<p>- Construct a prompt - start with using gpt_repository_loader.py on this repo to generate the repository context, then append the text of the opened issue after the --END-- line.<p>- Try not to edit any code GPT-4 generates. If there is something wrong, continue to prompt GPT to fix whatever it is.<p>- Create a feature branch on the issue and create a pull request based on GPT's response.<p>- Have a maintainer review, approve, and merge.<p>I am going to try to automate the steps above as much as possible. Really curious how tight the feedback loop will eventually get before something breaks!
Show HN: Can you beat my dad at Scrabble?
My Failure Resume
Show HN: Alpaca.cpp – Run an Instruction-Tuned Chat-Style LLM on a MacBook
Show HN: Alpaca.cpp – Run an Instruction-Tuned Chat-Style LLM on a MacBook
Show HN: AI explanations for other people’s code
Hi HN,<p>As a developer, I much prefer to write code than read other people’s code. But most projects I work on involve other developers so it’s hard to avoid. Often I find it really hard to quickly parse other people’s code so I thought maybe ChatGPT could help.<p>ChatGPT does a really nice job of giving clear explanations when you paste in code and ask it to explain it. But the interface is a bit of a pain to use if you’re using it many times a day. It’s also hard to share explanations with co-workers. So I built whatdoesthiscodedo.com. Just paste your code and get your ChatGPT explanation and a sharable link you can give to coworkers.<p>I’m hopeful it can also be helpful to folks who aren’t professional developers. My co-founder at my main company, Beam Analytics, is more of a product guy so only needs to write scripts etc. Before, he’d often just find code online to copy and then struggle to make it work. But with this tool, he says he’s getting better intuition in understanding the code he’s using, and how to modify it.<p>We’d love your feedback. Email us at hi (at) beamanalytics.io or DM me on twitter @TheBuilderJR
Show HN: Modern Font Stacks – New system font stack CSS for modern OSs
Show HN: Using GPT-3 and Whisper to save doctors’ time
Hey HN,<p>We're Alex, Martin and Laurent. We previously founded Wit.ai (W14), which we sold to Facebook in 2015. Since 2019, we've been working on Nabla (<a href="https://nabla.com" rel="nofollow">https://nabla.com</a>), an intelligent assistant for health practitioners.<p>When GPT-3 was released in 2020, we investigated it's usage in a medical context[0], to mixed results.<p>Since then we’ve kept exploring opportunities at the intersection of healthcare and AI, and noticed that doctors spend am awful lot of time on medical documentation (writing clinical notes, updating their EHR, etc.).<p>Today, we're releasing Nabla Copilot, a Chrome extension generating clinical notes from video consultations, to address this problem.<p>You can try it out, without installation nor sign up, on our demo page: <a href="https://nabla.com/copilot-demo/" rel="nofollow">https://nabla.com/copilot-demo/</a><p>Here’s how it works under the hood:<p>- When a doctor starts a video consultation, our Chrome extension auto-starts itself and listens to the active tab as well as the doctor’s microphone.<p>- We then transcribe the consultation using a fine-tuned version of Whisper. We've trained Whisper with tens of thousands of hours of medical consultation and medical terms recordings, and we have now reached an error rate which is 3× lower than Google's Speech-To-Text.<p>- Once we have the transcript, we feed it to a heavily trained GPT-3, which generates a clinical note.<p>- We finally return the clinical note to the doctor through our Chrome extension, the doctor can copy it to their EHR, and send a version to the patient.<p>This allows doctors to be fully focused on their consultation, and saves them a lot time.<p>Next, we want to make this work for in-person consultation.<p>We also want to extract structured data (in the FHIR standard) from the clinical note, and feed it to the doctor’s EHR so that it is automatically added to the patient's record.<p>Happy to further discuss technical details in comments!<p>---<p>[0]: <a href="https://nabla.com/blog/gpt-3/" rel="nofollow">https://nabla.com/blog/gpt-3/</a>
Show HN: Counter – Simple and free web analytics
Show HN: I built an autopilot for the lunar lander game
I got pretty good at (and very addicted to) the lunar lander game from a few days ago...<p>so I decided to make an autopilot for the lander based on what I felt like was the best strategy! Now I can have perfect landings every time without lifting a finger :D<p>Writing the autopilot code was a lot more fun than I expected! It felt a bit like programming a robot.<p>Source code: <a href="https://github.com/szhu/lunar-lander-autopilot">https://github.com/szhu/lunar-lander-autopilot</a><p>Original lander HN post: <a href="https://news.ycombinator.com/item?id=35032506" rel="nofollow">https://news.ycombinator.com/item?id=35032506</a>
Show HN: CodeGPT.nvim – ChatGPT plugin for Neovim
Show HN: BBC “In Our Time”, categorised by Dewey Decimal, heavy lifting by GPT
I'm a big fan of the BBC podcast In Our Time -- and (like most people) I've been playing with the OpenAI APIs.<p>In Our Time has almost 1,000 episodes on everything from Cleopatra to the evolution of teeth to plasma physics, all still available, so it's my starting point to learn about most topics. But it's not well organised.<p>So here are the episodes sorted by library code. It's fun to explore.<p>Web scraping is usually pretty tedious, but I found that I could send the minimised HTML to GPT-3 and get (almost) perfect JSON back: the prompt includes the Typescript definition.<p>At the same time I asked for a Dewey classification... and it worked. So I replaced a few days of fiddly work with 3 cents per inference and an overnight data run.<p>My takeaway is that I'll be using LLMs as function call way more in the future. This isn't "generative" AI, more "programmatic" AI perhaps?<p>So I'm interested in what temperature=0 LLM usage looks like (you want it to be pretty deterministic), at scale, and what a language that treats that as a first-class concept might look like.
Show HN: I built a better UI for ChatGPT
Show HN: NESFab – Programming language for making NES games
This is a long-running personal project I've had to write an optimizing compiler from scratch. Everything was done by me, including the lexer/parser, SSA-based IR, high-performance data structures, and code generator.<p>Originally I wasn't targeting the NES. It started as a scripting language, then it morphed into a C++ replacement, and then finally I turned it into what it is today. The large scope of the project and colorful history means it's still a little rough around the edges, but it's now working well enough to post.
Show HN: Total.js – Low-code development (Node-RED alternative)
Show HN: Faster FastAPI with simdjson and io_uring on Linux 5.19
A few months ago, I benchmarked FastAPI on an i9 MacBook Pro. I couldn't believe my eyes. A primary REST endpoint to `sum` two integers took 6 milliseconds to evaluate. It is okay if you are targeting a server in another city, but it should be less when your client and server apps are running on the same machine.<p>FastAPI would have bottleneck-ed the inference of our lightweight UForm neural networks recently trending on HN under the title "Beating OpenAI CLIP with 100x less data and compute". (Thank you all for the kind words!) So I wrote another library.<p>It has been a while since I have written networking libraries, so I was eager to try the newer io_uring networking functionality added by Jens Axboe in kernel 5.19. TLDR: It's excellent! We used pre-registered buffers and re-allocated file descriptors from a managed pool. Some other parts, like multi-shot requests, also look intriguing, but we couldn't see a flawless way to integrate them into UJRPC. Maybe next time.<p>Like a parent with two kids, we tell everyone we love Kernel Bypass and SIMD equally. So I decided to combine the two, potentially implementing one of the fastest implementations of the most straightforward RPC protocol - JSON-RPC. ~~Healthy and Fun~~ Efficient and Simple, what can be better?<p>By now, you may already guess at least one of the dependencies - `simdjson` by Daniel Lemiere, that has become the industry standard. io_uring is generally very fast, even with a single core. Adding more polling threads may only increase congestion. We needed to continue using no more than one thread, but parsing messages may involve more work than just invoking a JSON parser.<p>JSON-RPC is transport agnostic. The incoming requests can be sent over HTTP, pre-pended by rows of headers. Those would have to be POSTs and generally contain Content-Length and Content-Type. There is a SIMD-accelerated library for that as well. It is called `picohttpparser`, uses SSE, and is maintained by H2O.<p>The story doesn't end there. JSON is limited. Passing binary strings is a nightmare. The most common approach is to encode them with base-64. So we took the Turbo-Base64 from the PowTurbo project to decode those binary strings.<p>The core implementation of UJRPC is under 2000 lines of C++. Knowing that those lines connect 3 great libraries with the newest and coolest parts of Linux is enough to put a smile on my face. Most people are more rational, so here is another reason to be cheerful.<p>- FastAPI throughput: 3'184 rps.
- Python gRPC throughput: 9'849 rps.
- UJRPC throughput:
-- Python server with io_uring: 43'000 rps.
-- C server with POSIX: 79'000 rps.
-- C server with io_uring: 231'000 rps.<p>Granted, this is yet to be your batteries-included server. It can't balance the load, manage threads, spell S in HTTPS, or call parents when you misbehave in school. But at least part of it you shouldn't expect from a web server.<p>After following the standardization process of executors in C++ for the last N+1 years, we adapted the "bring your runtime" and "bring your thread-pool" policies. HTTPS support, however, is our next primary objective.<p>---<p>Of course, it is a pre-production project and must have a lot of bugs. Don't hesitate to report them. We have huge plans for this tiny package and will potentially make it the default transport of UKV: <a href="https://github.com/unum-cloud/ukv">https://github.com/unum-cloud/ukv</a>
Show HN: OpenBB Terminal – Investment research for everyone
Show HN: OpenBB Terminal – Investment research for everyone
Show HN: Llama-dl – high-speed download of LLaMA, Facebook's 65B GPT model