Skip to content

Releases: zhangdw156/Sloop

v0.2.1

Choose a tag to compare

@zhangdw156 zhangdw156 released this 02 Jan 06:39

Sloop v0.2.1

This release introduces multithreaded dialog generation for significantly faster dataset creation, along with improved error handling and a refined logging system.

πŸš€ New Features

Multithreaded Dialog Generation

  • [cite_start]Concurrent Execution: Added the --concurrency (alias -j) parameter to the CLI, allowing parallel generation of multiple dialog chains.
  • Quantity-Guaranteed Loop: Implemented a robust generation loop using the wait(..., return_when=FIRST_COMPLETED) pattern. [cite_start]If a generation task fails (e.g., due to API errors), a replacement task is automatically spawned to ensure the requested count is exactly met.
  • [cite_start]Thread-Safe Sampling: Implemented global thread locks (threading.Lock) for the graph sampling engine to ensure diverse starting nodes are selected without race conditions during parallel execution.

πŸ›‘οΈ Stability & Improvements

Smart Error Handling

  • Context Window Fallback: Added a smart retry mechanism for litellm.ContextWindowExceededError. [cite_start]If a prompt exceeds the token limit, the engine automatically retries the generation with a reduced rag_top_k value (halving the number of RAG examples).
  • [cite_start]Hallucination Prevention: hardened agent prompts (specifically in assistant_decide and selector templates) with strict prohibitions against inventing tools or parameters not defined in the schema.

Logging & Developer Experience

  • Separated Logging Streams:
    • [cite_start]Console: Now uses tqdm_sink to display only WARNING and ERROR logs, ensuring the progress bar remains clean and visual artifacts are minimized.
    • [cite_start]File Log: Detailed DEBUG and INFO logs are written to logs/sloop.log, now including thread names to assist in debugging concurrent processes.
  • [cite_start]Reduced Noise: Suppressed verbose debug output from LiteLLM to keep the console output focused.

⚑ Usage

Generate 100 dialogs using 4 concurrent threads:

sloop generate --count 100 --concurrency 4

v0.2.0

Choose a tag to compare

@zhangdw156 zhangdw156 released this 02 Jan 03:31

πŸš€ Sloop v0.2.0: The "Intelligent Sampling" Update

Sloop v0.2.0 represents a major leap forward from random graph walks to intelligent, intent-driven dialogue generation. This release introduces a RAG-Enhanced Sampling Engine that combines the explicit structure of tool graphs with the semantic power of vector retrieval, orchestrated by an LLM-based decision agent.

✨ New Features

🧠 RAG-Enhanced Sampling (--mode rag)

The new hybrid sampling mode allows Sloop to find semantically related tools even when no direct edge exists in the graph.

  • Vector Retrieval: Powered by FAISS and LiteLLM, Sloop now indexes your tool definitions locally.
  • Semantic Associations: Capable of "hallucinating" logical next steps based on tool descriptions (e.g., associating "booking a flight" with "checking weather").
  • Persistent Caching: Vector indexes are cached in .cache/ for ultra-fast startup times.

πŸ‘¨β€βš–οΈ LLM Selector Agent

We have replaced random selection in RAG mode with a smart Selector Agent.

  • Context-Aware Decision: The agent analyzes the current conversation history and candidate tools to pick the most logical next action.
  • Smart Termination: The agent autonomously decides when a task is complete and returns FINISH.

🌍 Global Diversity Strategy

To prevent "Mode Collapse" (where the model repeatedly samples the same popular tools), we implemented a Global Coverage Sampling strategy. This forces the generator to explore the entire spectrum of available tools before repeating start nodes.

πŸ› οΈ Improvements & Refactoring

  • Standardized Configuration: Refactored config.py to explicitly separate Providers and Models.
    • New variables: LLM_PROVIDER, LLM_MODEL, EMBEDDING_PROVIDER, EMBEDDING_MODEL.
    • Backward Compatibility: Your existing .env files using MODEL_NAME will still work seamlessly.
  • New Dependencies: Added faiss-cpu and numpy for efficient vector operations.

πŸ“¦ How to Use

Generate synthetic data using the new intelligent mode:

