Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library

Hacker News (score: 24)
Found: November 23, 2025
ID: 2475

Description

Other
Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library

More from Hacker

Show HN: DNS Benchmark Tool – Compare and monitor resolvers

Show HN: DNS Benchmark Tool – Compare and monitor resolvers I built a CLI to benchmark DNS resolvers after discovering DNS was adding 300ms to my API requests.<p>v0.3.0 just released with new features: compare: Test single domain across all resolvers top: Rank resolvers by latency&#x2F;reliability&#x2F;balanced monitor: Continuous tracking with threshold alerts<p>1,400+ downloads in first week.<p>Quick start: pip install dns-benchmark-tool dns-benchmark compare --domain google.com<p>CLI stays free forever. Hosted version (multi-region, historical tracking, alerts) coming Q1 2026.<p>GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;frankovo&#x2F;dns-benchmark-tool" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;frankovo&#x2F;dns-benchmark-tool</a> Feedback: <a href="https:&#x2F;&#x2F;forms.gle&#x2F;BJBiyBFvRJHskyR57" rel="nofollow">https:&#x2F;&#x2F;forms.gle&#x2F;BJBiyBFvRJHskyR57</a><p>Built with Python + dnspython. Open to questions and feedback!

Show HN: Optimizing LiteLLM with Rust – When Expectations Meet Reality

Show HN: Optimizing LiteLLM with Rust – When Expectations Meet Reality I&#x27;ve been working on Fast LiteLLM - a Rust acceleration layer for the popular LiteLLM library - and I had some interesting learnings that might resonate with other developers trying to squeeze performance out of existing systems.<p>My assumption was that LiteLLM, being a Python library, would have plenty of low-hanging fruit for optimization. I set out to create a Rust layer using PyO3 to accelerate the performance-critical parts: token counting, routing, rate limiting, and connection pooling.<p>The Approach<p>- Built Rust implementations for token counting using tiktoken-rs<p>- Added lock-free data structures with DashMap for concurrent operations<p>- Implemented async-friendly rate limiting<p>- Created monkeypatch shims to replace Python functions transparently<p>- Added comprehensive feature flags for safe, gradual rollouts<p>- Developed performance monitoring to track improvements in real-time<p>After building out all the Rust acceleration, I ran my comprehensive benchmark comparing baseline LiteLLM vs. the shimmed version:<p>Function Baseline Time Shimmed Time Speedup Improvement Status<p>token_counter 0.000035s 0.000036s 0.99x -0.6%<p>count_tokens_batch 0.000001s 0.000001s 1.10x +9.1%<p>router 0.001309s 0.001299s 1.01x +0.7%<p>rate_limiter 0.000000s 0.000000s 1.85x +45.9%<p>connection_pool 0.000000s 0.000000s 1.63x +38.7%<p>Turns out LiteLLM is already quite well-optimized! The core token counting was essentially unchanged (0.6% slower, likely within measurement noise), and the most significant gains came from the more complex operations like rate limiting and connection pooling where Rust&#x27;s concurrent primitives made a real difference.<p>Key Takeaways<p>1. Don&#x27;t assume existing libraries are under-optimized - The maintainers likely know their domain well 2. Focus on algorithmic improvements over reimplementation - Sometimes a better approach beats a faster language 3. Micro-benchmarks can be misleading - Real-world performance impact varies significantly 4. The most gains often come from the complex parts, not the simple operations 5. Even &quot;modest&quot; improvements can matter at scale - 45% improvements in rate limiting are meaningful for high-throughput applications<p>While the core token counting saw minimal improvement, the rate limiting and connection pooling gains still provide value for high-volume use cases. The infrastructure I built (feature flags, performance monitoring, safe fallbacks) creates a solid foundation for future optimizations.<p>The project continues as Fast LiteLLM on GitHub for anyone interested in the Rust-Python integration patterns, even if the performance gains were humbling.<p>Edit: To clarify - the negative performance for token_counter is likely in the noise range of measurement, suggesting that LiteLLM&#x27;s token counting is already well-optimized. The 45%+ gains in rate limiting and connection pooling still provide value for high-throughput applications.

Preventing Kubernetes from Pulling the Pause Image from the Internet

Preventing Kubernetes from Pulling the Pause Image from the Internet

Show HN: MyTimers.app offline-first PWA with no build step and zero dependencies

Show HN: MyTimers.app offline-first PWA with no build step and zero dependencies Hello,<p>For quite some time, I&#x27;ve been unsatisfied with the built-in timers on both Android and iOS; especially for workouts, when I needed to set up a configurable number of series with rest periods in between. That&#x27;s when I started thinking about building something myself. It was just a timer and I said to myself &quot;how hard could it be?&quot;, I had no idea.<p>The first iteration of the project worked &quot;just fine&quot;, but the UI was an eyesore (even more than it is now), and the UX was quite awful as well. As you can probably guess, I&#x27;m not versed in design or front-end development. In fact, my last real experience with front-end work was back when jQuery was still a thing.<p>However, I knew what I wanted to build, and over the last few days (and with the help of the infamous AI) I was able to wrap up the project for my needs. It required quite a lot of &quot;hand holding&quot; and &quot;back and forth&quot;, but it helped me smooth out the rough edges and provided great suggestions about the latest ES6 features.<p>The project is, as the title states, an offline-first PWA with zero dependencies; no build step, no cookies, no links, no analytics, nothing other than timers. It uses `Web Components` (a really nice feature, in my opinion, though I still don&#x27;t get why we can&#x27;t easily inherit styles from the global scope) and `localStorage` to save timers between uses.<p>I&#x27;d appreciate any comments or suggestions, since I just want to keep learning new things.<p><a href="https:&#x2F;&#x2F;mytimers.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mytimers.app&#x2F;</a>

No other tools from this source yet.