Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Filter by Categories
About Article
Analyze Data
Archive
Best Practices
Better Outputs
Blog
Code Optimization
Code Quality
Command Line
Course
Daily tips
Dashboard
Data Analysis & Manipulation
Data Engineer
Data Visualization
DataFrame
Delta Lake
DevOps
DuckDB
Environment Management
Feature Engineer
Git
Jupyter Notebook
LLM
LLM Tools
Machine Learning
Machine Learning & AI
Machine Learning Tools
Manage Data
MLOps
Natural Language Processing
Newsletter Archive
NumPy
Pandas
Polars
PySpark
Python Helpers
Python Tips
Python Utilities
Scrape Data
SQL
Testing
Time Series
Tools
Visualization
Visualization & Reporting
Workflow & Automation
Workflow Automation

Newsletter #249: prek: Faster, Leaner Pre-Commit Hooks (Rust-Powered)

Newsletter #249: prek: Faster, Leaner Pre-Commit Hooks (Rust-Powered)


๐Ÿ“… Today’s Picks

LangChain v1.0: Automate Tool Selection for Faster Agents

Code example: LangChain v1.0: Automate Tool Selection for Faster Agents

Problem

Agents with many tools waste tokens by sending all tool descriptions with every request.

This wastes tokens on irrelevant tool descriptions, making responses slower and more expensive.

Solution

LangChain v1.0 introduces LLMToolSelectorMiddleware that pre-filters relevant tools using a smaller model.

Key features:

  • Pre-filter tools using cheaper models like GPT-4o-mini
  • Limit tools sent to main agent (e.g., 3 most relevant)
  • Preserve critical tools with always_include parameter

prek: Faster, Leaner Pre-Commit Hooks (Rust-Powered)

Code example: prek: Faster, Leaner Pre-Commit Hooks (Rust-Powered)

Problem

pre-commit is a framework for managing Git hooks that automatically run code quality checks before commits.

However, installing these hook environments (linters, formatters, etc.) can be slow and disk-intensive, especially in CI/CD pipelines where speed matters.

Solution

prek is a drop-in replacement for pre-commit that installs hook environments significantly faster while using 50% less disk space.

Built with Rust for maximum performance, prek reduces cache storage from 1.6GB to 810MB (benchmarked on Apache Airflow repository) without changing your workflow.

Key benefits:

  • Uses your existing .pre-commit-config.yaml files
  • Commands mirror pre-commit syntax (prek install-hooks, prek run)
  • Monorepo support with selector syntax for targeting specific projects or hooks
  • Install as a single binary with no dependencies

No configuration changes needed – just replace the command.


โ˜•๏ธ Weekly Finds

deepagents [LLM] – Build advanced AI agents with context isolation through sub-agent delegation. Features virtual file system for context offloading, specialized sub-agents with focused tool sets, and sophisticated agent architecture for real-world research and analysis tasks.

mcp-gateway [MLOps] – Docker MCP CLI plugin / MCP Gateway for production-grade AI agent stack. Enables multi-agent orchestration, intelligent interceptors, and enterprise security with Docker integration.

nbQA [Python Utils] – Run ruff, isort, pyupgrade, mypy, pylint, flake8, and more on Jupyter Notebooks. Command-line tool to run linters and formatters over Python code in Jupyter notebooks.

Looking for a specific tool? Explore 70+ Python tools โ†’

Stay Current with CodeCut

Actionable Python tips, curated for busy data pros. Skim in under 2 minutes, three times a week.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran