News for hackers. Stuff that matters.
Re:Show HN: Sketch – AI code-writing assistant that understa... by bluecoconut on Monday January 16, 2023 @08:39AM (#34400493)
Hey HN!

I’m excited to share sketch: a tool to help anyone who uses python and pandas quickly iterate and get to answers for their data questions.

Sketch installs as a pandas extension that offers utility functions that operate on natural language prompts. Using the `ask` interface you can get answers in natural language. Using the `howto` interface you can get get python and pandas code directly. The primary benefit of this over copilot and chatGPT is that this adds data-content based context so that the generated answers are much more accurate and relevant to the data problem at hand.

Check out the demo video[1] and try it out using the colab notebook (on github)!

[1] https://user-images.githubusercontent.com/916073/212602281-4...

Re:Show HN: Sketch – AI code-writing assistant that understa... by hgarg on Monday January 16, 2023 @09:53AM (#34401213)
I spent few weeks last year building a text to sql tool using codex model to do something like this but for all kinds of data sources. We pivoted away to something else for various reasons.

But your approach is much better. Pandas is used a lot. Build a tool on top of pandas. This is awesome.

Re:Show HN: Sketch – AI code-writing assistant that understa... by pfd1986 on Monday January 16, 2023 @10:14AM (#34401439)
Hi, cool stuff! Which LLM is being used in the background? I may have missed that info in the readme. Thanks!
Re:Show HN: Sketch – AI code-writing assistant that understa... by bluecoconut on Monday January 16, 2023 @10:22AM (#34401502)
Thanks!

Right now this is running off of GPT-3 (`text-davinci-003`) and via a small code change can run on codex (`code-davinci-002`) but the quality only improves a little bit with that change.

That said, this is the first version to show that the interface is viable; we are currently working on training our own foundation model on a hybrid tokenization of data and word tokens. I hope to improve this same toolkit in the future with these new models of our own that we are training.

Re:Show HN: Sketch – AI code-writing assistant that understa... by swyx on Monday January 16, 2023 @10:55AM (#34401877)
Re:Show HN: Sketch – AI code-writing assistant that understa... by javierluraschi on Monday January 16, 2023 @10:18AM (#34401470)
https://hal9.com is focused on building data apps with LLMs, would love to explore integrating and contributing to Sketch. If this sounds interesting I’m at javier at hal9.ai
Re:Show HN: Sketch – AI code-writing assistant that understa... by allisdust on Monday January 16, 2023 @10:48AM (#34401771)
I don't have any experience with pandas. Can this directly connect to a db and run queries there (video seems to load a csv file).
Re:Show HN: Sketch – AI code-writing assistant that understa... by harvey9 on Monday January 16, 2023 @12:45PM (#34403317)
If you can already write SQL to return a data set then you can get that set to pandas with pyodbc.
Re:Show HN: Sketch – AI code-writing assistant that understa... by daveguy on Monday January 16, 2023 @11:39AM (#34402392)
This is very cool. A useful case for gpt. One question / concern: isn't a person's address considered PII? Is the system flexible enough to add pre-statements such as "treat an address as PII"?
Re:Show HN: Sketch – AI code-writing assistant that understa... by harvey9 on Monday January 16, 2023 @12:51PM (#34403388)
Related question: is this done on my machine or do I end up sending possible pii to a cloud service for evaluation?
Re:Show HN: Sketch – AI code-writing assistant that understa... by bluecoconut on Monday January 16, 2023 @01:24PM (#34403787)
This is sending summary statistics to a cloud machine by default (for ease of immediate use. https://github.com/approximatelabs/sketch#sketch-currently-u...

You can run using your own OpenAI key by setting 2 environment variables: (1) SKETCH_USE_REMOTE_LAMBDAPROMPT=False (2) OPENAI_API_KEY=YOUR_API_KEY

To run entirely locally (using your own GPU and a model like Bloom) one would have to add a new prompt type to `lambdaprompt` (the package that this depends on), have a machine with enough GPU resources, and then add a slight modification to sketch.

Re:Show HN: Sketch – AI code-writing assistant that understa... by adabyron on Monday January 16, 2023 @05:22PM (#34406245)
Not sure if this is a business you're building out of this or an experiment. For real use for any of my customers, I would need to run this entirely locally.

I think it's really awesome though!

Curious what "enough GPU resources" looks like? Would a GeForce RTX 40 or 30 series card with 12-24GB of RAM be sufficient per user running locally on their machine?

Re:Show HN: Sketch – AI code-writing assistant that understa... by pklee on Monday January 16, 2023 @06:28PM (#34406994)
If this is using OpenAI which it seems is what it is using, It is only sending column headers / column names. Not the data. If you are concerned about column names, you could also mask it on the way out and back in. If you are looking for an end to end database connect and query, please reach out to me.
Re:Show HN: Sketch – AI code-writing assistant that understa... by jamal-kumar on Monday January 16, 2023 @12:29PM (#34403065)
Damn, this looks pretty useful. I was finding that github copilot was really good at reading a CSV file and writing all the imports from that into migrations for DB import, but this looks like it does these data transformations even more robustly.

Is there any plans on getting this to work outside of the python/pandas ecosystem or is it intrinsically tied to that environment?

Re:Show HN: Sketch – AI code-writing assistant that understa... by irthomasthomas on Monday January 16, 2023 @12:55PM (#34403430)
This is very cool! I've literally today been noodling with ideas to use probabilistic data structures in LLMs.

And TIL you can embed mp4s in a GitHub readme. Is that new?