danielmiessler / fabric

fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.
https://danielmiessler.com/p/fabric-origin-story
MIT License
25.23k stars 2.67k forks source link

[Feature request]: integrate new audit to text functionality, preferably without a toll on the install process #133

Closed agu3rra closed 8 months ago

agu3rra commented 8 months ago

What do you need?

@xssdoctor is working on a new text to audio functionality via the transcribe branch. The newly introduced Python library (pydub) seems to now cause fabric to require a new OS-level dependency, which can become cumbersome if we want our installer to work on any OS flavor (macOS requires it via brew, Linux via apt).

Let's figure this one out. If anyone in the community knows of a solution already, please feel free to send us a PR. 😊

Cheers!

agu3rra commented 8 months ago

@danielmiessler @xssdoctor

A couple of ideas

I am thinking this could have the following solutions:

  1. We think of a way of enhansing the setup.sh file to emcompass the intricassies os diferent OS' as it gets called. This has a toll on us and I'd back it up with PR validation tests before we ship/release.
  2. We change the install instructions to tell people they should use Docker instead and we only have to worry about a single OS version in which we ship our dependencies. The Docker install process is rather simple in mutiple platforms with Docker Desktop, including Windows. The caveat is: this is yet another "disruptive" change as we'd basically replace all the instructions with something like:
    • install docker desktop
    • docker run -it -v ~/.fabric:~/.fabric fabric:latest. (the volume mount could handle the persistency of the --setup as the running container is ephemeral in nature). PS: yes, it means, nobody would have to install poetry on their own anymore as we'd basically ship a ready to use container. The same goes for any OS-level dependency.
    • They'd get a terminal with fabric at the time they finish the above command.

The docker route

If we go with option 2 then we'd have to decide: do we want to ship a single image of fabric or specialized ones for the cli/gui/servers?

I think we can make it work either way, but the benefit of specialized images is that perhaps we can make them smaller and from a development process we keep the techs we use in their own "buckets" (e.g.: python, node).

Let me know what you think. I can start a Dockerfile PR, but I think BEFORE we ship this one I'd be more comfortable making it somewhat bigger to include automatic docker push to Docker Hub and at least some basic testing. Stuff like evals on stdout/stderr on the CLI for example.

Are you opinionated on which base image we use if we go Docker? Alpine based images have a good track record of keeping security vulnerabilities patched, so they'd be my first choice as I don't like the idea of reading too many CVE's to determine whether they affect us or not.

Did I ask the AI?

Yes 😊 https://www.perplexity.ai/search/Can-an-OSlevel-XoZa5TxiS0.dcGwvrJxnyw

agu3rra commented 8 months ago

One thing that has occurred to me on shipping fabric via docker: the container runtime will not have stuff that the host has in its OS. So that sort of breaks one of the features I think @danielmiessler appreciates in unix: piping.

A couple of solutions would be:

  1. We make the docker image ship with a set of binaries commonly used with fabric.
  2. We turn to a system specific compiled language for the cli. Perhaps Golang or Rust (if we're feeling extra funky). We ditch container and ship a Linux, macOS, and Windows binaries. Needless to say, it would be a MAJOR change.
xssdoctor commented 8 months ago

I just added transcription and access to the whisper api. I also added yt and ts (the new transcription app to poetry and to the path via setup.sh. The only problem is that you still need to install ffmrpg with brew or apt

danielmiessler commented 8 months ago

Hey all, please talk with @danigoland. He's thinking about how to produce full binaries for us in the next major release.

So, binaries, addition to pip, homebrew, a standalone electron app we install as a DMG, and all sorts of next-level stuff.

You all should collaborate on this!

danigoland commented 8 months ago

I have a fork with a branch that I added electron packaging to it.

Tested it on MacOS and it works flawlessly, it should work on other operating systems as well and it can all be automated with CircleCI or Github Actions.

Let me know if you want to chat about it 😎

xssdoctor commented 8 months ago

There’s already an electron gui on the main branch. It’s in installer/client/gui

xssdoctor commented 8 months ago

Although if yours is better, I’m totally down with replacing mine with yours

danigoland commented 8 months ago

I was referring to the packaging, instead of having people install NPM and everything, just have a DMG/EXE file to download and run.

My only concern, maybe security paranoia haha is saving the OpenAI key in a file instead of using the macOS Keychain/Windows Credential Manager/etc.

It's been a while since I did any UI stuff but we can use React with Material UI to make it look nicer without much work 😎

image image image

xssdoctor commented 8 months ago

Let’s do it!

danigoland commented 8 months ago

Also regarding the CLI itself, in my opinion I would just rewrite it in Go so it can be a single binary packaging the Python Runtime into a binary but I'm open to any ideas haha

xssdoctor commented 8 months ago

We talked about it but I don’t know go. I agree that would be a better option

xssdoctor commented 8 months ago

If you do it you’re a rock star

danigoland commented 8 months ago

Haha I mean it all depends on the features, I'm not a Go expert but I can write Go, there are a few things that I would change regarding how the patterns are stored in the repo, I have a PoC that I showed @danielmiessle, but in general I like modularity so basically having a separate repo for the patterns. I messed with it a little bit and made scripts to autogenerate a README file every time a pattern is added and a txt file with checksums on patterns

Mayorc1978 commented 8 months ago

Any Windows binaries planned?

danigoland commented 8 months ago

@Mayorc1978 Yeah, I'll add it to the PR I opened 👍

ejembamut commented 4 months ago

@danigoland Hello, do you know where can we test the new golang version ? in which repository can we find it ?