Built a tool for transforming unstructured data into structured outputs using language models (with 100% adherence).<p>If you're facing problems getting GPT to adhere to a schema (JSON, XML, etc.) or regex, need to bulk process some unstructured data, or generate synthetic data, check it out.<p>We run our own tuned model (you can self-host if you want), so, we're able to have incredibly fine grained control over text generation.<p>Repository: <a href="https://github.com/automorphic-ai/trex">https://github.com/automorphic-ai/trex</a><p>Playground: <a href="https://automorphic.ai/playground" rel="nofollow noreferrer">https://automorphic.ai/playground</a>
the more it goes, the more I realize that the true power of LLMs is not in unstructured text that they can generate, but in structured output. but there are two approaches to achieve this:<p>1. LMQL/guidance/JSONformer/OP's post<p>2. finetuning the model to understand function calls and their (potentially) JSON schemas.<p>there was a comment here about OpenAI's approach (finetuning a model to understand function call) which raised a good point: since finetuning is often forgetful (previous knowledge learnt by the model gets forgotten a little bit), it's not clear if OpenAI's approach has made GPT-4 less capable than it was before. Not to mention that you're still dealing with a statistical process (LLM), not a locked-in algorithm that generates the desired schema 100% the time.<p>Which brings me to the other approach: steering the LLM's output __as it is generating tokens__, which is what LMQL does. This results in less token usage (you don't send function schema as part of your prompt/message to OpenAI) and 100% accuracy because token probabilities are modified (e.g., 0% chance of any character except ":" after a double quotation mark).
I think the references to this being a “tool” that you can “self-host if you want” are a little disingenuous, especially after seeing that the linked GitHub project doesn’t mention the fact that it’s just a thin wrapper client making requests to a remote server until you’re halfway through the README. The product might be great, but introducing it to the community in this way doesn’t foster much trust in your company from the perspective of a potential customer.<p>The only reference I can find to this being a self-hosted model is a blurb in the GitHub README saying “If you'd like to self-host this in your own cloud, email us”. Sure, I can email my OpenAI/Microsoft rep and self-host GPT-4 in my own cloud for enough money too, but that doesn’t change the fact that the primary business model is SaaS. Just be up-front about this fact in community posts, rather than obfuscating it. Your website does a great job with that.
We're using a similar approach with OpenAI. The user can define a schema using zod and call a prompt. We're then using OpenAI functions behind the scenes to parse the answer into the shape the user wants. Add JSON schema validation on top and we can be sure that the response conforms to our Schema. Some more details and examples can be found in this blog post: <a href="https://wundergraph.com/blog/beyond_functions_seamlessly_build_ai_enhanced_apis_with_openai" rel="nofollow noreferrer">https://wundergraph.com/blog/beyond_functions_seamlessly_bui...</a>
What are the benefits over <a href="https://github.com/microsoft/guidance/">https://github.com/microsoft/guidance/</a> ?
Looking at the playground, it appears the few shot examples in the prompt and CFG are duplicative. What is the relationship between the two?<p>When you say in another comment that using OpenAI functions to output JSON is a waste of tokens, how are you generating the JSON output? And why do your prompts then include few shot examples of JSON objects?
What's the difference between self hosting this and manually running <a href="https://github.com/r2d4/parserllm">https://github.com/r2d4/parserllm</a> ?
oh its 100% predictable alright, predictable to be garbage : the default example chooses height as the wrong "number" whatever that might assume to be, then if you try to change it to define height as perhaps "height in total inches" it still gets it wrong