Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

srt-tool-agents-lite

A minimal fork of ToolAgents by Maximilian Winter, optimized for OpenAI-compatible function calling with vLLM.

Why This Fork?

The original ToolAgents package includes dependencies for multiple LLM providers (Anthropic, Google, Mistral, Groq) and optional features that pull in heavy dependencies like PyTorch, sentence-transformers, and transformers. This results in Docker images of 8GB+ when all you need is OpenAI-compatible function calling.

srt-tool-agents-lite strips out everything except:

  • OpenAI-compatible API provider (works with vLLM, OpenAI, any OpenAI-compatible endpoint)
  • FunctionTool decorator and ToolRegistry
  • ChatToolAgent for tool-calling agent loops
  • Async support

Dependencies

Only 4 lightweight dependencies:

  • pydantic>=2.5.0 - Schema generation
  • openai>=1.0.0 - OpenAI-compatible API client
  • docstring-parser>=0.15 - Parse function docstrings for tool descriptions
  • httpx>=0.26.0 - Async HTTP client

Total installed size: ~50MB (vs 2-8GB with full ToolAgents)

Installation

pip install srt-tool-agents-lite

Or with uv:

uv pip install srt-tool-agents-lite

Usage

from srt_tool_agents import FunctionTool, ToolRegistry, ChatToolAgent
from srt_tool_agents.provider import OpenAIChatAPI

# Create a tool from a function
def search_knowledge(query: str, limit: int = 5) -> str:
    """
    Search the knowledge base using semantic similarity.

    Args:
        query: The search query
        limit: Maximum number of results to return

    Returns:
        Search results as a formatted string
    """
    # Your implementation here
    return f"Found {limit} results for: {query}"

# Register the tool
tool = FunctionTool(search_knowledge)
registry = ToolRegistry()
registry.add_tool(tool)

# Create an agent with vLLM backend
api = OpenAIChatAPI(
    api_key="not-needed-for-vllm",
    model="Qwen/Qwen3-4B-Instruct",
    base_url="http://vllm.inference.svc.cluster.local:8000/v1"
)

agent = ChatToolAgent(chat_api=api)

# Get a response with tool calling
from srt_tool_agents.messages import ChatMessage

messages = [ChatMessage.create_user_message("Search for information about Python")]
response = agent.get_response(messages, tool_registry=registry)
print(response.response)

Credits

Based on ToolAgents by Maximilian Winter.

License

MIT License (same as original ToolAgents)

About

Minimal fork of ToolAgents for OpenAI-compatible function calling with vLLM

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages