Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 3.74 KB

File metadata and controls

56 lines (39 loc) · 3.74 KB

guidance

The AI Engineer presents guidance

Overview

Guidance is a #Python library for superior control over #AI text generation. Easily interleave prompting, constraints like regexes/CFGs, and generation in clean Python code - no more parsing!

Description

As AI capabilities advance, more developers are leveraging large language models (LLMs) to generate text. However, properly constraining and controlling LLM output can be challenging. Most approaches involve prompting, parsing, and chained iterations – very inefficient!

👩‍💻 That's what Guidance is about, a Python library that enables superior control over text generation with cleaner code.

💡 guidance Key Highlights

✅ Easily interleave prompting, generation calls, constraints like regexes and context-free grammars (CFGs), and more – no painful intermediate parsing!

⚙️ Stateful control flow lets you make decisions based on prior model generation. Changing course is trivial.

🤖 Automatic tool integration pauses generation to invoke functions, then resumes – perfect for things like calculators.

🌈 Supports Transformers, LlamaCPP, VertexAI, OpenAI, and more for wide compatibility.

📈 Faster execution than chained approaches in many cases, since you can batch plain text appends.

The result? You write beautiful Python code that reads like scripts, not messy chained prompts. There is no need to design prompts that anticipate and handle all branches. Guidance handles constraint violations automatically.

Guidance stands out with cleaner logic and superior model control regardless if you are building assistants, classifiers, control flows, or more.

🤔 Why should The AI Engineer care about guidance?

  1. 👩‍💻 It enables writing cleaner code that interleaves prompting, constraints, and generation without intermediate parsing. Better readability and maintainability.
  2. ⚡️ It offers faster execution than chaining in many cases by batching text appends. Speed is critical for production systems.
  3. 🎯 It provides superior control over text generation through regexes, CFGs, automatic tool integration, and more. Critical for quality output.
  4. 🔀 It supports stateful flows that adapt based on prior model generations. More dynamic conversations and workflows.
  5. 🤝 It is compatible with Transformers, LlamaCPP, VertexAI, OpenAI, and more. Write once, run anywhere.

📊 How is guidance performing?

🖇️ Where can I find more about guidance?


🧙🏽 Follow The AI Engineer for more about guidance and daily insights tailored to AI engineers. Subscribe to our newsletter. We are the AI community for hackers!

♻️ Repost this to help guidance become more popular. Support AI Open-Source Libraries!

⚠️ If you want me to highlight your favorite AI library, open-source or not, please share it in the comments section!