freshcrate
Skin:/
Home > Uncategorized > guidance

guidance

A guidance language for controlling large language models.

Why this rank:Strong adoptionRelease freshnessHealthy release cadence

Description

A guidance language for controlling large language models.

README

Discord Email Hours
guidance

Guidance is an efficient programming paradigm for steering language models. With Guidance, you can control how output is structured and get high-quality output for your use case—while reducing latency and cost vs. conventional prompting or fine-tuning. It allows users to constrain generation (e.g. with regex and CFGs) as well as to interleave control (conditionals, loops, tool use) and generation seamlessly.

Install

Guidance is available through PyPI and supports a variety of backends (Transformers, llama.cpp, OpenAI, etc.). If you already have the backend required for your model, you can simply run

pip install guidance

Features

A Pythonic interface for language models

When using Guidance, you can work with large language models using common Python idioms:

from guidance import system, user, assistant, gen
from guidance.models import Transformers

# Could also do LlamaCpp or many other models
phi_lm = Transformers("microsoft/Phi-4-mini-instruct")

# Model objects are immutable, so this is a copy
lm = phi_lm

with system():
    lm += "You are a helpful assistant"

with user():
    lm += "Hello. What is your name?"

with assistant():
    lm += gen(max_tokens=20)

print(lm)

If run at the command line, this will produce output like:

<|system|>You are a helpful assistant<|end|><|user|>Hello. What is your name?<|end|><|assistant|>I am Phi, an AI developed by Microsoft. How can I help you today?

However, if running in a Jupyter notebook, then Guidance provides a widget for a richer user experience:

Guidance widget showing HTML generation

With Guidance, it's really easy to capture generated text:

# Get a new copy of the Model
lm = phi_lm

with system():
    lm += "You are a helpful assistant"

with user():
    lm += "Hello. What is your name?"

with assistant():
    lm += gen(name="lm_response", max_tokens=20)

print(f"{lm['lm_response']=}")
lm['lm_response']='I am Phi, an AI developed by Microsoft. How can I help you today?'

Guarantee output syntax with constrained generation

Guidance provides an easy to use, yet immensely powerful syntax for constraining the output of a language model. For example, a gen() call can be constrained to match a regular expression:

lm = phi_lm

with system():
    lm += "You are a teenager"

with user():
    lm += "How old are you?"

with assistant():
    lm += gen("lm_age", regex=r"\d+", temperature=0.8)

print(f"The language model is {lm['lm_age']} years old")
The language model is 13 years old

Often, we know that the output has to be an item from a list we know in advance. Guidance provides a select() function for this scenario:

from guidance import select

lm = phi_lm

with system():
    lm += "You are a geography expert"

with user():
    lm += """What is the capital of Sweden? Answer with the correct letter.

    A) Helsinki
    B) Reykjavík 
    C) Stockholm
    D) Oslo
    """

with assistant():
    lm += select(["A", "B", "C", "D"], name="model_selection")

print(f"The model selected {lm['model_selection']}")
The model selected C

The constraint system offered by Guidance is extremely powerful. It can ensure that the output conforms to any context free grammar (so long as the backend LLM has full support for Guidance). More on this below.

Debug grammars offline (no model API calls)

When iterating on constraints, you can validate candidate strings locally and test a full run with the Mock model.

from guidance import gen
from guidance.models import Mock

grammar = "expr=" + gen(regex=r"\d+([+*]\d+)*", name="expr")

# 1) Validate strings directly against the grammar
assert grammar.match("expr=12+7*3") is not None
assert grammar.match("expr=12+*3") is None

# 2) Run the same grammar with a local mock model
lm = Mock(b"<s>expr=12+7*3")
lm += grammar
print(lm["expr"])  # 12+7*3

Create your own Guidance functions

With Guidance, you can create your own Guidance functions which can interact with language models. These are marked using the @guidance decorator. Suppose we wanted to answer lots of multiple choice questions. We could do something like the following:

import guidance

from guidance.models import Model

ASCII_OFFSET = ord("a")

@guidance
def zero_shot_multiple_choice(
    language_model: Model,
    question: str,
    choices: list[str],
):
    with user():
        language_model += question + "\n"
        for i, choice in enumerate(choices):
            language_model += f"{chr(i+ASCII_OFFSET)} : {choice}\n"

    with assistant():
        language_model += select(
            [chr(i + ASCII_OFFSET) for i in range(len(choices))], name="string_choice"
        )

    return language_model