# Standard RAG mode (Recommended for high-quality data)
sloop generate --mode rag --count 100

# Legacy random walk mode
sloop generate --mode graph --count 100

βš™οΈ Configuration Update

While not required (due to backward compatibility), we recommend updating your .env to utilize the new configuration structure, especially if using local embedding models:

# Chat Model Configuration
LLM_PROVIDER=openai
LLM_MODEL=gpt-4o-mini

# Embedding Configuration (New)
EMBEDDING_PROVIDER=openai
EMBEDDING_MODEL=text-embedding-3-small
# Or for local use:
# EMBEDDING_PROVIDER=ollama
# EMBEDDING_MODEL=nomic-embed-text

v0.1.2

Choose a tag to compare

@zhangdw156 zhangdw156 released this 01 Jan 16:04

Release v0.1.2: High-Quality Tool-Use Data Synthesis Framework πŸš€

We are thrilled to introduce Sloop, an advanced synthetic data generation framework designed to produce high-quality, reasoning-intensive tool-use datasets for training Large Language Models (LLMs).

Unlike traditional random generation methods, Sloop introduces a Graph-Based Intelligent Synthesis Strategy to ensure logical coherence and domain relevance in multi-turn dialogues.

🧠 Core Mechanism: Intelligent Tool Chain Generation

Sloop abandons completely random tool combinations in favor of a sophisticated graph-theoretic approach to generate realistic user tasks.

1. Automated Dependency Inference (Graph Construction) πŸ”—

Sloop automatically analyzes your tool definitions (OpenAI schema) to build a massive Tool Dependency Graph.

  • Logic: It infers dependencies by matching "upstream outputs" with "downstream inputs."
  • Mechanism: If the required parameter of Tool B (e.g., dish_id) appears in the description of Tool A (e.g., "returns a list of dishes with dish_id"), Sloop establishes a directed edge A -> B.
  • Result: This creates a structured map of how tools can naturally interact, ensuring that generated workflows are technically viable.

2. Domain-Sticky Sampling (Sticky Random Walk) 🧭

To generate multi-step tasks, Sloop employs a "Sticky Random Walk" algorithm on the dependency graph.

  • Domain Stickiness: The algorithm prefers staying within the same or related domains (e.g., Travel -> Hotel -> Payment) rather than making illogical jumps (e.g., Weather -> Stock Market).
  • Scoring System:
    • Strong Relation (1.0): Tools within the same category.
    • Weak Relation (0.7): Tools in logically related categories (e.g., Music & Audio).
    • No Relation (0.3): Unrelated domains.
  • Probabilistic Selection: The system selects the next tool based on these scores (80% probability for the best logical fit, 20% for diversity), simulating real-world user behavior that is purposeful yet occasionally non-linear.

3. PDA-Driven Execution πŸ€–

Once a logical tool chain is sampled, Sloop's Pushdown Automaton (PDA) engine orchestrates a multi-agent simulation (User, Assistant, Service) to generate the actual dialogue, complete with Chain-of-Thought (CoT) reasoning and stateful environment updates.


✨ Key Features

  • πŸ“¦ Training-Ready: Outputs data in a flat JSON format ready for SFT (Supervised Fine-Tuning) or RLHF.
  • 🧠 Stateful Simulation: Maintains a virtual environment state to prevent hallucinations and ensure data consistency.
  • ⚑ Scalable: Capable of handling thousands of tool definitions efficiently.

Build the next generation of reasoning-capable Agent models with Sloop.

v0.1.1

Choose a tag to compare

@zhangdw156 zhangdw156 released this 01 Jan 13:17

Release v0.1.1

This is a minor release that includes several improvements and bug fixes.

Features

  • Added gorilla BFCL recipes and configurations
  • Integrated loguru for enhanced logging capabilities
  • Removed mock LLM implementation in favor of real integrations

Fixes

  • Updated logger configuration for better console output compatibility with tqdm
  • Resolved 7 code quality issues identified by ruff linting

Maintenance

  • Applied ruff formatting and linting across the codebase
  • Improved overall code quality and consistency

Installation

pip install sloop==0.1.1

For more information, please visit the project repository.