Hermes-Function-Calling
An open-source Python library enabling the Hermes Pro LLM to perform structured function calling and JSON mode inference using a ChatML prompt format.
At a Glance
About Hermes-Function-Calling
Hermes-Function-Calling is an open-source repository by NousResearch that enables the Hermes Pro Large Language Model to perform structured function calling and JSON mode inference. It provides a complete inference pipeline with recursive tool-call execution, Pydantic-based schema validation, and OpenAI-compatible ChatML prompt formatting. The project supports both function calling (where the model selects and invokes tools) and JSON mode (where the model generates structured outputs conforming to a given schema).
- Function Calling Inference — Run
functioncall.pywith a natural language query; the model selects the appropriate tool, generates a structuredtool_callJSON, executes it, and returns a natural language response. - JSON Mode / Structured Outputs — Use
jsonmode.pywith a Pydantic model schema to force the model to respond with a valid JSON object matching your schema. - Custom Function Support — Add new tools by defining Python functions decorated with
@toolinfunctions.pyand registering them inget_openai_tools(). - Custom Pydantic Models — Define your own Pydantic
BaseModelclasses and serialize them to JSON schema for use in JSON mode inference. - ChatML Prompt Format — Uses the ChatML format with
<|im_start|>/<|im_end|>tokens, compatible with OpenAI API conventions and multi-turn dialogue. - Hermes-3 GOAP Reasoning — Supports Goal Oriented Action Planning (GOAP) via
<scratch_pad>tags for structured reasoning before tool invocation. - 4-bit Quantization Support — Load models in 4-bit precision using bitsandbytes via the
--load_in_4bitflag for reduced memory usage. - Few-Shot Examples — Optionally include few-shot examples via
--num_fewshotto guide model behavior. - Recursive Depth Control — Configure maximum recursive function call iterations with
--max_depthto prevent infinite loops. - yfinance Integration — Built-in financial data functions (stock prices, fundamentals, financial statements) using the yfinance library as demonstration tools.
Community Discussions
Be the first to start a conversation about Hermes-Function-Calling
Share your experience with Hermes-Function-Calling, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
Fully free and open-source under the MIT License. Free to use, modify, and distribute.
- Function calling inference
- JSON mode inference
- Custom function support
- Custom Pydantic model support
- 4-bit quantization support
Capabilities
Key Features
- Function calling inference with recursive tool execution
- JSON mode / structured output generation
- ChatML prompt format (OpenAI-compatible)
- Custom function and tool registration
- Pydantic model schema support
- Hermes-3 GOAP reasoning with scratch_pad
- 4-bit quantization via bitsandbytes
- Few-shot example support
- Configurable recursive depth
- yfinance-based financial data tools
