langfun  by google

Library for object-oriented LLM prompting

Created 2 years ago
866 stars

Top 41.4% 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

13 hours ago

Responsiveness

1+ week

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

Explore Similar Projects

Starred by Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), David Cournapeau David Cournapeau(Author of scikit-learn), and
3 more.

codecompanion.nvim by olimorris

0.8%
6k
Neovim plugin for AI-powered coding assistance
Created 1 year ago
Updated 10 hours ago
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 1 month ago
Feedback? Help us improve.