bobatnet 19 hours ago

TLDR: LQ(question) => GraphQL([q0, q1, …])

LLM output can be drastically improved by breaking the problem into smaller problems, using reasoning and prompting as a chain. With the wide variability in LLM pricing and model sizes, it also helps if we can offload some of those sub prompts in the chain to smaller models. LQ provides a GraphQL endpoint that allows you to call multiple LLMs viz. gemini, claude, openai, mistral as a tree. You can extract structured xml tags from responses and fill placeholders in prompts down the chain/tree. With conditionals, you can provide condition-based branching as well. Further, we also provide an inbuilt AI Chainer that creates a chain for you. As an added benefit it also has a request history, for you to repeat a query while changing some of the placeholders as variables.

An example of how LQ helps improving any LLM is:

User: write a sentence that ends with letter y. Openai: Sure, here's a sentence that fits your request: "She gazed at the starry sky in wonder and felt utterly free."

Clearly the answer is not correct. So we use LQ’s Ai chain. It creates these subproblems:

What are some common words that end with the letter 'y'? How can we construct a grammatically correct sentence using a word that ends with 'y'? What is a simple sentence structure that can be used to ensure the sentence ends with 'y'?

And writes this orchestration as a single LQ Graphql query. So with a single click, user gets the final answer: Openai new response: "The sun sets slowly.”

Do use LQ for your own experiments and please share your feedback.

We are a team of 2 and have been using LLMs in many projects. For every LLM operation we end up making several LLM calls and have to write our own tooling to optimize the queries as a bunch. Even during development, evaluating multiple LLMs, prompt-tuning, condition based calling, etc. is messy. We are trying to make LQ as a middle-layer that can ease some of those pains and allow users to express the data flow within the request itself.

Our next goal includes support for local LLMs as well as longer running queries with subscriptions. Large chains/trees will also be supported with the context residing on the server.