langfun  by google

Library for object-oriented LLM prompting

created 1 year ago
823 stars

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

20 hours ago

Responsiveness

Inactive

Pull Requests (30d)
13
Issues (30d)
0
Star History
117 stars in the last 90 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Stas Bekman Stas Bekman(Author of Machine Learning Engineering Open Book; Research Engineer at Snowflake), and
21 more.

guidance by guidance-ai

0.1%
21k
Guidance is a programming paradigm for steering LLMs
created 2 years ago
updated 1 day ago
Feedback? Help us improve.