Back to directory

Training and Using Local LLMs with Python (Book Samples)

The complete sample code for a Japanese book on training and using local LLMs in Python, covering embedding a local model in an app, building a transformer from scratch, fine-tuning, multimodal generation and RAG.

Training and Using Local LLMs with Python (Book Samples)

This repository holds the full set of sample programs for a Japanese book on training and working with local LLMs in Python. Its second chapter covers using the Ollama API and building a GUI greeting-text generator, a text-summarizing web app and a WebSocket chat tool around a local model; its third chapter builds chatbots from scratch, from rule-based and n-gram or Markov-chain approaches through LSTM and Transformer text-generation models.

Later chapters cover fine-tuning a model to answer in a classical literary style or with added anime knowledge and converting a custom model for use in Ollama, multimodal image and video generation and automatic image classification, and finally an MCP host and client sample, a RAG-based question-answering system, a RAG-based diagram generator, and a tool for benchmarking local LLMs on the JGLUE benchmark.

More in Tutorials

See all 478
  • BootLife

    github.com

    Conway's Game of Life implemented to run directly from a 512-byte x86 boot sector in assembly, using VGA memory itself as the simulation grid.

  • A technical blog post deriving the Y combinator as a composition of combinator birds in an array language, and examining how eager evaluation changes fixed-point recursion compared with the usual lazy telling.

  • System Design Atlas

    atlas-sysdes.vercel.app

    A free reference of worked system design problems with interactive architecture diagrams, covering ranked designs such as a feed, a chat app, a URL shortener, and a rate limiter, plus pages on the technologies behind them.