The best Hacker News stories from Show from the past week
Latest posts:
Show HN: Shimmer – ADHD coaching for adults, now on web
Hi, I’m Chris, one of the co-founders of Shimmer. Last October, following my ADHD diagnosis, I launched Shimmer (<a href="https://shimmer.care">https://shimmer.care</a>), one-to-one ADHD Coaching for adults. Our HN launch was here: <a href="https://news.ycombinator.com/item?id=33468611">https://news.ycombinator.com/item?id=33468611</a>.<p>A quick recap before I dive into our new launch: Shimmer is an ADHD coaching service for adults. We took apart the traditionally expensive, inaccessible ADHD coaching offering ($300-600+/session) and redesigned it from first principles. You get matched with one of our expert ADHD coaches, meet weekly over video, and get supported throughout the week via text and with learning tools. This solution is special to me personally (and our community) because it doesn’t just give you “knowledge” or offer another “tool”—our coaches help you set realistic goals, take personalized steps towards it, and keep you accountable.<p>Today we’re excited to launch our most-request feature: Web.<p>Over the past 9 months, we learned (and iterated) a lot with our members and coaches. A few key challenges pointed to the need for a web version:
(1) ADHD “object permanence” challenges (e.g. out of sight out of mind), we needed to be multi-platform so when you finish a task or goal or encounter a challenge, regardless of if you’re near your laptop or phone, you can check it off & ping your coach right away,
(2) members used reflection modules (e.g. after each task, you’re prompted to reflect on what worked and didn’t work, and it informs your coach) more thoroughly than we originally anticipated, and web allows for deeper reflection and typing,
(3) overarching coaching goals were often forgotten during the day-to-day, and the web makes it easier to use visual cues to keep goals top of mind for motivation,
(4) many of our members struggle with phone addiction and driving members to the mobile app ended them up in Tiktok/IG, whereas the web app offers a focused environment to get in their “coaching zone”.<p>Our new web app was designed alongside over 1,200 members, 22 coaches, countless hours of testing and iterating. We’re excited (but nervous!) to unveil this new version. If you have ADHD (or think you do), we’d love for you to check out our platform and give us critical feedback (or positive reinforcement!). It’s a super streamlined and ADHD-friendly signup process and in honor of our web launch and back to school/work, the first month is 30% off.<p>Our pricing: $115/mo. for Essentials plan (15-min weekly sessions), $230/mo. for Standard plan (30-min weekly sessions), $345/mo. for Immersive plan (45-min weekly sessions); all plans additional 30% off first month, HSA/FSA-eligible.<p>We know these prices are expensive for many people with ADHD and we’re committed to bringing costs down over time. It’s more affordable than what many people are paying for coaches, but the fact that we’re relying on humans, and not going the “we can automate all this with AI” route, puts a floor on how low the costs can drop. That said, here are some actions we’re taking to drive down costs for those who need it: (1) we offer needs-based scholarships and aim to have 5% of members on them at any time, (2) we often run fully sponsored scholarships with our partners—over 40 full ride scholarships and 100 group coaching spots have been disbursed alongside Asian Mental Health Project, government of Canada, and more, and (3) we have aligned our coaching model alongside Health & Wellness Coaching, which is expected to be reimbursed in 2024. If you have ideas or expertise here, please reach out to me directly at chris@shimmer.care.<p>On behalf of our small but mighty & passionate Shimmer team, I’m excited for the Hacker News community to share your thoughts, feedback, and ideas. If you feel comfortable, I’d also love to hear your personal ADHD story and what has worked / hasn’t worked for you.<p>Co-founders Christal & Vikram
Show HN: Open-source obsidian.md sync server
<a href="https://github.com/acheong08/obsidian-sync">https://github.com/acheong08/obsidian-sync</a><p>Hello HN,<p>I'm a recent high school graduate and can't afford $8 per month for the official sync service, so I tried my hand at replicating the server.<p>It's still missing a few features, such as file recovery and history, but the basic sync is working.<p>To the creators of Obsidian.md: I'm probably violating the TOS, and I'm sorry. I'll take down the repository if asked. It's not ready for production and is highly inefficient; Not competition, so I hope you'll be lenient.
Show HN: Open-source obsidian.md sync server
<a href="https://github.com/acheong08/obsidian-sync">https://github.com/acheong08/obsidian-sync</a><p>Hello HN,<p>I'm a recent high school graduate and can't afford $8 per month for the official sync service, so I tried my hand at replicating the server.<p>It's still missing a few features, such as file recovery and history, but the basic sync is working.<p>To the creators of Obsidian.md: I'm probably violating the TOS, and I'm sorry. I'll take down the repository if asked. It's not ready for production and is highly inefficient; Not competition, so I hope you'll be lenient.
Show HN: Dataherald AI – Natural Language to SQL Engine
Hi HN community. We are excited to open source Dataherald’s natural-language-to-SQL engine today (<a href="https://github.com/Dataherald/dataherald">https://github.com/Dataherald/dataherald</a>). This engine allows you to set up an API from your structured database that can answer questions in plain English.<p>GPT-4 class LLMs have gotten remarkably good at writing SQL. However, out-of-the-box LLMs and existing frameworks would not work with our own structured data at a necessary quality level. For example, given the question “what was the average rent in Los Angeles in May 2023?” a reasonable human would either assume the question is about Los Angeles, CA or would confirm the state with the question asker in a follow up. However, an LLM translates this to:<p>select price from rent_prices where city=”Los Angeles” AND month=”05” AND year=”2023”<p>This pulls data for Los Angeles, CA and Los Angeles, TX without getting columns to differentiate between the two. You can read more about the challenges of enterprise-level text-to-SQL in this blog post I wrote on the topic: <a href="https://medium.com/dataherald/why-enterprise-natural-language-to-sql-is-hard-8849414f41c" rel="nofollow noreferrer">https://medium.com/dataherald/why-enterprise-natural-languag...</a><p>Dataherald comes with “batteries-included.” It has best-in-class implementations of core components, including, but not limited to: a state of the art NL-to-SQL agent, an LLM-based SQL-accuracy evaluator. The architecture is modular, allowing these components to be easily replaced. It’s easy to set up and use with major data warehouses.<p>There is a “Context Store” where information (NL2SQL examples, schemas and table descriptions) is used for the LLM prompts to make the engine get better with usage. And we even made it fast!<p>This version allows you to easily connect to PG, Databricks, BigQuery or Snowflake and set up an API for semantic interactions with your structured data. You can then add business and data context that are used for few-shot prompting by the engine.<p>The NL-to-SQL agent in this open source release was developed by our own Mohammadreza Pourreza, whose DIN-SQL algorithm is currently top of the Spider (<a href="https://yale-lily.github.io/spider" rel="nofollow noreferrer">https://yale-lily.github.io/spider</a>) and Bird (<a href="https://bird-bench.github.io/" rel="nofollow noreferrer">https://bird-bench.github.io/</a>) NL 2 SQL benchmarks. This agent has outperformed the Langchain SQLAgent anywhere from 12%-250%.5x (depending on the provided context) in our own internal benchmarking while being only ~15s slower on average.<p>Needless to say, this is an early release and the codebase is under swift development. We would love for you to try it out and give us your feedback! And if you are interested in contributing, we’d love to hear from you!
Show HN: Dataherald AI – Natural Language to SQL Engine
Hi HN community. We are excited to open source Dataherald’s natural-language-to-SQL engine today (<a href="https://github.com/Dataherald/dataherald">https://github.com/Dataherald/dataherald</a>). This engine allows you to set up an API from your structured database that can answer questions in plain English.<p>GPT-4 class LLMs have gotten remarkably good at writing SQL. However, out-of-the-box LLMs and existing frameworks would not work with our own structured data at a necessary quality level. For example, given the question “what was the average rent in Los Angeles in May 2023?” a reasonable human would either assume the question is about Los Angeles, CA or would confirm the state with the question asker in a follow up. However, an LLM translates this to:<p>select price from rent_prices where city=”Los Angeles” AND month=”05” AND year=”2023”<p>This pulls data for Los Angeles, CA and Los Angeles, TX without getting columns to differentiate between the two. You can read more about the challenges of enterprise-level text-to-SQL in this blog post I wrote on the topic: <a href="https://medium.com/dataherald/why-enterprise-natural-language-to-sql-is-hard-8849414f41c" rel="nofollow noreferrer">https://medium.com/dataherald/why-enterprise-natural-languag...</a><p>Dataherald comes with “batteries-included.” It has best-in-class implementations of core components, including, but not limited to: a state of the art NL-to-SQL agent, an LLM-based SQL-accuracy evaluator. The architecture is modular, allowing these components to be easily replaced. It’s easy to set up and use with major data warehouses.<p>There is a “Context Store” where information (NL2SQL examples, schemas and table descriptions) is used for the LLM prompts to make the engine get better with usage. And we even made it fast!<p>This version allows you to easily connect to PG, Databricks, BigQuery or Snowflake and set up an API for semantic interactions with your structured data. You can then add business and data context that are used for few-shot prompting by the engine.<p>The NL-to-SQL agent in this open source release was developed by our own Mohammadreza Pourreza, whose DIN-SQL algorithm is currently top of the Spider (<a href="https://yale-lily.github.io/spider" rel="nofollow noreferrer">https://yale-lily.github.io/spider</a>) and Bird (<a href="https://bird-bench.github.io/" rel="nofollow noreferrer">https://bird-bench.github.io/</a>) NL 2 SQL benchmarks. This agent has outperformed the Langchain SQLAgent anywhere from 12%-250%.5x (depending on the provided context) in our own internal benchmarking while being only ~15s slower on average.<p>Needless to say, this is an early release and the codebase is under swift development. We would love for you to try it out and give us your feedback! And if you are interested in contributing, we’d love to hear from you!
Show HN: FlakeHub – Discover and publish Nix flakes
Show HN: Just intonation keyboard – play music without knowing music
This is a keyboard in just intonation. It can play the notes a piano can. The big difference from a piano is that all the notes become consonant. At least, when you want to play a dissonant chord, you are clearly opting in to it because it's clear which notes are dissonant to each other. You won't bump into a dissonant note by mistake.<p>You can play without knowing any music theory. Hit arbitrary notes with the rhythm you want, and the pitches will work. Not understanding the buttons is fine. Even rolling your elbow around your keyboard is fine.<p>If you are a musician and press the wrong key while playing a song, it will still fit. It will sound like you made an intelligent, conscious choice to play another note, even though you know in your heart it was an accident. Beginner jazz musicians rejoice.<p>It's not an AI making choices for you; it's just a very elegant interface. What makes this possible is several new discoveries in psychoacoustics about how harmony works. While a piano lays out notes in pitch space, this keyboard is able to lay out notes in consonance space. When you play random notes, they tend to be "close together" on the physical keyboard. Distance on the keyboard maps well to distance in consonance space, so those random notes are close together in consonance space and sound good together.<p>According to Miles Davis, a "wrong" note becomes correct in the right context. If you try to play a wrong note, the purple buttons you press will automatically land you in the right context, even if you don't know what that context is yourself. So you can stumble your way through an improv and the keyboard will offer the right notes without needing you to think about it.<p>Harmonic consonance of chords can be read directly off the numbers in the keyboard, which implies that these numbers are a good language to think about music with. It doesn't take years of training, just reading the rules. The key harmony insight that you can do on this keyboard, and not on a piano, is to add frequencies linearly (like 400 Hz + 300 Hz). The reason this matters is that linear combinations of frequencies are a major factor of harmony, in lattice tones. So to see how dissonant or consonant a chord is, you want to check how distant it is from a sum or arithmetic progression. On a piano, to do the same, you'd have to memorize fractional approximations of 2^(N/12), then add and subtract these fractions, which is very difficult. For example, how far is 6/5 + 4/3 from 5/2? Hard to say! But if denominators are cleared, it's easy to compare 36 40 45: they're off by 1 from an arithmetic progression. This also applies to overlapping notes, not just chords. Having all the keys accessible on a piano is very convenient, but this translation layer of 2^(N/12) approximation + fractional arithmetic makes it hard to see harmony beyond the pairwise ratios.<p>The subset of playable songs is different from a piano, which means that songs in your existing piano repertoire will snip off some notes. Hardware for thumb keys would fix this, so you could play your existing piano songs in full, plus other songs a piano can't play. I don't have such hardware so I haven't implemented this. The other way is to have two keyboards and a partner.<p>The remaining issue is that there is no sheet music in just intonation. Unfortunately, I have had no success in finding piano sheet music in a common, interpretable format. So while I do have a converter from 12 equal temperament to just intonation, there are no input files to use it with...
Show HN: A simple, open-source Notion-like avatar generator
Show HN: Rivet – Open-source game server management with Nomad and Rust
Hey HN!<p>Rivet is an OSS game server management tool that enables game developers to easily deploy their dedicated servers without any infra experience.<p>We recently open-sourced Rivet after working on it for the past couple of years. I wanted to share some of my favorite things about our experience building this with the HN community.<p>My cofounder and I have been building multiplayer games together since middle school for fun (and not much profit [1]). In HS, I stumbled into building the entire infrastructure powering [Krunker.io](<a href="http://Krunker.io" rel="nofollow noreferrer">http://Krunker.io</a>) (acq by FRVR) & other popular multiplayer web games. After wasting months rebuilding dedicated server infrastructure + DDoS/bot mitigation over and over, we started building Rivet as a side project.<p>Some interesting tidbits:<p>- ~99% Rust and a smidgeon of Lua.<p>- Bolt [2] – Cluster dev & management toolchain for super configurable self-hosted Rivet clusters. It’s way over-engineered.<p>- The entire repo is usable as a library. Our EE repo uses OSS as a submodule.<p>- Traefik used as an edge proxy for low-latency UDP, TCP+TLS, & WSS traffic.<p>- Apache Traffic Server is under-appreciated as a large file cache. Used as an edge Docker pull-through cache to improve cold starts & as a CDN cache to lower our S3 bill.<p>- ClickHouse used for analytics & game server logs. It’s so simple, I have nothing more to say.<p>- Serving Docker images with Apache TS is simpler & cheaper than running a Docker pull-through cache.<p>- Nebula has been rock solid & easy to operate as our overlay network.<p>- We use Redis Lua scripts for complex, atomic, in-memory operations.<p>- Obviously, we love Nix.<p>- We keep a rough SBOM [3].<p>- Licensed under Apache 2.0 (OSI-approved). We seriously want people to run & tinker with Rivet themselves. We get a lot of questions about this: [4] [5]<p>Some HN-flavored FAQ:<p>> Why not build on top of Agones or Kubernetes?<p>Nomad is simpler & more flexible than Agones/Kubernetes out of the box, which let us get up and running faster. For example, Nomad natively supports multiple task drivers, edge workloads, and runs as a standalone binary.<p>> [Fly.io](<a href="http://Fly.io">http://Fly.io</a>) migrated off of Nomad, how will you scale?<p>Nomad can support 2M containers [6]. Some quick math: avg 8 players per lobby * 2M lobbies * 8 regional clusters = ~128M CCU. That’s well above PUBG’s 3.2m CCU peak.<p>Roblox’s game servers also run on top of Nomad [7]. We’re in good company.<p>> Are you affected by the recent Nomad BSL relicensing [8]?<p>Maybe, see [9].<p>> How do you compare to $X?<p>Our core goal is to get developers up and running as fast as possible. We provide extra services like our matchmaker [10], CDN [11], and KV [12] to make shipping a fully-fledged multiplayer game require only a couple of lines of code.<p>No other project provides a comparably accessible, OSS, and comprehensive game server manager.<p>> Do you handle networking logic?<p>No. We work with existing tools like FishNet, Mirror, NGO, Unreal & Godot replication, and anything else you can run in Docker.<p>> Is anyone actually using this?<p>Yes, we’ve been running in closed beta since Jan ‘22 and currently support millions of MAU across many titles.<p>[1]: <a href="https://github.com/rivet-gg/microgravity.io">https://github.com/rivet-gg/microgravity.io</a><p>[2]: <a href="https://github.com/rivet-gg/rivet/tree/main/docs/libraries/bolt">https://github.com/rivet-gg/rivet/tree/main/docs/libraries/b...</a><p>[3]: <a href="https://github.com/rivet-gg/rivet/blob/main/docs/infrastructure/SBOM.md">https://github.com/rivet-gg/rivet/blob/main/docs/infrastruct...</a><p>[4]: <a href="https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/LICENSING.md">https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/...</a><p>[5]: <a href="https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/WHY_OPEN_SOURCE.md">https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/...</a><p>[6]: <a href="https://www.hashicorp.com/c2m" rel="nofollow noreferrer">https://www.hashicorp.com/c2m</a><p>[7]: <a href="https://www.hashicorp.com/case-studies/roblox" rel="nofollow noreferrer">https://www.hashicorp.com/case-studies/roblox</a><p>[8]: <a href="https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license" rel="nofollow noreferrer">https://www.hashicorp.com/blog/hashicorp-adopts-business-sou...</a><p>[9]: <a href="https://news.ycombinator.com/item?id=37084825">https://news.ycombinator.com/item?id=37084825</a><p>[10]: <a href="https://rivet.gg/docs/matchmaker">https://rivet.gg/docs/matchmaker</a><p>[11]: <a href="https://rivet.gg/docs/cdn">https://rivet.gg/docs/cdn</a><p>[12]: <a href="https://rivet.gg/docs/kv">https://rivet.gg/docs/kv</a>
Show HN: Rivet – Open-source game server management with Nomad and Rust
Hey HN!<p>Rivet is an OSS game server management tool that enables game developers to easily deploy their dedicated servers without any infra experience.<p>We recently open-sourced Rivet after working on it for the past couple of years. I wanted to share some of my favorite things about our experience building this with the HN community.<p>My cofounder and I have been building multiplayer games together since middle school for fun (and not much profit [1]). In HS, I stumbled into building the entire infrastructure powering [Krunker.io](<a href="http://Krunker.io" rel="nofollow noreferrer">http://Krunker.io</a>) (acq by FRVR) & other popular multiplayer web games. After wasting months rebuilding dedicated server infrastructure + DDoS/bot mitigation over and over, we started building Rivet as a side project.<p>Some interesting tidbits:<p>- ~99% Rust and a smidgeon of Lua.<p>- Bolt [2] – Cluster dev & management toolchain for super configurable self-hosted Rivet clusters. It’s way over-engineered.<p>- The entire repo is usable as a library. Our EE repo uses OSS as a submodule.<p>- Traefik used as an edge proxy for low-latency UDP, TCP+TLS, & WSS traffic.<p>- Apache Traffic Server is under-appreciated as a large file cache. Used as an edge Docker pull-through cache to improve cold starts & as a CDN cache to lower our S3 bill.<p>- ClickHouse used for analytics & game server logs. It’s so simple, I have nothing more to say.<p>- Serving Docker images with Apache TS is simpler & cheaper than running a Docker pull-through cache.<p>- Nebula has been rock solid & easy to operate as our overlay network.<p>- We use Redis Lua scripts for complex, atomic, in-memory operations.<p>- Obviously, we love Nix.<p>- We keep a rough SBOM [3].<p>- Licensed under Apache 2.0 (OSI-approved). We seriously want people to run & tinker with Rivet themselves. We get a lot of questions about this: [4] [5]<p>Some HN-flavored FAQ:<p>> Why not build on top of Agones or Kubernetes?<p>Nomad is simpler & more flexible than Agones/Kubernetes out of the box, which let us get up and running faster. For example, Nomad natively supports multiple task drivers, edge workloads, and runs as a standalone binary.<p>> [Fly.io](<a href="http://Fly.io">http://Fly.io</a>) migrated off of Nomad, how will you scale?<p>Nomad can support 2M containers [6]. Some quick math: avg 8 players per lobby * 2M lobbies * 8 regional clusters = ~128M CCU. That’s well above PUBG’s 3.2m CCU peak.<p>Roblox’s game servers also run on top of Nomad [7]. We’re in good company.<p>> Are you affected by the recent Nomad BSL relicensing [8]?<p>Maybe, see [9].<p>> How do you compare to $X?<p>Our core goal is to get developers up and running as fast as possible. We provide extra services like our matchmaker [10], CDN [11], and KV [12] to make shipping a fully-fledged multiplayer game require only a couple of lines of code.<p>No other project provides a comparably accessible, OSS, and comprehensive game server manager.<p>> Do you handle networking logic?<p>No. We work with existing tools like FishNet, Mirror, NGO, Unreal & Godot replication, and anything else you can run in Docker.<p>> Is anyone actually using this?<p>Yes, we’ve been running in closed beta since Jan ‘22 and currently support millions of MAU across many titles.<p>[1]: <a href="https://github.com/rivet-gg/microgravity.io">https://github.com/rivet-gg/microgravity.io</a><p>[2]: <a href="https://github.com/rivet-gg/rivet/tree/main/docs/libraries/bolt">https://github.com/rivet-gg/rivet/tree/main/docs/libraries/b...</a><p>[3]: <a href="https://github.com/rivet-gg/rivet/blob/main/docs/infrastructure/SBOM.md">https://github.com/rivet-gg/rivet/blob/main/docs/infrastruct...</a><p>[4]: <a href="https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/LICENSING.md">https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/...</a><p>[5]: <a href="https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/WHY_OPEN_SOURCE.md">https://github.com/rivet-gg/rivet/blob/main/docs/philosophy/...</a><p>[6]: <a href="https://www.hashicorp.com/c2m" rel="nofollow noreferrer">https://www.hashicorp.com/c2m</a><p>[7]: <a href="https://www.hashicorp.com/case-studies/roblox" rel="nofollow noreferrer">https://www.hashicorp.com/case-studies/roblox</a><p>[8]: <a href="https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license" rel="nofollow noreferrer">https://www.hashicorp.com/blog/hashicorp-adopts-business-sou...</a><p>[9]: <a href="https://news.ycombinator.com/item?id=37084825">https://news.ycombinator.com/item?id=37084825</a><p>[10]: <a href="https://rivet.gg/docs/matchmaker">https://rivet.gg/docs/matchmaker</a><p>[11]: <a href="https://rivet.gg/docs/cdn">https://rivet.gg/docs/cdn</a><p>[12]: <a href="https://rivet.gg/docs/kv">https://rivet.gg/docs/kv</a>
Show HN: Aviation navigation log on $20 receipt printer
Show HN: Aviation navigation log on $20 receipt printer
Show HN: LlamaGPT – Self-hosted, offline, private AI chatbot, powered by Llama 2
CSS Selectors: A Visual Guide
Show HN: AI-town, run your own custom AI world SIM with JavaScript
Hi HN community! We want to share AI-town, a deployable starter kit for building and customizing your own version of AI simulation - a virtual town where AI characters live, chat and socialize.<p>Inspired by great work from the Stanford Generative Agent paper (<a href="https://arxiv.org/abs/2304.03442" rel="nofollow noreferrer">https://arxiv.org/abs/2304.03442</a>).<p>A few features:
- Includes a convex.dev backed server-side game engine that handles global state
- Multiplayer ready. Deployment ready
- 100% Typescript
- Easily customizable. You can fork it, change character memories, add new sprites/tiles and you have a custom AI simulation<p>The goal is to democratize building your own simulation environment with AI agents. Would love to see the community build more complex interactions on top of this. Let us know what you think!<p>Demo: <a href="https://www.convex.dev/ai-town" rel="nofollow noreferrer">https://www.convex.dev/ai-town</a><p>I made a world Cat Town to demonstrate how to customize AI town. Using C(h)atGPT :)<p>Demo: <a href="https://cat-town.fly.dev/" rel="nofollow noreferrer">https://cat-town.fly.dev/</a>
Code: <a href="https://github.com/ykhli/cat-town">https://github.com/ykhli/cat-town</a>
Show HN: Little Rat – Chrome extension monitors network calls of all extensions
Hi HN<p>I needed a way to monitor network calls made by chrome extensions so I made a small extension.<p>You can install it by dropping the zip or crx into the extensions page. It'll be on the chrome store whenever/if it gets through the review.<p>Hopefully it's useful to others.<p><a href="https://github.com/dnakov/little-rat">https://github.com/dnakov/little-rat</a><p><a href="https://twitter.com/dnak0v" rel="nofollow noreferrer">https://twitter.com/dnak0v</a>
Show HN: LLMs can generate valid JSON 100% of the time
Outlines is a Python library that focuses on text generation with large language models. Brandon and I are not LLM experts and started the project a few months ago because we wanted to understand better how the generation process works. Our original background is probabilistic, relational and symbolic programming.<p>Recently we came up with a fast way to generate text that matches a regex (<a href="https://blog.normalcomputing.ai/posts/2023-07-27-regex-guided-generation/regex-guided-generation.html" rel="nofollow noreferrer">https://blog.normalcomputing.ai/posts/2023-07-27-regex-guide...</a>). The basic idea is simple: regular expressions have an equivalent Deterministic-Finite Automaton (DFA) representation. We can transform this DFA into a generative model: in each state we get a list of symbols which correspond to completions that partially match the regular expression. We mask the other symbols in the logits returned by a large language model, sample a new symbol and move to the next state. The subtelty is that language models work with tokens, not symbols, so we derive a new FSM whose alphabet is the model's vocabulary. We can do this in only one pass over the vocabulary.<p>Generating the token masks thus only requires a dictionary lookup at each state. Our method blows other libraries like Microsoft's guidance out of the water.<p>From there it was only a small leap to be able to generate text that follows a JSON schema (<a href="https://json-schema.org/" rel="nofollow noreferrer">https://json-schema.org/</a>), or is parseable into a Pydantic model (<a href="https://docs.pydantic.dev/latest/usage/models/" rel="nofollow noreferrer">https://docs.pydantic.dev/latest/usage/models/</a>). The method works with union types, optional types, nested schemas, arrays, everything. It is guaranteed that the output is parseable.<p>I think it's cool, and I've spent a lot of time watching even tiny models output valid JSON over the weekend. Hope you will too.<p>I look forward to feedback, bug reports, feature requests and discussions!<p>Edit: Link to our pre-print explaining the method and how this can be extended to generate text that follows a Context-Free Grammar <a href="https://arxiv.org/abs/2307.09702" rel="nofollow noreferrer">https://arxiv.org/abs/2307.09702</a>
Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
I wrote a relational database management system (RDBMS) (sqlite clone) from scratch in pure Python.
Show HN: I wrote a RDBMS (SQLite clone) from scratch in pure Python
I wrote a relational database management system (RDBMS) (sqlite clone) from scratch in pure Python.
Show HN: Pip Imports in Deno
deno_python 0.3.1 adds support for importing python pip packages directly in JavaScript! Fun and useful, slightly cursed.