awesome-repositories.com
Blog
MCP
awesome-repositories.com

Descoperă cele mai bune repository-uri open source cu căutare AI.

ExploreazăCăutări recomandateAlternative open-sourceSoftware self-hostedBlogHartă site
ProiectServer MCPDespreCum realizăm clasamentulPresă
LegalConfidențialitateTermeni
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
noamgat avatar

noamgat/lm-format-enforcer

0
View on GitHub↗
2,022 stele·91 fork-uri·Python·MIT·16 vizualizări

Lm Format Enforcer

Această bibliotecă oferă un framework pentru impunerea constrângerilor structurale asupra output-ului modelelor de limbaj în timpul procesului de generare a token-urilor. Funcționează ca un middleware care restricționează răspunsurile modelului pentru a adera strict la scheme JSON predefinite sau la tipare de expresii regulate, asigurându-se că textul generat este lizibil pentru mașină și consistent pentru consumul ulterior de date.

Proiectul se distinge prin integrarea directă cu motoarele de inferență pentru a intercepta distribuțiile de probabilitate ale token-urilor înainte de etapa finală de eșantionare. Prin utilizarea parsării cu mașini de stare și descompunerea recursivă a schemelor, efectuează validarea lookahead pentru a elimina secvențele de token-uri invalide. Această abordare permite un control precis asupra output-ului, inclusiv impunerea unei ordini specifice a câmpurilor în obiectele JSON și capacitatea de a gestiona mai multe fluxuri de generare concurente prin execuția constrângerilor în loturi (batched).

Biblioteca suportă o gamă largă de strategii de integrare, permițându-i să funcționeze pe diverse backend-uri de modele și medii de server de inferență. Include instrumente de diagnosticare pentru analizarea impactului acestor constrângeri asupra performanței, asigurând compatibilitatea și eficiența pe diferite configurații hardware. Software-ul este distribuit ca un pachet Python conceput pentru integrarea în pipeline-urile de inferență existente.

Features

  • Structured Output Generators - Ensures language models produce text that strictly follows predefined JSON schemas or regular expression patterns.
  • Output Constraint Engines - Restricts token generation during inference to ensure adherence to JSON schemas or regular expression patterns.
  • Inference Middleware - Provides a standardized middleware layer to intercept and modify token probability distributions across diverse model backends.
  • Output Constraint Engines - Enforces strict JSON schema adherence during token generation by intercepting probability distributions to prune invalid sequences.
  • Schema Enforcement Tools - Validates and forces language model outputs to adhere to specific data structures during inference.
  • Logit Masks - Filters model vocabulary at each generation step by masking tokens that violate structural constraints.
  • LLM Output Constraints - Restricts language model token generation to strictly follow defined JSON schemas and regular expression patterns.
  • Generation State Machines - Maintains a deterministic state machine to track schema positions and validate next-token candidates.
  • Data Extraction Pipelines - Builds robust workflows for generating machine-readable data from language models.
  • Regex Constraint Engines - Provides regex-based token masking to ensure generated text matches specific patterns for downstream data consumption.
  • LLM Inference Engines - Connects output enforcement logic to various model execution backends.
  • Batch Generation - Applies independent token constraints to multiple concurrent inputs during a single generation process.
  • Regex-Based Output Filters - Limits language model output to match precise regular expression patterns for predictable data consumption.
  • Parser Combinators - Merges distinct parsing logic into a unified workflow to process complex data structures.
  • Generation Lookaheads - Prunes invalid token sequences by simulating potential future outputs to ensure structural compliance.
  • Inference Engine Integrations - Provides a framework for applying structural output constraints across various model backends.
  • Schema Decomposition - Decomposes complex data structures into manageable parsing rules evaluated incrementally during generation.
  • Generation Stream Batching - Enables efficient handling of multiple concurrent generation streams by maintaining separate parser states for each request.

Istoric stele

Graficul istoricului de stele pentru noamgat/lm-format-enforcerGraficul istoricului de stele pentru noamgat/lm-format-enforcer

Căutare AI

Explorează mai multe repository-uri excelente

Descrie ce ai nevoie în limbaj simplu — AI-ul sortează mii de proiecte open source selectate în funcție de relevanță.

Start searching with AI

Colecții curatoriate care includ Lm Format Enforcer

Colecții selectate manual în care apare Lm Format Enforcer.
  • Biblioteci pentru output structurat din LLM-uri
  • Framework-uri de orchestrare LLM cu tipizare

