Skip to main content

A comprehensive framework for building agents with Small Language Models

Project description

effGen

effGen

Build AI Agents with Small Language Models

Fast โ€ข Efficient โ€ข Powerful


CI arXiv PyPI Python License

Downloads Stars Forks

Paper Website Docs PyPI


๐Ÿ“ฐ News & Updates

Date Update
๐ŸŽ‰ 1 Mar 2026 v0.1.0 Released: Major feature release โ€” 14 built-in tools, agent presets, plugin system, real streaming, memory integration, ACP/MCP protocols, CI/CD, and comprehensive test suite. See changelog
๐Ÿ”ง 3 Feb 2026 v0.0.2 Released: vLLM backend fixes with automatic chat template support, GPU memory control, improved OOM error handling, and multi-model family compatibility
๐Ÿ“„ 2 Feb 2026 Preprint available: EffGen: Enabling Small Language Models as Capable Autonomous Agents
๐Ÿš€ 31 Jan 2026 Initial release of effGen framework (v0.0.1)

๐Ÿค” What is effGen?

effGen transforms Small Language Models into powerful AI agents. While most frameworks require massive LLMs, effGen is optimized from the ground up for efficient, smaller models โ€” delivering fast, capable agents without the compute overhead.

from effgen import Agent, load_model
from effgen.core.agent import AgentConfig
from effgen.tools.builtin import Calculator, PythonREPL

# Load a small but mighty model
model = load_model("Qwen/Qwen2.5-1.5B-Instruct", quantization="4bit")

# Create agent with tools
config = AgentConfig(
    name="math_agent",
    model=model,
    tools=[Calculator(), PythonREPL()]
)
agent = Agent(config=config)

# Run computation
result = agent.run("What is 24344 * 334?")
print(f"Answer: {result.output}")

โšก Installation

Requires Python 3.10 or newer. Tested on Python 3.10, 3.11, 3.12, 3.13.

๐Ÿ“ฆ From PyPI (Recommended)

pip install effgen

๐Ÿš€ With vLLM for Faster Inference

pip install effgen[vllm]

๐Ÿ”ง From Source

git clone https://github.com/ctrl-gaurav/effGen.git
cd effGen

# Quick install
./install.sh

# Full install (includes vLLM + dev tools)
./install.sh --full

# Manual install
pip install -e .

๐Ÿš€ Quick Start

๐Ÿ’ป CLI Usage

# Run a task
effgen run "What is the capital of France?"

# Interactive chat
effgen chat

# Start API server
effgen serve --port 8000

# Interactive wizard
effgen

๐Ÿ Python API

from effgen import Agent, load_model
from effgen.core.agent import AgentConfig
from effgen.tools.builtin import Calculator

# Load model
model = load_model("Qwen/Qwen2.5-1.5B-Instruct", quantization="4bit")

# Configure agent
config = AgentConfig(
    name="calculator_agent",
    model=model,
    tools=[Calculator()],
    system_prompt="You are a helpful math assistant."
)

# Create and run
agent = Agent(config=config)
result = agent.run("Calculate 15% tip on $85.50")
print(result.output)

โœจ Features

๐Ÿง 
SLM Optimized
For smaller models

๐Ÿ”„
Multi-Model
HF, OpenAI, etc.

๐Ÿ”ง
Tool Integration
MCP, A2A, ACP

๐Ÿงฉ
Task Decomp
Auto breakdown

๐Ÿ‘ฅ
Multi-Agent
Coordination

๐Ÿ’พ
Memory
Short & Long

๐Ÿ”Œ
Plugins
Extensible


๐ŸŽฏ Agent Presets

Get started instantly with ready-to-use agent configurations:

from effgen import load_model
from effgen.presets import create_agent

model = load_model("Qwen/Qwen2.5-3B-Instruct", quantization="4bit")

# One-line agent creation
math_agent = create_agent("math", model)       # Calculator + PythonREPL
research_agent = create_agent("research", model) # WebSearch + URLFetch + Wikipedia
coding_agent = create_agent("coding", model)     # CodeExecutor + PythonREPL + FileOps + Bash
general_agent = create_agent("general", model)   # All 11 tools
minimal_agent = create_agent("minimal", model)   # Direct inference, no tools
# CLI preset support
effgen run --preset math "What is sqrt(144)?"
effgen run --preset research "Tell me about quantum computing"

๐Ÿ› ๏ธ Built-in Tools (14)

๐Ÿ”ข
Calculator
Math & Units

๐ŸŒ
WebSearch
DuckDuckGo

๐Ÿ’ป
CodeExecutor
Sandboxed

๐Ÿ
PythonREPL
Interactive

