A language model generates content from text prompts. Large language models (LLMs) can produce prose, code, mathematical expressions, and structured data. Transformer-based models use self-attention to process text sequences; decoder-only GPT models are used for generation. section 1.7
A generalist LLM is a useful starting point when a task does not require specialized knowledge. For a narrow domain, a pretrained model can be adapted with domain-specific data through transfer learning. That choice depends on data quality, accuracy needs, computing resources, privacy, and regulatory requirements. section 1.6 section 1.7
Table 1.2 Pros and cons of generalist and domain-specific LLMs
| Generalist LLMs |
Domain-specific LLMs |
|
| Pros |
|
|
| Cons |
|
|
Compare generalist breadth with domain-specific accuracy and context, alongside each approach’s limitations. section 1.6
Deployment requires more than selecting a capable model. Parameter count and numerical precision affect GPU memory needs; serving multiple requests adds cost and performance constraints. Benchmark inference rather than assuming that a smaller representation will be faster on every setup. section 4.2 section 11.2.1
Choosing a model to serve
GPT-Neo 2.7B provides a reference for estimating inference resources. A separate GPT-2 small workflow benchmarks PyTorch, ONNX, optimized ONNX, and FP16 variants before choosing a candidate for FastAPI serving. In its reported CPU measurements, the FP16 variant is slower than the other variants. section 4.1 section 11.2.1




































































