mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-07 16:18:09 +00:00
In collaboration with @rlouf I build an [outlines](https://dottxt-ai.github.io/outlines/latest/) integration for langchain! I think this is really useful for doing any type of structured output locally. [Dottxt](https://dottxt.co) spend alot of work optimising this process at a lower level ([outlines-core](https://pypi.org/project/outlines-core/0.1.14/) written in rust) so I think this is a better alternative over all current approaches in langchain to do structured output. It also implements the `.with_structured_output` method so it should be a drop in replacement for a lot of applications. The integration includes: - **Outlines LLM class** - **ChatOutlines class** - **Tutorial Cookbooks** - **Documentation Page** - **Validation and error messages** - **Exposes Outlines Structured output features** - **Support for multiple backends** - **Integration and Unit Tests** Dependencies: `outlines` + additional (depending on backend used) I am not sure if the unit-tests comply with all requirements, if not I suggest to just remove them since I don't see a useful way to do it differently. ### Quick overview: Chat Models: <img width="698" alt="image" src="https://github.com/user-attachments/assets/05a499b9-858c-4397-a9ff-165c2b3e7acc"> Structured Output: <img width="955" alt="image" src="https://github.com/user-attachments/assets/b9fcac11-d3e5-4698-b1ae-8c4cb3d54c45"> --------- Co-authored-by: Vadym Barda <vadym@langchain.dev> |
||
---|---|---|
.. | ||
cassettes | ||
__init__.py | ||
test_anthropic.py | ||
test_azure_openai.py | ||
test_azureml_endpoint.py | ||
test_baichuan.py | ||
test_baiduqianfan.py | ||
test_bedrock.py | ||
test_coze.py | ||
test_dappier.py | ||
test_deepinfra.py | ||
test_edenai.py | ||
test_ernie.py | ||
test_fireworks.py | ||
test_friendli.py | ||
test_google_palm.py | ||
test_gpt_router.py | ||
test_hunyuan.py | ||
test_javelin_ai_gateway.py | ||
test_jinachat.py | ||
test_kinetica.py | ||
test_konko.py | ||
test_litellm_router.py | ||
test_litellm_standard.py | ||
test_litellm.py | ||
test_llama_edge.py | ||
test_llamacpp.py | ||
test_minimax.py | ||
test_moonshot.py | ||
test_naver.py | ||
test_octoai.py | ||
test_openai.py | ||
test_outlines.py | ||
test_pai_eas_chat_endpoint.py | ||
test_premai.py | ||
test_promptlayer_openai.py | ||
test_qianfan_endpoint.py | ||
test_reka.py | ||
test_sambanova.py | ||
test_snowflake.py | ||
test_sparkllm.py | ||
test_tongyi.py | ||
test_vertexai.py | ||
test_volcengine_maas.py | ||
test_yuan2.py | ||
test_zhipuai.py | ||
text_mlx.py |