A minimal fork of ToolAgents by Maximilian Winter, optimized for OpenAI-compatible function calling with vLLM.
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
Only 4 lightweight dependencies:
pydantic>=2.5.0- Schema generationopenai>=1.0.0- OpenAI-compatible API clientdocstring-parser>=0.15- Parse function docstrings for tool descriptionshttpx>=0.26.0- Async HTTP client
Total installed size: ~50MB (vs 2-8GB with full ToolAgents)
pip install srt-tool-agents-liteOr with uv:
uv pip install srt-tool-agents-litefrom 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)Based on ToolAgents by Maximilian Winter.
MIT License (same as original ToolAgents)