Alternative open-source pentru Lm Format Enforcer

Proiecte open-source similare, clasificate după numărul de funcționalități comune cu Lm Format Enforcer.
  • eth-sri/lmqlAvatar eth-sri

    eth-sri/lmql

    4,185Vezi pe GitHub↗

    LMQL is a programming language and probabilistic interface that blends algorithmic logic with stochastic text generation. It functions as a constraint-guided prompting framework and structured output generator, allowing users to force model responses to adhere to strict formatting and data types. The system distinguishes itself as an inference optimizer that increases token throughput and reduces latency. This is achieved through specialized execution strategies, including tree-based prompt caching and asynchronous batch processing. The project covers a broad range of generation control capa

    Python
    Vezi pe GitHub↗4,185
  • dottxt-ai/outlinesAvatar dottxt-ai

    dottxt-ai/outlines

    13,446Vezi pe GitHub↗

    Outlines is a library designed to ensure machine-readable output from generative models by applying programmatic constraints during the token sampling process. It functions as a toolkit for forcing large language models to generate text that strictly adheres to JSON schemas, regular expressions, and formal grammars, enabling the integration of model responses into existing software systems. The library distinguishes itself by integrating formal language rules directly into the sampling loop. It achieves this by converting regular expressions into deterministic finite automata and utilizing lo

    Pythoncfggenerative-aijson
    Vezi pe GitHub↗13,446
  • microsoft/guidanceAvatar microsoft

    microsoft/guidance

    21,502Vezi pe GitHub↗

    Guidance is a control framework and generation orchestrator for large language models. It provides a programming layer to steer model outputs through structured templates, schema enforcement, and logical flow management. The framework distinguishes itself by interleaving model generation with local code execution, enabling the use of loops and conditional branching within a single session. It employs grammar-based token constraints and regular expressions to force models to sample only from tokens that satisfy a specific structural format, ensuring strict adherence to predefined data models.

    Jupyter Notebook
    Vezi pe GitHub↗21,502
  • outlines-dev/outlinesAvatar outlines-dev

    outlines-dev/outlines

    13,965Vezi pe GitHub↗

    Outlines is a guided text generation framework and structured output engine for large language models. It enforces precise structural constraints on model output during the sampling process to ensure the generation of valid data. The framework ensures that model outputs strictly adhere to predefined data models, including JSON schemas, regular expressions, and formal grammars. This enables the conversion of natural language inputs into structured arguments for function calling and the generation of valid JSON for downstream processing. The system manages model orchestration through prompt te

    Python
    Vezi pe GitHub↗13,965
Vezi toate cele 30 alternative pentru Lm Format Enforcer→

Întrebări frecvente

Ce face noamgat/lm-format-enforcer?

Această bibliotecă oferă un framework pentru impunerea constrângerilor structurale asupra output-ului modelelor de limbaj în timpul procesului de generare a token-urilor. Funcționează ca un middleware care restricționează răspunsurile modelului pentru a adera strict la scheme JSON predefinite sau la tipare de expresii regulate, asigurându-se că textul generat este lizibil pentru mașină și consistent pentru consumul ulterior de date.

Care sunt principalele funcționalități ale noamgat/lm-format-enforcer?

Principalele funcționalități ale noamgat/lm-format-enforcer sunt: Structured Output Generators, Output Constraint Engines, Inference Middleware, Schema Enforcement Tools, Logit Masks, LLM Output Constraints, Generation State Machines, Data Extraction Pipelines.

Care sunt câteva alternative open-source pentru noamgat/lm-format-enforcer?

Alternativele open-source pentru noamgat/lm-format-enforcer includ: eth-sri/lmql — LMQL is a programming language and probabilistic interface that blends algorithmic logic with stochastic text… dottxt-ai/outlines — Outlines is a library designed to ensure machine-readable output from generative models by applying programmatic… microsoft/guidance — Guidance is a control framework and generation orchestrator for large language models. It provides a programming layer… outlines-dev/outlines — Outlines is a guided text generation framework and structured output engine for large language models. It enforces… boundaryml/baml — BAML is a prompt engineering framework and LLM client generator that defines AI prompts as type-safe functions. It… abetlen/llama-cpp-python — llama-cpp-python provides a Python interface for the llama.cpp library, enabling the execution of large language…