Hermes-Function-Calling  by NousResearch

Function-calling code for LLMs, demoing financial queries

created 1 year ago
1,014 stars

Top 37.5% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides code for the NousResearch Hermes-2 Pro LLM to perform function calling and generate structured JSON outputs, targeting developers and researchers who need to integrate LLM capabilities with external tools and data. It enables querying financial data and creating structured representations of information.

How It Works

The project leverages the Hermes-2 Pro model, specifically fine-tuned for function calling and structured output generation using the ChatML format. It processes user queries, identifies relevant functions (defined in functions.py and extensible with custom tools), and generates tool calls in a specified format. The output can be either a direct function call or a JSON object adhering to a provided Pydantic schema, facilitating programmatic interaction with the LLM.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt
  • Run function call inference: python functioncall.py --query "..."
  • Run JSON mode inference: python jsonmode.py --query "..."
  • Key arguments: --model_path, --load_in_4bit
  • Requires Python and yfinance library for default functions.

Highlighted Details

  • Supports both function calling (tool use) and direct JSON output generation.
  • Demonstrates integration with the yfinance library for financial data.
  • Provides clear examples of custom function and Pydantic model integration.
  • Utilizes the ChatML prompt format for structured LLM interaction.

Maintenance & Community

Licensing & Compatibility

  • The repository's license is not explicitly stated in the README. Users should verify compatibility for commercial or closed-source use.

Limitations & Caveats

  • The README does not specify the exact model version or license, requiring user verification.
  • Customization of functions and Pydantic models requires modifying provided Python scripts.
Health Check
Last commit

10 months ago

Responsiveness

1 week

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

Explore Similar Projects

Feedback? Help us improve.