# 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.

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.

Website: https://github.com/kujirahand/book-local-llm-sample