Now, define some questions:

questions = [
    {
        "question" : "Which state has the northernmost capital?",
        "choices" : [
            "New South Wales",
            "Northern Territory",
            "Queensland",
            "South Australia",
            "Tasmania",
            "Victoria",
            "Western Australia",
        ],
        "answer" : 1,
    },
    {
        "question" : "Which of the following is venomous?",
        "choices" : [
            "Kangaroo",
            "Koala Bear",
            "Platypus",
        ],
        "answer" : 2,
    }
]

We can use our decorated function like gen() or select(). The language_model argument will be filled in for us automatically:

lm = phi_lm

with system():
    lm += "You are a student taking a multiple choice test."

for mcq in questions:
    lm_temp = lm + zero_shot_multiple_choice(question=mcq["question"], choices=mcq["choices"])
    converted_answer = ord(lm_temp["string_choice"]) - ASCII_OFFSET
    print(lm_temp)
    print(f"LM Answer: {converted_answer},  Correct Answer: {mcq['answer']}")
<|system|>You are a student taking a multiple choice test.<|end|><|user|>Which state has the northernmost capital?
a : New South Wales
b : Northern Territory
c : Queensland
d : South Australia
e : Tasmania
f : Victoria
g : Western Australia
<|end|><|assistant|>b
LM Answer: 1,  Correct Answer: 1
<|system|>You are a student taking a multiple choice test.<|end|><|user|>Which of the following is venomous?
a : Kangaroo
b : Koala Bear
c : Platypus
<|end|><|assistant|>c
LM Answer: 2,  Correct Answer: 2

Guidance functions can be composed, in order to construct a full context free grammar. For example, we can create Guidance functions to build a simple HTML webpage (note that this is not a full implementation of HTML). We start with a simple function which will generate text which does not contain any HTML tags. The function is marked as stateless to indicate that we intend to use it for composing a grammar:

@guidance(stateless=True)
def _gen_text(lm: Model):
    return lm + gen(regex="[^<>]+") 

We can then use this function to generate text within an arbitrary HTML tag:

@guidance(stateless=True)
def _gen_text_in_tag(lm: Model, tag: str):
    lm += f"<{tag}>"
    lm += _gen_text()
    lm += f"</{tag}>"
    return lm

Now, let us create the page header. As part of this, we need to generate a page title:

@guidance(stateless=True)
def _gen_header(lm: Model):
    lm += "<head>\n"
    lm += _gen_text_in_tag("title") + "\n"
    lm += "</head>\n"
    return lm

The body of the HTML page is going to be filled with headings and paragraphs. We can define a function to do each:

from guidance.library import one_or_more

@guidance(stateless=True)
def _gen_heading(lm: Model):
    lm += select(
        options=[_gen_text_in_tag("h1"), _gen_text_in_tag("h2"), _gen_text_in_tag("h3")]
    )
    lm += "\n"
    return lm

@guidance(stateless=True)
def _gen_para(lm: Model):
    lm += "<p>"
    lm += one_or_more(
        select(
            options=[
                _gen_text(),
                _gen_text_in_tag("em"),
                _gen_text_in_tag("strong"),
                "<br />",
            ],
        )
    )
    lm += "</p>\n"
    return lm

Now, the function to define the body of the HTML itself:

@guidance(stateless=True)
def _gen_body(lm: Model):
    lm += "<body>\n"
    lm += one_or_more(select(options=[_gen_heading(), one_or_more(_gen_para())]))
    lm += "</body>\n"
    return lm

Next, we come to the function which generates the complete HTML page. We add the HTML start tag, then generate the header, then body, and then append the ending HTML tag:

@guidance(stateless=True)
def _gen_html(lm: Model):
    lm += "<html>\n"
    lm += _gen_header()
    lm += _gen_body()
    lm += "</html>\n"
    return lm

Finally, we provide a user-friendly wrapper, which will allow us to:

  • Set the temperature of the generation
  • Capture the generated page from the Model object
from guidance.library import capture, with_temperature

