Urgent.News

What's breaking now, across hundreds of outlets.

Tech

When you replace a library, you also take over everything it did

DPOLens is an open-source MCP server that gives AI assistants the text of privacy law. Its search runs on the CPU, so it needs no GPU. The usual way to run an embedding model in Python is sentence-transformers . DPOLens doesn't use it: with PyTorch's CPU build it installs about 1 GB, against about 200 MB for ONNX Runtime , the tokenizers library and NumPy. So DPOLens calls the model through ONNX…

The DPOLens open-source MCP server provides AI assistants with the text of privacy laws. It runs on the CPU, requiring no GPU, and uses ONNX Runtime for embedding models, which installs about 1 GB compared to 200 MB for other libraries. When a library instance starts, it embeds every clause of the law, consuming significant resources.

A loading test showed this to be the heaviest task done by DPOLens. After implementing two fixes, the process became 5.1 times faster with 65% less memory, and the vectors remained consistent. The setup uses multilingual-e5-small embedding model, which embeds GDPR, the UAE's data protection law, and a sample company policy containing 1,350 clauses of various lengths.

Postgres with pgvector stores these vectors, and this happens once before the instance answers any queries. The library sorted clauses by length before batching them, leading to inefficient memory usage. The optimized code embedded clauses in the order they were stored, resulting in 114,000 tokens instead of 304,000. The memory budget was also capped, preventing excessive memory usage.

With a 2.5 CPU limit, the optimized setup took significantly less time and memory compared to the original version. The changes did not affect the vector results or search performance, as the vectors remained bit-identical or differed by a negligible amount.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at dev.to →

Report a problem with this story

More in Tech

Bitwarden vs 1Password vs Proton Pass: Which Is Best?

Your password manager is the most important security tool you use daily. Pick the wrong one, and you're either compromising security (weak encryption) or compromising convenience (so annoying to use…

  • Bitwarden is open-source with transparent codebase and self-hosted option
  • 1Password prioritizes user-friendliness with auto-fill and security features
  • Proton Pass integrates with Proton ecosystem for privacy-focused users

Self-Hosting a VPN with WireGuard: Notes from Building My Own System

Self-Hosting a VPN with WireGuard: Notes from Building My Own System Commercial VPNs ask you to trust them. A self-hosted VPN asks you to trust yourself — your server, your keys, your logs (or absence…

  • Self-hosting VPN with WireGuard provides control and trust over server, keys, and logs.
  • Android client shows VPN connection status, ensuring transparency.
  • Go backend and React web admin panel manage user accounts and server health.

How to Build an MVP App: Core Features vs Full Build

When figuring out how to build an MVP app, the most important step is defining the smallest version of your product that you can launch to solve a real user problem.

  • Focus on core user problem, exclude secondary features
  • Ship product quickly to validate market assumptions
  • Deliberate shortcuts reduce technical debt and costs

More from Saturday 21 November →