Skip to content

Repository files navigation

GPT OSS

Modular, extensible OpenAI-compatible tool calling service for local and remote LLMs.

Features

  • Automatic discovery and registration of tool services via decorators
  • Service registry and dynamic schema generation
  • Chat orchestration with tool execution
  • Harmony-style message separation (system, developer, user)
  • Flexible configuration via environment variables or .env
  • Support for custom tool directories

Usage

fromservices.chat_serviceimportChatServicefromservices.tool_serviceimportToolService# Optionally discover tools in a custom directorycustom_tool_dirs= ["/path/to/your/tools"]
tool_service=ToolService(tool_dirs=custom_tool_dirs)
tools=tool_service.get_tool_schema()
chat_service=ChatService(api_key="your-key", base_url="http://localhost:8080/v1", model="gpt-oss-20b", tools=tools)
messages= [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Add 10 and 5."}
]
response=chat_service.chat_completion(messages)
print(response)

CLI Example

python main.py

Custom Tools

  • Create a Python file in your tools directory
  • Use the @register_tool decorator from tools.__base__
  • Example:
fromtools.__base__importToolBase, register_tool@register_toolclassMyTool(ToolBase):
name="my_tool"description="Does something useful."parameters= { ... }
defmy_tool(self, ...):
...

License

MIT

About

Modular, extensible OpenAI-compatible tool calling service for local and remote LLMs. Designed for ease of Tool Development through decorator discovery and adhering to the Harmony format.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages