General Introduction
Fabric is an open source AI framework developed by Daniel Miessler to simplify and automate everyday computer tasks and make artificial intelligence easier to use. It helps users efficiently handle various matters such as content summarization, data extraction and automated writing through modular design and preset prompt words (Patterns).Fabric supports the integration of multiple large language models, and users can customize the settings according to their needs, which greatly enhances their work efficiency and learning ability.
Fabric
One of its main functions is to help people gather tips and integrate them into all aspects of their lives, which we call Patterns.
Function List
- modular design: Break down complex tasks into simple steps with Patterns.
- Multi-platform support: Can be easily installed and used on different operating systems.
- command-line interface: Users can operate via the CLI for those who prefer the command line.
- API Integration: Support for integration with multiple AI model providers such as OpenAI, Anthropic, and more.
- Customized tips: Users can create and edit their own prompts to meet specific needs.
- Local Model Support: Allows users to set up local AI models for processing.
- Interactive settings: The installation process is simple and provides interactive configuration options.
Using Help
Installation process
# Windows. curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-windows-amd64.exe > fabric.exe && fabric.exe --version# MacOS (arm64). curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-darwin-arm64 > fabric && chmod +x fabric && . /fabric --version # MacOS (amd64). curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-darwin-amd64 > fabric && chmod +x fabric && . /fabric --version # Linux (amd64): curl -L > fabric && chmod +x fabric && ./fabric --version curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-amd64 > fabric && chmod +x fabric && . /fabric --version # Linux (arm64): curl -L > fabric && chmod +x fabric && . curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-arm64 > fabric && chmod +x fabric && . /fabric --version
To install Fabric.Make sure you have Go installed!, and then run the following command.
# Install Fabric directly from the repo go install github.com/danielmiessler/fabric@latest
set up
# Run the setup to set up your directories and keys fabric ---setup
Usage Process
- Basic Command Usage::
Fabric provides a series of commands to perform different tasks. For example, to extract key points from a YouTube video and generate a blog post, you can use the following commands:yt https://www.youtube.com/watch?v=视频ID | fabric -p extract_wisdom | fabric -p write_essay | fabric -sp translate_cn
- Custom Model Selection::
You can pass the-m
parameter to select a different model. For example, change the default model to an open source model:fabric -m nousresearch/hermes-3-llama-3.1-405b: free
- Frequently Asked Questions::
If you're having trouble installing or using it, you can visit GitHub's Issues page to see feedback from other users or ask your own questions. - Community Support and Outreach::
Fabric encourages users to participate in the development of new Patterns and features, and users can submit their contributions on GitHub.
All commands
Usage. fabric [OPTIONS] Application Options. -p, --pattern= select a pattern from the available patterns -v, --variable= Set the value of the pattern variable, e.g. -v=#role:expert -v=#points:30 -C, --context= Select a context from the available contexts --session= Select a session from the available sessions -S, --setup= Run setup for all reconfigurable parts of the fabric -t, --temperature= Set temperature value (default: 0.7) -T, --topp= set top P value (default: 0.9) -s, --stream stream -P, --presencepenalty= set presence penalty value (default: 0.0) -r, --raw Use the model's default settings, don't send chat options (e.g., temperature, etc.), and use user roles instead of system roles to match patterns -F, --frequencypenalty= set frequency penalty value (default: 0.0) -l, --listpatterns list all patterns -L, --listmodels lists all available models -x, --listcontexts List all contexts -X, --listsessions lists all sessions -U, --updatepatterns Update patterns -c, --copy Copy to clipboard -m, --model= Select model -o, --output= output to file --output-session Output entire session (including temporary sessions) to file -n, --latest= List the number of recent models (default: 0) -d, --changeDefaultModel change default model -y, --youtube= Specify a YouTube video "URL" to grab transcripts and comments from and send to chat ---transcript Grab transcripts from YouTube videos and send them to chat (this option is used by default) --comments to grab comments from YouTube videos and send them to chat -g, --language= Specify the language code for the chat, e.g. -g=en -g=zh -u, --scrape_url= Use Jina AI to convert website URLs to Markdown format. -q, --scrape_question= Use Jina AI to search for questions. -e, --seed= Generate the specified seed for LMM. -w, --wipecontext= clear context -W, --wipesession= clear session -W, --wipecontext= clear context -W, --wipesession= clear session -W, --printcontext= print context --printsession= Print session --readability Converts HTML input to a clean readable view. --dry-run show what will be sent to the model without actually sending it --version prints the current version Help options. -h, --help Show this help message.
Practice Recommendations
Users are advised to try different features in practice to better understand the power of Fabric. With practice, you will be able to fully utilize this tool to improve productivity and learning.
Next, our instructions are very clearWe use Markdown structures to emphasize what we want the AI to do and in what order. Example: https://github.com/danielmiessler/fabric/blob/main/patterns/extract_wisdom/system.md
fabric also provides a prompt template, you can refer to this structure to easily write high-quality and stable prompt:.
https://github.com/danielmiessler/fabric/tree/main/patterns/create_pattern
Finally, we tend to use the System part of Prompt almost exclusively. For over a year now, we've been burying our heads in the sand on these things, and we're just now seeing more of the effects of doing so. If things change, or if we see data that suggests otherwise, we will make adjustments.
(for) instance
Now let's look at some of the things you can do with Fabric.
- Run the summarize mode based on the input of stdin. In this case, the body of the article.
pbpaste | fabric --pattern summarize
- Run analyze_claims mode with the --stream option for immediate and streaming results.
pbpaste | fabric --stream --pattern analyze_claims
- Run extract_wisdom mode with the --stream option to get instant and streaming results from any Youtube video (very similar to the original intro video).
fabric -y "https://youtube.com/watch?v=uXs-zPc63kM" --stream --pattern extract_wisdom
- Create Pattern - You must create an .md file with the pattern and save it to ~/.config/fabric/patterns/[yourpatternname].
Just copy it out and use it. If you don't want to do anything fancy and just want lots of great tips, you can navigate to the /patterns directoryAnd start exploring! All modular cue words are under this path, easy to use, no need to write code: there is a system.md in each word directory, the