@guidance(stateless=True)
def make_html(
    lm,
    name: str | None = None,
    *,
    temperature: float = 0.0,
):
    return lm + capture(
        with_temperature(_gen_html(), temperature=temperature),
        name=name,
    )

Now, use this to generate a simple webpage:

lm = phi_lm

with system():
    lm += "You are an expert in HTML"

with user():
    lm += "Create a simple and short web page about your life story."

with assistant():
    lm += make_html(name="html_text", temperature=0.7)

When running in a Jupyter Notebook so that the widget is active, we get the following output:

Guidance widget showing HTML generation with token fast-forwarding

Note the varying highlighting of the generation. This is showing another of Guidance's capabilities: fast-forwarding of tokens. The constraints imposed by a grammar often mean that some tokens are known in advance. Guidance doesn't need the model to generate these; instead it can insert them into the generation. This saves forward passes through the model, and hence reduces GPU usage. For example, in the above HTML generation, Guidance always knows the last opening tag. If the last opened tag was <h1> (for example), then as soon as the model generates </, Guidance can fill in h1> without needing the model to perform a forward pass.

Generating JSON

A JSON schema is actually a context free grammar, and hence it can be used to constrain an LLM using Guidance. This is a common enough case that Guidance provides special support for it. A quick sample, based on a Pydantic model:

import json
from pydantic import BaseModel, Field

from guidance import json as gen_json

class BloodPressure(BaseModel):
    systolic: int = Field(gt=300, le=400)
    diastolic: int = Field(gt=0, le=20)
    location: str = Field(max_length=50)
    model_config = dict(extra="forbid")

lm = phi_lm

with system():
    lm += "You are a doctor taking a patient's blood pressure taken from their arm"

with user():
    lm += "Report the blood pressure"

with assistant():
    lm += gen_json(name="bp", schema=BloodPressure)

print(f"{lm['bp']=}")

# Use Python's JSON library
loaded_json = json.loads(lm["bp"])
print(json.dumps(loaded_json, indent=4))

# Use Pydantic
result = BloodPressure.model_validate_json(lm["bp"])
print(result.model_dump_json(indent=8))
lm['bp']='{"systolic": 301, "diastolic": 15, "location": "arm"}'
{
    "systolic": 301,
    "diastolic": 15,
    "location": "arm"
}
{
        "systolic": 301,
        "diastolic": 15,
        "location": "arm"
}

Note that the generated blood pressure is not one the model will have seen for a human. When generating JSON, a substantial number of tokens can often be fast-forwarded, due to the structural constraints imposed by the schema.

Release History

