Hermes Atlas
Official Nous Research repos

Hermes Function Calling

NousResearch/Hermes-Function-Calling · Published by Nous Research

Reference code for Hermes Pro models to run function calling and JSON mode against a tool schema

In short

Hermes Function Calling is a NousResearch repository with code that lets the Hermes Pro language model call functions from a provided schema and return JSON that follows a schema. It concerns the Hermes models rather than the Hermes Agent app.

What Hermes Function Calling does

Hermes-Function-Calling contains code for the Hermes Pro language model to perform function calling based on a provided schema. The sample functions in functions.py use the yfinance library to fetch stock prices, company fundamentals and financial statements. functioncall.py is the main entry point: it initializes the model and tokenizer and runs a recursive loop that generates function calls and executes them, with a default maximum depth of 5.

A separate JSON mode, run with jsonmode.py, makes the model return an object that follows a JSON schema generated from a pydantic model and validates the result. Custom functions are added in functions.py with the @tool decorator and registered in get_openai_tools(). Command-line options include --model_path (default NousResearch/Hermes-2-Pro-Llama-3-8B), --chat_template (default chatml), --num_fewshot, --load_in_4bit and --max_depth. prompter.py manages prompt generation.

Key features

  • Function calling inference with a recursive call-and-execute loop
  • JSON mode that validates output against a pydantic-generated schema
  • Sample stock tools in functions.py built on yfinance
  • Add your own functions with the @tool decorator and get_openai_tools()
  • Options for model path, chat template, few-shot examples, 4-bit loading and recursion depth

When to use it

  • Test how a Hermes Pro model chooses and calls functions from a schema
  • Generate structured JSON, such as a character profile, that matches a pydantic model
  • Use the scripts as a starting point for your own tool-calling harness

Who it is for: Developers who work directly with Nous Research's Hermes Pro models and want to try function calling and JSON mode.

How it fits with Hermes Agent

Published by Nous Research for the Hermes Pro model line; it covers model-level function calling and JSON mode, not the Hermes Agent app.

How to install Hermes Function Calling

These commands are copied from the project's README. Check the repository for the latest steps before you run them.

pip install -r requirements.txt

FAQ

What is Hermes Function Calling?

Hermes Function Calling is a NousResearch repository with code for the Hermes Pro language model to call functions from a schema and to return JSON that follows a schema.

Does Hermes Function Calling work with Hermes Agent?

It targets the Hermes Pro models, not the Hermes Agent app. The README documents standalone Python scripts and does not describe a Hermes Agent integration.

How do I install Hermes Function Calling?

Run pip install -r requirements.txt in the repository. Then run python functioncall.py with a --query argument for function calling, or python jsonmode.py for JSON mode.

Similar official for Hermes Agent

All official

Related guides: What is Hermes Agent? · How to install Hermes Agent