langfun  by google

Library for object-oriented LLM prompting

Created 2 years ago
849 stars

Top 42.1% on SourcePulse

GitHubView on GitHub
Project Summary

Langfun is a Python library designed to simplify interaction with Large Language Models (LLMs) by treating natural language prompts as programmable objects. It targets developers and researchers seeking more control and structure in LLM applications, enabling the creation of complex agents and workflows with an intuitive, object-oriented approach.

How It Works

Langfun leverages Object-Oriented Prompting, allowing users to define prompts using Python objects and types. This approach facilitates a natural blend of text and modalities, enabling structured data generation and easier debugging. It supports a unified API for various LLMs, including Gemini, GPT, Claude, and Llama3, without requiring model fine-tuning.

Quick Start & Requirements

  • Install with pip install langfun (minimal) or pip install langfun[all] (full).
  • Requires Python.
  • Potential libmagic import issues may require conda install conda-forge::libmagic (OSX) or specific python-magic installations (Windows).
  • Official documentation and tutorials are available.

Highlighted Details

  • Enables seamless integration of natural language and programming.
  • Supports modular prompts with text and modality blending.
  • Offers a powerful evaluation framework.
  • Provides an intuitive programming model with IntelliSense and debugging.

Maintenance & Community

  • This is not an officially supported Google product.
  • A Discord community is available for support and discussion.

Licensing & Compatibility

  • The specific license is not explicitly stated in the README, but its association with Google suggests a permissive license, though users should verify.

Limitations & Caveats

  • The README notes potential installation issues with libmagic on certain operating systems, requiring manual intervention.
Health Check
Last Commit

1 day ago

Responsiveness

1+ week

Pull Requests (30d)
7
Issues (30d)
0
Star History
7 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Kevin Hou Kevin Hou(Head of Product Engineering at Windsurf), and
6 more.

TypeChat by microsoft

0.1%
9k
Library for building natural language interfaces using types
Created 2 years ago
Updated 2 months ago
Feedback? Help us improve.