VersionChangesUrgencyDate
0.3.2More docs, fixes, performance improvements. ## Added - Offline grammar debugging guide in README (thanks @biefan!) (#1462) ## Fixed - Workaround for OnnxRT-GenAI runtime failing to load a model (#1419) - Correct handling of notebook normalization for stderr and stdout (#1423) ## Changed - Updated llguidance to 1.6.1 -- support for URI format for JSON strings; perf improvements (#1429) Medium3/18/2026
0.3.1Introduces monitor guided inference and onnxruntime-genai support. Numerous fixes. ## Added Support for Python 3.14 (#1385) - Ability to add inference-time semantic verification via monitor guided inference (#1391) by @naga86 - Added onnxruntime-genai backend (#1366) ## Removed - Dropped 3.9 support ## Fixed - Remove code dealing with deprecated transformers.HybridCache (#1408) - Ensure setup.py has consistent transformers and llama-cpp-python versions (#1405) - Use chatLow2/3/2026
0.3.0# Guidance 0.3.0 More model providers, better LARK exposure, re-done custom tools. ## Breaking Changes - Removed old-style @guidance-based tool calls (in favor of more generic OpenAI-style tools) - Temp removal of calling support for local models (PR planned to restore support in-line with new tools) ## Added - Added support for groq and mistralai APIs via litellm - Added experimental sglang model - Added experimental chat_completion() and chat_completion_streaming() APIs to the eLow9/9/2025
0.2.5# Guidance 0.2.5 Special tokens can be user-defined. Numerous grammar fixes. Candidate tokens rendered for all token types. ## Added - Widget has dark mode (mainly for exporting). - `special_token` function added for adding in `<think>` and similar. ## Changed - `top_k` exposed when `echo=True` for all token types (including fast-forward, inputs). - Use greedy samplng if temp is smaller than `1e-5`. ## Fixed - Normalized capture names not preserved, fixed. - Logit array fix intLow7/30/2025
0.2.4 # Guidance 0.2.4 Better sampling, better metrics, `llama-cpp-python` fixes (update to latest please!), uncountable visualization fixes. ## Added - Allow changing `sampling_params` (`top_p`/`top_k`, `min_p`, `repetition_penalty`) on the fly `Model.with_sampling_params(...)` - Add `top_k` tokens back into vis after temporary removal in previous refactor ## Removed - `Model.token_count` removed in favor of (currently private) `Model._get_usage().output_tokens` ## Changed - BookkeeLow7/8/2025
0.2.3# Guidance 0.2.3 We have a performance hotfix, and then we snuck in some extras. ## Added - Added Llama3.2 chat template ## Removed - Deleted some dead code, in particular sample_with_temperature from Engine classes ## Changed - Switched top-k (for widget) implementation to use a priority-queue instead of a full sort, saving a few milliseconds per token when widget/vis is turned on ## Fixed - Fix performance regression introduced in issue #1261: full logits history no longer cLow6/23/2025
0.2.2# Guidance 0.2.2 **Better support for OpenAI, we fixed some bugs too (we tried to at least)!** *Included are 0.2.1 changes as we didn't record it previously.* ## Added - Token probabilities and backtracking support in the Jupyter widget. - Support for offline notebook rendering. - Higher-level AST for representing various input/output types for models (including JSON outputs, image inputs, special tokens, selects, joins, strings, etc.) - `Interpreter` abstraction layer between `ModLow6/19/2025
0.2.0## What's Changed Happy new year! This release contains a significant overhaul of many elements of guidance, including: - **Visualization Overhaul**: Guidance's in-line visualizations have been rewritten from scratch. TL;DR: We added a lot of code to support better model metrics and visualization. Check it out: ![Screenshare of updated UI in Jupyter notebook](https://github.com/user-attachments/assets/d65bafd4-5c9e-41c2-b5a2-4043e7cbfaae) - **Significantly Faster, Rust-based Grammar Low1/7/2025
0.2.0rc1## What's Changed * Replace Python-based EarleyParser with lexeme-based rust implementation by @hudson-ai & @mmoskal in https://github.com/guidance-ai/guidance/pull/951 This pre-release version of guidance uses a new Rust-based Earley lexer + parser that offers significant speedups and bugfixes to guidance grammar parsing. See PR https://github.com/guidance-ai/guidance/pull/951 for full details of the optimizations. Expect some changes from current Guidance (v0.1.16) behavior during pre-releLow8/20/2024
0.1.16## What's Changed * Allow generating arbitrary (schemaless) JSON by @hudson-ai in https://github.com/guidance-ai/guidance/pull/892 * [Bug] Fix Llama3ChatTemplate by @jjkjkj in https://github.com/guidance-ai/guidance/pull/884 * Use python's `re` module instead of `pyformlang` to build regex ASTs by @hudson-ai in https://github.com/guidance-ai/guidance/pull/854 * [Feature] Add Support for Phi-3-small by @ambisinister in https://github.com/guidance-ai/guidance/pull/935 * [Feature] Constant elLow8/19/2024
0.1.15## What's Changed * Support for Anthropic Claude 3 and Phi-3 models by @Harsha-Nori * [Feature] Metrics for Grammarless models by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/817 * Remove Instruct/Chat versions of models & introduce a new ChatTemplate API by @Harsha-Nori in https://github.com/guidance-ai/guidance/pull/820 * Fix set_attribute by @slundberg in https://github.com/guidance-ai/guidance/pull/835 * Fix for unstable tokenization schemes by @Harsha-Nori in https://giLow5/21/2024
0.1.14This release brings a series of new features, bug fixes, and changes, including: - Improved compatibility for loading many `transformers` models, including newly tested support for `Phi-3` - New capabilities in the `guidance.json` function for generating json, including early support for pydantic schemas. - Support for AzureAI models in new `guidance.models.AzureAIStudio*` classes - Significant dependency reductions on the default guidance installation - Small grammar optimizations - ManLow5/10/2024
0.1.13## What's Changed * Fixed PyPi publishing * Workflow for GPU Runner by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/694 * Add Llama to model test matrix by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/703 **Full Changelog**: https://github.com/guidance-ai/guidance/compare/0.1.12...0.1.13Low3/21/2024
0.1.12Lots of new features and bug fixes :) ## What's Changed * Adding Caching to OpenAI chat by @adamgordonbell in https://github.com/guidance-ai/guidance/pull/603 * Minor Server Tweaks by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/612 * Dependency trimming by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/613 * Add Python 3.12 by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/623 * Grammar Builder for JSON Schema by @riedgar-ms in https://github.coLow3/19/2024
0.1.11## What's Changed * Fix GPU usage by removing `device` from `Transformers` class wrapper to use the device/device_map directly exposed by HF Transformers in kwargs by @cpcdoy in https://github.com/guidance-ai/guidance/pull/569 * Adding streaming support under guidance v0.1 by @hodlen in https://github.com/guidance-ai/guidance/pull/568 * Fix typos in intro_to_guidance.ipynb by @trungsudo in https://github.com/guidance-ai/guidance/pull/574 * Update "Basic Tutorial" link in README.md by @alexanLow1/31/2024
0.1.100.1.9 was missing the hugging face patch...so 0.1.10 is real 0.1.9 :) **Full Changelog**: https://github.com/guidance-ai/guidance/compare/0.1.9...0.1.10Low12/22/2023
0.1.9## What's Changed * Bug patch for HuggingFace transformers tokenization issue. * Fixed generation coloring for multiple sequence generator calls. * Bug fix for the base AzureOpenAI class by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/543 * Google AI Studio's Gemini by @Anilturaga in https://github.com/guidance-ai/guidance/pull/550 * add react notebook by @Sam1320 in https://github.com/guidance-ai/guidance/pull/547 **Full Changelog**: https://github.com/guidance-ai/guidaLow12/22/2023
0.1.8## What's Changed * Multi-model Gemini model support. * Local model temperature fixes. * Native Anthropic Claude support by @Anilturaga in https://github.com/guidance-ai/guidance/pull/537 ## New Contributors * @Anilturaga made their first contribution in https://github.com/guidance-ai/guidance/pull/537 **Full Changelog**: https://github.com/guidance-ai/guidance/compare/0.1.7...0.1.8Low12/14/2023
0.1.7## What's Changed * Temperature controls now work for remote models. * When optimistically running remote models grammar violations now have much better error messages/debugability. * Huggingface transformers models now fully respect the training tokenization patterns. * DOC Update notebooks by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/491 * Update tutorial for Azure OpenAI by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/468 * move llama.cpp batch object alLow12/12/2023
0.1.6## What's Changed * preliminary support for log_probs using the `compute_log_probs=True` model constructor arg. * A new `guidance.cpp` module that allows us to have high speed implementations of key objects. * reduce memory requirements (and probably improve speed) for llama.cpp tests by @paulbkoch in https://github.com/guidance-ai/guidance/pull/485 * Many bug fixes :) **Full Changelog**: https://github.com/guidance-ai/guidance/compare/0.1.5...0.1.6Low12/6/2023
0.1.5## What's Changed * Bug fixes for remote streaming models like OpenAI. * Support for LiteLLM which should enable support for many more models (Cohere already added as direct support). * Minor copyedit by @rpdelaney in https://github.com/guidance-ai/guidance/pull/473 * Remove scipy dependency by @kddubey in https://github.com/guidance-ai/guidance/pull/469 * Updated regex to account for fine-tuned models by @marawan1805 in https://github.com/guidance-ai/guidance/pull/424 ## New ContributorLow11/29/2023
0.1.4Fixes a numpy prob normalization error that can throw exceptions for non-zero temperatures. **Full Changelog**: https://github.com/guidance-ai/guidance/compare/0.1.3...0.1.4Low11/23/2023
0.1.3## What's Changed * Now we match non-greedy sentence piece tokenization in llama.cpp. * Move to numpy and spicy from PyTorch for basic scoring needs. * Update LLama.cpp to use their newest API by @paulbkoch in https://github.com/guidance-ai/guidance/pull/455 * Use len(tkz) instead of tkz.vocab_size to estimate vocabulary size by @EgorBu in https://github.com/guidance-ai/guidance/pull/460 * Fix test warnings by @riedgar-ms in https://github.com/guidance-ai/guidance/pull/461 ## New ContribLow11/23/2023
0.1.2Fixed #452, #451 and others.Low11/18/2023
0.1.1A small bug fix release to get guidance running on the remote unit test servers.Low11/14/2023
0.1This release represents a dramatically new and improved version of guidance :) We will release a more detailed summary of the changes later but briefly: - All guidance programs are now pure python programs. No more worrying about a distinction between "user code" in python and "template code" in handlebars. - In addition to now being simple python functions, guidance programs are also now a superset of regular expressions and context free grammars. Allowing extremely powerful specifications Low11/14/2023
0.0.65Last old handlersbars tagged versionLow11/14/2023
0.0.64## What's Changed * Fixes some streaming issues introduced in 0.0.63 * Remove the last empty assistant message for ChatGPT API call by @bhy in https://github.com/microsoft/guidance/pull/222 * Adding support for OpenAI functions by @nc and @slundberg in https://github.com/microsoft/guidance/pull/239 * Remove unused imports by @riya-amemiya in https://github.com/microsoft/guidance/pull/251 * Complete program execution on exceptions in async_mode=True by @jprafael in https://github.com/microsoLow6/20/2023
0.0.63## What's Changed * Fixed an iPython loading error introduced in 0.0.62 * Fixed a negative index setting error * Use regex to parse OpenAI models by @a2975667 in https://github.com/microsoft/guidance/pull/240 ## New Contributors * @a2975667 made their first contribution in https://github.com/microsoft/guidance/pull/240 **Full Changelog**: https://github.com/microsoft/guidance/compare/0.0.62...0.0.63Low6/15/2023
0.0.62## What's Changed * fix: Changed the example output to match the behaviour of the code. by @FunnyPhantom in https://github.com/microsoft/guidance/pull/176 * Allow variables to start with "or" or "else" by @Mihaiii in https://github.com/microsoft/guidance/pull/179 * Fix examples for issues #172 by @Keiku in https://github.com/microsoft/guidance/pull/182 * New variable_stack for the parser by @slundberg in https://github.com/microsoft/guidance/pull/193 * fixed openai streaming with REST by @mLow6/15/2023
0.0.61* Adds working support for Azure OpenAI **Full Changelog**: https://github.com/microsoft/guidance/compare/0.0.60...0.0.61Low6/2/2023
0.0.60* This is another quick patch for a cache issue when loading transformer models manually. **Full Changelog**: https://github.com/microsoft/guidance/compare/0.0.59...0.0.60Low6/2/2023
0.0.59* Just a patch to address a cache bug. **Full Changelog**: https://github.com/microsoft/guidance/compare/0.0.58...0.0.59Low6/2/2023
0.0.58## What's Changed * Support for multi-token token healing (healing that requires backing up more than one token). * Support falcon models. * Fix GPT proverb example with multiple gens by @bcstyle in https://github.com/microsoft/guidance/pull/137 * Fix geneach demo code by @Shaunwei in https://github.com/microsoft/guidance/pull/149 * Enhance the cache ability by @SimFG in https://github.com/microsoft/guidance/pull/123 * Fix partials and empty blocks by @justinbowes in https://github.com/micLow6/1/2023
0.0.57## What's Changed * Now silent=True is the default when streaming the program output. * Fixed some bugs with caching, and also `select` with special EOS tokens in LLaMA. * Fix typos by @amqdn in https://github.com/microsoft/guidance/pull/135 ## New Contributors * @amqdn made their first contribution in https://github.com/microsoft/guidance/pull/135 **Full Changelog**: https://github.com/microsoft/guidance/compare/0.0.56...0.0.57Low5/28/2023
0.0.56## What's Changed * New support for `stop_regex` with OpenAI models. * New support for streaming the results of program execution programmatically both sync and async. * Update test_unless.py by @Jvr2022 in https://github.com/microsoft/guidance/pull/96 * Add gpt-4-32k and gpt-4-32k-0314 to OpenAI Models by @flavius-popan in https://github.com/microsoft/guidance/pull/98 * Support models that doesn't output `past_key_values` by @younesbelkada in https://github.com/microsoft/guidance/pull/91 Low5/26/2023
0.0.54* Switch the `select` command over to a token-id-based process to account for possible non-greedy tokenizer exceptions. **Full Changelog**: https://github.com/microsoft/guidance/compare/0.0.53...0.0.54Low5/22/2023
0.0.53## What's Changed * Allow for select statements to have options that are prefixes of other options (and fix one select bug with long options). * fix repo typo by @marcosmagallanes in https://github.com/microsoft/guidance/pull/86 * fix typo by @kajarenc in https://github.com/microsoft/guidance/pull/85 ## New Contributors * @marcosmagallanes made their first contribution in https://github.com/microsoft/guidance/pull/86 * @kajarenc made their first contribution in https://github.com/microsoLow5/21/2023
0.0.52## What's Changed * Fixed #82 so that logprobs are correct in `select` (and #79 and other non-valid option issues with select) * Fix one typo by @rodrigosetti in https://github.com/microsoft/guidance/pull/81 ## New Contributors * @rodrigosetti made their first contribution in https://github.com/microsoft/guidance/pull/81 **Full Changelog**: https://github.com/microsoft/guidance/compare/0.0.51...0.0.52Low5/21/2023
0.0.51## What's Changed * Fixed an important bug with `select` that got introduced in the last couple days, and also optimized select to use greedy decoding as opposed to always exploring every branch. * Ensure get_ipython is available even in callbacks by @jmandel in https://github.com/microsoft/guidance/pull/74 ## New Contributors * @jmandel made their first contribution in https://github.com/microsoft/guidance/pull/74 **Full Changelog**: https://github.com/microsoft/guidance/compare/0.0.50Low5/21/2023
0.0.50## What's Changed * Fixed some issues with the `select` command. * Now OpenAI models support `stop_regex` and a new `save_stop_text` parameter is available for the `gen` command. * fix a typo in README.md by @jsl9208 in https://github.com/microsoft/guidance/pull/62 * Minor typo fix by @NickHeiner in https://github.com/microsoft/guidance/pull/75 ## New Contributors * @jsl9208 made their first contribution in https://github.com/microsoft/guidance/pull/62 * @NickHeiner made their first conLow5/20/2023
0.0.49## What's Changed * Some tokenization issues with `select` command are now sorted out so it should be working cleanly now :) * fix role tag's link in README.md by @lucemia in https://github.com/microsoft/guidance/pull/49 * fix small typos by @Sam1320 in https://github.com/microsoft/guidance/pull/56 * Add support for Koala by @Mihaiii in https://github.com/microsoft/guidance/pull/42 * Combine unnecessarily nested ``if`` in _program.py by @dviggiano in https://github.com/microsoft/guidance/pLow5/19/2023
0.0.48First auto GH to PyPi release. ## What's Changed * Lots of bug fixes thanks to you all reporting them! * Update README.md by @eltociear in https://github.com/microsoft/guidance/pull/20 * Add openai.organization by @riya-amemiya in https://github.com/microsoft/guidance/pull/28 * Clean up documentation by @dviggiano in https://github.com/microsoft/guidance/pull/37 ## New Contributors * @eltociear made their first contribution in https://github.com/microsoft/guidance/pull/20 * @riya-ameLow5/18/2023
0.0.32Release 0.0.32Low4/25/2023
0.0.31Release 0.0.31Low4/20/2023
0.0.29Transformers backend now works better and with sentence piece modelsLow4/19/2023
0.0.28Early workable version :)Low4/18/2023

Dependencies & License Audit

Loading dependencies...

Similar Packages

sample-agentic-frameworks-on-awsBuild Agentic AI solutions on AWS, using latest OSS Agentic Frameworks.main@2026-06-02
AutoRedact🛡️ Redact sensitive information from images securely in your browser with AutoRedact, featuring automatic detection and local processing for privacy.main@2026-06-06
slot-jsx-pragma🎰 Enable declarative slottable components with a custom JSX pragma for seamless React integration and enhanced performance.main@2026-06-06
alefGenerate fully-typed, lint-clean language bindings for Rust libraries across 11 languagesv0.23.18
local-ai-devenv🤖 Automate coding, testing, and deployment with a local AI environment powered by a team of intelligent agents.main@2026-06-06

More in Uncategorized

llama.cppLLM inference in C/C++
modal-clientSDK libraries for Modal
anolisaANOLISA - Agentic Nexus Operating Layer & Interface System Architecture