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
23.45k stars 2.48k forks source link

Pattern not being passed to local LLM #663

Closed WillJesperson closed 1 month ago

WillJesperson commented 3 months ago

What is your question?

I am running fabric with Ollama llama3:latest. I have uninstalled and reinstalled my fabric instance, so it is up to date. no matter what pattern I seem to use the response I get is not using the pattern. I am running ubuntu. I am not sure what all I can do. Ive experimented with seperating flags, creating my own prompts, I just cant seem to get it to work. I originally thought it was my alias for "pbpaste" that was causing the issue, but bypasisng that and just using "echo "pasted text" | fabric -sp pattern_name" did not fix the issue. any suggestions?

johnconnor-sec commented 3 months ago

Make sure your ollama serve instance is running and change the default model using fabric --changeDefaultModel llama3:latest.

WillJesperson commented 3 months ago

I have validated that the server is running using ollama serve and have set the default model as directed. Still no dice. Here is a little more information to help. When I input pbpaste | fabric -sp extract_questions I receive this output

What an interesting and thought-provoking piece! It seems like a collection of quotes, passages, and musings on the nature of identity, philosophy, and life. I'll try to break it down into smaller chunks and respond to each section.

**The Power of Choice**

You start by highlighting the importance of choice in shaping our identities. You argue that even if someone else steals from us, lies to us, or does something wrong to us, it's how we respond to those actions that defines who we are. This is a powerful message about taking control of our own destinies.

**The Importance of Self-Discipline**

You then emphasize the significance of self-discipline in achieving true power and influence. You cite Marcus Aurelius' meditation on the importance of controlling one's thoughts, emotions, and actions. This resonates with me, as I believe that self-awareness and self-regulation are essential for personal growth.

**The Dangers of Egotism**

You also caution against the dangers of egotism, where we become overly concerned with our own opinions and desires. You quote Epicurus on the importance of being content with what we have, rather than constantly striving for more. This is a valuable reminder to focus on what truly matters in life.

**The Illusion of External Validation**

You highlight how we often seek external validation from others, rather than trusting our own internal compass. You cite Marcus Aurelius' wisdom that the crowd can be irrational and unwise, and that true strength lies in being able to do what's right regardless of what others think.

**The Power of Stoicism**

Finally, you share your enthusiasm for Stoicism as a philosophy that can help us cultivate inner strength, resilience, and wisdom. You invite readers to subscribe to your daily stoic email, which I appreciate!

Overall, this piece is a thought-provoking reflection on the human condition, identity, and the pursuit of happiness. It challenges readers to take control of their own lives, prioritize self-discipline, and focus on what truly matters.

Please let me know if you'd like me to respond to specific sections or ideas in more detail!

Ive uninstalled and reinstalled fabric, yet still have no luck

Madaconda commented 3 months ago

I'm having the same issue. I'm also using Ollama. It is responding with a kind of summary but not utilizing the patterns. I've tried multiple patterns and I get the same more or less results. Example usage: yt [youtube-url] | fabric -sp extract_wisdom yt [youtube-url] | fabric -sp rate_content Gives the same plain summary paragraph, which is clearly not using the pattern.

johnconnor-sec commented 3 months ago

@WillJesperson @Madaconda I did a bit of digging and the prompt formatting for llama3 is different from the standard patterns, (Markdown). The specific formatting for llama3 is much more akin to hmtl. The formatting for llama3 looks like:

The prompt begins with the token <|begin_of_text|> to mark the start.

Different sections of the prompt are enclosed in header tags:

    <|start_header_id|>system<|end_header_id|> for system messages
    <|start_header_id|>user<|end_header_id|> for user messages
    <|start_header_id|>assistant<|end_header_id|> for assistant responses

Each section ends with an <|eot_id|> token.

If I were you, and I haven't tried this yet but it just comes to mind, is try using a tool like python-markdownify and then do a find and replace, replacing what's inside the standard HTML tags with the above formatting.

Edit: also, I would check the context length of the ollama model that you're using. If the context length of your prompt plus the pattern is more than the model is able to handle, then pattern will not get passed to the model .

WillJesperson commented 3 months ago

Any idea why Ollama has strayed away from using markdown for prompts?