awesome-llm-json
Resource list for generating JSON using LLMs via function calling, tools, CFG. Libraries, Models, Notebooks, etc.
https://github.com/imaurer/awesome-llm-json
Last synced: 10 days ago
JSON representation
Autonomous Agents
Autonomous Agent Resources
- Emergent autonomous scientific research capabilities of large language models
- Twitter List: Homebrew AGI Club
- @altryne
- LangChain: Custom Agents
- HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in HuggingFace
- Introducing Agents in Haystack: Make LLMs resolve complex tasks - 03-30, Haystack and Deepset)
- Introducing "🤖 Task-driven Autonomous Agent"
- @yoheinakajima
- A simple Python implementation of the ReAct pattern for LLMs
- ReAct: Synergizing Reasoning and Acting in Language Models
Blog Articles
- Getting Started with Function Calling - 01-11, Elvis Saravia) introduces function calling for connecting LLMs with external tools and APIs, providing an example using OpenAI's API and highlighting potential applications.
- Structured Generation Improves LLM performance: GSM8K Benchmark - 03-15, .txt Engineering) demonstrates consistent improvements across 8 models, highlighting benefits like "prompt consistency" and "thought-control."
- LoRAX + Outlines: Better JSON Extraction with Structured Generation and LoRA - 03-03, Predibase Blog) combines Outlines with LoRAX v0.8 to enhance extraction accuracy and schema fidelity through structured generation, fine-tuning, and LoRA adapters.
- FU, Show Me The Prompt. Quickly understand inscrutable LLM frameworks by intercepting API calls - 02-14, Hamel Husain) provides a practical guide to intercepting API calls using mitmproxy, gaining insights into tool functionality, and assessing necessity. Emphasizes minimizing complexity and maintaining close connection with underlying LLMs.
- Coalescence: making LLM inference 5x faster - 02-02, .txt Engineering) shows how structured generation can be made faster than unstructured generation using a technique called "coalescence", with a caveat regarding how it may affect the quality of the generation.
- Pushing ChatGPT's Structured Data Support To Its Limits - 12-21, Max Woolf) delves into leveraging ChatGPT's capabilities using paid API, JSON schemas, and Pydantic. Highlights techniques for improving output quality and the benefits of structured data support.
- Using OpenAI functions and their Python library for data extraction - 07-09, Simon Willison) demonstrates extracting structured data using OpenAI Python library and function calling in a single API call, with a code example and suggestions for handling streaming limitations.
- Why Pydantic became indispensable for LLMs - 01-19, Adam Azzam) explains Pydantic's emergence as a critical tool, enabling sharing data models via JSON schemas and reasoning between unstructured and structured data. Highlights the importance of quantizing the decision space and potential issues with LLMs overfitting to older schema versions.
-
How fast can grammar-structured generation be?
- 04-12, .txt Engineering) demonstrates an almost cost-free method to generate text that follows a grammar. It is shown to outperform
llama.cppby a factor of 50x on the C grammar. - Using grammars to constrain llama.cpp output - 09-06, Ian Maurer) integrates context-free grammars with llama.cpp for more accurate and schema-compliant responses, particularly for biomedical data.
Hosted Models
- Function Calling - us/pricing/details/cognitive-services/openai-service/#pricing)Mistral Pricing |
- Function Calling - R (2024-03-11)](https://txt.cohere.com/command-r/)Command-R+ (2024-04-04) |
- Function Calling
- Function Calling
- API Docs - 03-18)](https://rysana.com/inversion) |
- Function Calling - mode)PricingAnnouncement 2024-01-31 |
- API Docs - use) |
- Function Calling
- Function Calling - generation/json-mode)PricingAnnouncement (2023-06-13) |
- Function Calling - generation/json-mode)PricingAnnouncement (2023-06-13) |
- Function Calling - generation/json-mode)PricingAnnouncement (2023) |
- many open-source models - generation-inference/conceptual/guidance#guidance)For free locally, or via dedicated or serverless endpoints. |
- Function Calling - generation/json-mode)PricingAnnouncement (2023) |
- API Docs - use) |
- Function Calling
- Function Calling - us/pricing/details/cognitive-services/openai-service/#pricing)Mistral Pricing |
- Function Calling - us/pricing/details/cognitive-services/openai-service/#pricing)Mistral Pricing |
- Function Calling - R (2024-03-11)](https://txt.cohere.com/command-r/)Command-R+ (2024-04-04) |
- Function Calling
Jupyter Notebooks
Leaderboards
- HuggingFace Open LLM Leaderboard
- Berkeley Function-Calling Leaderboard (BFCL) - calling capabilities including over 2k question-function-answer pairs across languages like Python, Java, JavaScript, SQL, and REST API, focusing on simple, multiple, and parallel function calls, as well as function relevance detection.
LLM-based Tools
Local LLM Resources
Local LLMs
Local LLM Repositories
- Open Assistant - A chat-based ChatGPT-like large language model. (2023-04-15, Pythia, LLAMA, Apache 2.0 License)
Local LLM Resources
- Introducing MPT-7B: A New Standard for Open-Source, Commercially Usable LLMs
- RedPajama reproduces LLaMA training dataset of over 1.2 trillion tokens
- What’s in the RedPajama-Data-1T LLM training set
- GPT4All-J: An Apache-2 Licensed Assistant-Style Chatbot
- Databricks releases Dolly 2.0, the first open, instruction-following LLM for commercial use
- Summary of Curent Models
- Running GPT4All On a Mac Using Python langchain in a Jupyter Notebook
- Cerebras-GPT vs LLaMA AI Model Comparison
- Hello Dolly: Democratizing the magic of ChatGPT with open models
- The Coming of Local LLMs
- The RWKV language model: An RNN with the advantages of a transformer
- Bringing Whisper and LLaMA to the masses
- Alpaca: A Strong, Replicable Instruction-Following Model
- Large language models are having their Stable Diffusion moment
- Running LLaMA 7B and 13B on a 64GB M2 MacBook Pro with llama.cpp
Local LLM Spaces, Models & Datasets
Local Models
- Hermes 2 Pro - Mistral 7B - 03-13, Nous Research) is a 7B parameter model that excels at function calling, JSON structured outputs, and general tasks. Trained on an updated OpenHermes 2.5 Dataset and a new function calling dataset, it uses a special system prompt and multi-turn structure. Achieves 91% on function calling and 84% on JSON mode evaluations.
- Gorilla OpenFunctions v2 - 02-27, Apache 2.0 license, Charlie Cheng-Jie Ji et al.) interprets and executes functions based on JSON Schema Objects, supporting multiple languages and detecting function relevance.
- NexusRaven-V2 - 12-05, Nexusflow) is a 13B model outperforming GPT-4 in zero-shot function calling by up to 7%, enabling effective use of software tools. Further instruction-tuned on CodeLlama-13B-instruct.
- Functionary - 08-04, MeetKai) interprets and executes functions based on JSON Schema Objects, supporting various compute requirements and call types. Compatible with OpenAI-python and llama-cpp-python for efficient function execution in JSON generation tasks.
- C4AI Command R+ - 03-20, CC-BY-NC, Cohere) is a 104B parameter multilingual model with advanced Retrieval Augmented Generation (RAG) and tool use capabilities, optimized for reasoning, summarization, and question answering across 10 languages. Supports quantization for efficient use and demonstrates unique multi-step tool integration for complex task execution.
- Hugging Face TGI - generation-inference/supported_models).
- Mistral 7B Instruct v0.3 - 05-22, Apache 2.0) an instruct fine-tuned version of Mistral with added function calling support.
Non-English Models & Datasets
Local LLM Resources
Prompting Tools
Autonomous Agent Resources
Python Libraries
- DSPy - blocks/8-typed_predictors.md) to leverage Pydantic for enforcing type constraints on inputs and outputs, improving upon string-based fields.
- FuzzTypes
- guidance - 2.0) enables constrained generation, interleaving Python logic with LLM calls, reusable functions, and calling external tools. Optimizes prompts for faster generation.
- LangChain
- LiteLLM
- LlamaIndex - defined Pydantic programs for specific output types.
- Marvin - 2.0) is a lightweight toolkit for building reliable natural language interfaces with self-documenting tools for tasks like entity extraction and multi-modal support.
- Pydantic
- SGLang - 2.0) allows specifying JSON schemas using regular expressions or Pydantic models for constrained decoding. Its high-performance runtime accelerates JSON decoding.
- SynCode - guided generation of Large Language Models (LLMs). It supports CFG for Python, Go, Java, JSON, YAML, and many more.
- Mirascope
- Magnetic
- Formatron - string templates that support regular expressions, context-free grammars, JSON schemas, and Pydantic models. Formatron integrates seamlessly with various model inference libraries.
- Transformers-cfg - free grammar (CFG) support via an EBNF interface. It enables grammar-constrained generation with minimal changes to existing code of transformers and supports JSON mode and JSON Schema.
- PydanticAI
- Outlines - 2.0) facilitates structured text generation using multiple models, Jinja templating, and support for regex patterns, JSON schemas, Pydantic models, and context-free grammars.
- Instructor
Terminology
Videos
- Hermes 2 Pro Overview - 03-18, Prompt Engineer) introduces Hermes 2 Pro, a 7B parameter model excelling at function calling and structured JSON output. Demonstrates 90% accuracy in function calling and 84% in JSON mode, outperforming other models.
- Mistral AI Function Calling - 02-24, Sophia Yang) demonstrates connecting LLMs to external tools, generating function arguments, and executing functions. Could be extended to generate or manipulate JSON data.
- Function Calling in Ollama vs OpenAI - 02-13, Matt Williams) clarifies that models generate structured output for parsing and invoking functions. Compares implementations, highlighting Ollama's simpler approach and using few-shot prompts for consistency.
- LLM Engineering: Structured Outputs - 02-12, Jason Liu, Weights & Biases Course) offers a concise course on handling structured JSON output, function calling, and validations using Pydantic, covering essentials for robust pipelines and efficient production integration.
- Pydantic is all you need - 10-10, Jason Liu, AI Engineer Conference) discusses the importance of Pydantic for structured prompting and output validation, introducing the Instructor library and showcasing advanced applications for reliable and maintainable LLM-powered applications.
- LLM Structured Output for Function Calling with Ollama - 03-25, Andrej Baranovskij) demonstrates function calling-based data extraction using Ollama, Instructor and Sparrow agent.
- GPT Extracting Unstructured Data with Datasette and GPT-4 Turbo - 04-09, Simon Willison) showcases the datasette-extract plugin's ability to populate database tables from unstructured text and images, leveraging GPT-4 Turbo's API for data extraction.