๐Ÿ“
FileOps
Read/Write

๐Ÿ”
Retrieval
RAG + BM25

๐ŸŽฏ
AgenticSearch
ripgrep

๐Ÿ–ฅ๏ธ
BashTool
Shell Cmds

๐ŸŒค๏ธ
WeatherTool
Open-Meteo

๐Ÿ“‹
JSONTool
Query/Validate

๐Ÿ•
DateTimeTool
Timezones

๐Ÿ“
TextProcessing
Regex/Count

๐Ÿ”—
URLFetch
Web Scrape

๐Ÿ“–
Wikipedia
Free API


๐Ÿ“š Examples

python examples/basic_agent.py      # Basic agent (Transformers backend)

python examples/basic_agent_vllm.py # Basic agent (vLLM backend - 5-10x faster)

python examples/web_agent.py        # Web search agent

python examples/retrieval_agent.py  # RAG-based retrieval

python examples/agentic_search_agent.py # Grep-based agentic search
๐Ÿ“– More Examples

Multi-Tool Agent

from effgen import Agent, load_model
from effgen.core.agent import AgentConfig
from effgen.tools.builtin import Calculator, WebSearch, PythonREPL

model = load_model("Qwen/Qwen2.5-3B-Instruct")

config = AgentConfig(
    name="research_agent",
    model=model,
    tools=[Calculator(), WebSearch(), PythonREPL()],
    system_prompt="You are a research assistant."
)

agent = Agent(config=config)
result = agent.run("Search for the population of Tokyo and calculate what percentage it is of Japan's total population")

Streaming

from effgen import Agent, load_model
from effgen.core.agent import AgentConfig
from effgen.tools.builtin import Calculator

model = load_model("Qwen/Qwen2.5-3B-Instruct", quantization="4bit")
agent = Agent(config=AgentConfig(
    name="stream_demo", model=model,
    tools=[Calculator()], enable_streaming=True
))

for token in agent.stream("What is 2 + 2?"):
    print(token, end="", flush=True)

Memory (Multi-Turn)

agent = Agent(config=AgentConfig(
    name="memory_demo", model=model,
    tools=[], enable_memory=True
))

agent.run("My name is Alice and I'm working on quantum computing.")
result = agent.run("What's my name and what am I working on?")
# โ†’ "Your name is Alice and you're working on quantum computing."

Retrieval Agent (RAG)

from effgen.tools.builtin import Retrieval

retrieval_tool = Retrieval(knowledge_base_path="./docs")
config = AgentConfig(name="qa_agent", model=model, tools=[retrieval_tool])
agent = Agent(config=config)
result = agent.run("What does the documentation say about configuration?")

๐Ÿ”’ Security

๐Ÿณ
Docker Sandbox
Isolated execution

๐Ÿ›ก๏ธ
Input Validation
Auto sanitization

โšก
Rate Limiting
Configurable limits

๐Ÿ“‹ For security policies and vulnerability reporting, see SECURITY.md


๐Ÿ“– Citation

If you use effGen in your research, please cite our paper:

@software{srivastava2026effgen,
      title={effGen: Enabling Small Language Models as Capable Autonomous Agents},
      author={Gaurav Srivastava and Aafiya Hussain and Chi Wang and Yingyan Celine Lin and Xuan Wang},
      year={2026},
      eprint={2602.00887},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2602.00887},
}

๐Ÿ”— Links

Paper Website Docs PyPI Issues


๐Ÿ“„ License

Apache License 2.0 โ€” see LICENSE for details.


Get Started Examples Paper GitHub

Made with โค๏ธ for the AI community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

effgen-0.1.0.tar.gz (312.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

effgen-0.1.0-py3-none-any.whl (361.3 kB view details)

Uploaded Python 3

File details

Details for the file effgen-0.1.0.tar.gz.

File metadata

  • Download URL: effgen-0.1.0.tar.gz
  • Upload date:
  • Size: 312.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for effgen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 253344d9cb6a184ad04cc870fcae849547f0afa3f3d53b4802188c06d12f0c6f
MD5 ee9702ecfb2d0f3b16379723a07e2dc8
BLAKE2b-256 b75ca448ef350e3af6676194f57a2b8001d20669a032426e56fea260a06b547d

See more details on using hashes here.

File details

Details for the file effgen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: effgen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 361.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for effgen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb0a16423b6ea6512d594d44cb24e6d53d072e7b9c8f6fd9ba0b5e67a9fa7b16
MD5 3de727681ca552a538a9dcd3956546c6
BLAKE2b-256 bde5bf9c4888beec87f8cf6ecda40f0d8ad79910b01a22cb688a48279326e2f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page