ValarMorghulis.IO
open-menu closeme
Home
Tech
View
twitter github rss
  • Python dependencies states managed via uv(illustrated)

    calendar Nov 10, 2025 · 1 min read · python uv  ·
    Share on: twitter facebook linkedin copy

    Several dependency management file types are available in the Python ecosystem—requirements.txt, uv.lock, pyproject.toml, etc. With uv, we can handle most of them. Here is a transition graph showing how to move from one state to another using uv commands. Note: "libs in env" refers to installed dependencies in a …


    Read More
  • Deploy models on SGLang with CPU only

    calendar Aug 3, 2025 · 1 min read · ai docker  ·
    Share on: twitter facebook linkedin copy

    If you just want to serve an LLM model with WSL2 on your old laptop, this is for you. The official document have introduced how to build and run SGLang in CPU with docker. But there several issues with the image built based on the tutorial: SGLang deps on VLLM, which is not installed SGLang code requires NUMA to run So …


    Read More
  • Run MiniCPM4 with CPU only

    calendar Jun 8, 2025 · 1 min read · ai  ·
    Share on: twitter facebook linkedin copy

    This is a guide for serving the MiniCPM4 0.5b model with CPU only(in my laptop WSL Ubuntu 24.04). The model is served by llama.cpp, and I break down it for several steps. Download the model from hf 1huggingface-cli download openbmb/MiniCPM4-0.5B Install(and compile) the llama.cpp 1# build llama.cpp 2git clone …


    Read More
  • Call MCP Server(stdio) directly in the shell

    calendar May 19, 2025 · 3 min read · MCP ai python  ·
    Share on: twitter facebook linkedin copy

    stdio is one of the transport mechanisms MCP(Model Context Protocol) natively supports. Actually stdio is the only transport mechanism Claude Desktop supports currently(as in May, 2025). This article will show you how to call a MCP server in the shell, without mcp dev or any third party tools, only with echo > or …


    Read More
  • Measuring the CPU and Memory Usage for Python subprocess

    calendar May 14, 2025 · 2 min read · python  ·
    Share on: twitter facebook linkedin copy

    The article talks about a method for measuring the resources used by a process invoked by subprocess.run or subprocess.Popen. We can use psutil to get realtime usage data of a process. Using psutil may not provide accurate resource measurements for short-lived processes, as it samples usage at intervals and can miss …


    Read More
  • tac -- the ignored reverse of cat

    calendar Mar 18, 2025 · 1 min read · bash  ·
    Share on: twitter facebook linkedin copy

    When grep a very large log file to find the last occurrence of some string, it is much than efficient to back iterate the files from the last line than methods using tail or tail -n. And I just found tac from coreutils, best suiting the job. tac is the reverse of cat, the job I mentioned above can be done via: 1tac …


    Read More
  • Python version of Rust Result Sum Type

    calendar Jan 19, 2025 · 1 min read · python sum type rust  ·
    Share on: twitter facebook linkedin copy

    I try to implement a Python version of the Result<T, E> sum type in rust which can be used with match/case pattern matching. The pattern matching with sub-patterns like case Err(e) could be implemented in Python with the match_args dunder attribute. This is how Result[T, E], OK() and Err() defined: 1import typing 2 …


    Read More
  • Run wasm built with wasm-pack with pythonmonkey

    calendar Jan 3, 2025 · 2 min read · python wasm rust  ·
    Share on: twitter facebook linkedin copy

    I have been trying to run wasm code built with wasm-pack with pythonmonkey, a Mozilla SpiderMonkey JavaScript engine embedded into the Python Runtime. Consider a lib.rs as follow: 1use wasm_bindgen::prelude::*; 2 3#[wasm_bindgen] 4pub fn add(a: i32, b: i32) -> i32 { 5 return a + b; 6} With wasm-pack, we can build the …


    Read More
  • Combine mesop with natural abilities of flask

    calendar Dec 23, 2024 · 2 min read · python flask mesop  ·
    Share on: twitter facebook linkedin copy

    mesop is popular with AI apps, since is can be used to build web apps with Python without frontend works. mesop is developed upon the popular frontend framework flask. How about combine the natural abilities of flask while developing with mesop? Let do a little research. Access flask request instance(including headers, …


    Read More
  • Create a partial model definition of a pydantic model

    calendar Dec 9, 2024 · 1 min read · python pydantic  ·
    Share on: twitter facebook linkedin copy

    Sometimes I want to create a partial model definition of a pydantic model. For example, if I want to expose a database model from API, some of the fields I would like to keep in secret, or I just want to expose very few fields in a summary API. I don't want to write model definition twice. I would like to write …


    Read More
    • ««
    • «
    • 1
    • 2
    • 3
    • »
    • »»

valarmorghulis.io

Programming / Thinking / Writing / Reading

Recent Posts

  • Python dependencies states managed via uv(illustrated)
  • Deploy models on SGLang with CPU only
  • Run MiniCPM4 with CPU only
  • Call MCP Server(stdio) directly in the shell
  • Measuring the CPU and Memory Usage for Python subprocess
  • tac -- the ignored reverse of cat
  • Python version of Rust Result Sum Type
  • Run wasm built with wasm-pack with pythonmonkey

Categories

SOFTWARE ENGINEERING 1 SOFTWARE INDUSTRY 1 TECHNIQUE 1

Tags

PYTHON 13 AI 3 DOCKER 2 RUST 2 ASYNCIO 1 AWS 1 BASH 1 BOT 1 CLIPBOARD 1 EXCEL 1 FLASK 1 HTTP 1 MARAIDB 1 MCP 1
All Tags
AI3 ASYNCIO1 AWS1 BASH1 BOT1 CLIPBOARD1 DOCKER2 EXCEL1 FLASK1 HTTP1 MARAIDB1 MCP1 MESOP1 MONGODB1 MSYQL1 MYSQL1 NEXTJS1 PM21 POSTGRES1 POWERSHELL1 PYDANTIC1 PYTHON13 ROBOTS.TXT1 RUST2 SSL1 SUM TYPE1 UV1 WASM1 WSL1
[A~Z][0~9]
valarmorghulis.io

Copyright 2016- 2025 VALARMORGHULIS.IO . All Rights Reserved

to-top