What Can You Do After Deploying a Local LLM
This article explains how to turn a locally deployed large language model into real business value by connecting it to existing workflows. It covers the core benefits of local deployment, a four-layer architecture, environment setup and model selection, orchestration layer configuration, spreadsheet-side scripting with VBA, structured output and validation, performance and security practices, and a final acceptance checklist. Readers will learn how to build a private assistant that keeps data inside the intranet, runs offline, and offers predictable per-call costs.
1. Background: Where the Real Value Appears After Local Deployment
Downloading model weights to a local machine and running the model with an inference runtime only completes the “it can infer” step. Real business value comes from connecting the model to existing workflows. Local deployment delivers three core benefits: first, data never leaves the intranet, so sensitive contracts, financial spreadsheets, and customer lists can safely be included in prompts; second, it can run offline, remaining usable in weak-network or isolated environments; third, the cost per call is predictable and unaffected by external API billing and rate-limit fluctuations.
Common deployment scenarios include document and knowledge base Q&A, structured information extraction, spreadsheet formula and script generation, log and alert summarization, code assistance, and meeting note organization. Among these, “spreadsheets + local model” is one of the highest return-on-investment directions, because a large amount of business data is already stored in spreadsheets and users do not need to learn a new interface.
2. Overall Architecture: Four Layers Determine Success
A robust private assistant typically consists of four layers, decoupled from each other for easy replacement and troubleshooting:
- Model layer: open-source commercially usable weights, with parameter size and quantization precision chosen based on VRAM and memory capacity.
- Inference runtime layer: responsible for model loading, context management, and concurrency scheduling, exposing an HTTP interface compatible with common standards.
- Orchestration and knowledge layer: provides session management, prompt templates, and retrieval augmentation (vector store + document chunking), turning a “general model” into one that “understands your business.”
- Interaction layer: spreadsheets, command line, internal web pages, and so on, which send requests via scripts and render results.
The key point is that the interaction layer should not connect directly to the inference runtime, but should go through the orchestration layer. This way, authentication, auditing, rate limiting, and retrieval augmentation can be implemented centrally, avoiding reinventing the wheel in every client.
3. Environment Setup and Model Selection
Preparation checklist: a workstation with a dedicated GPU or large memory; an inference runtime; an orchestration middleware; spreadsheet software with macro support enabled.
Selection experience: parameter size determines the quality floor, and quantization determines VRAM usage. An 8B-class model can run smoothly with medium quantization on 8GB of VRAM, suitable for extraction, rewriting, and classification; 14B to 32B levels are better for complex reasoning and long-form writing, but require more VRAM or memory as a fallback. Longer context is not always better; long context significantly increases VRAM usage and time-to-first-token, so it is recommended to trim it according to the task.
4. Orchestration Layer Configuration
In the orchestration middleware, three things need to be done: bind the inference runtime address, specify the default model, and create a callable workspace and generate an access key. It is recommended to use lowercase English and hyphens for the workspace name to avoid encoding issues when concatenating URLs. The key should only be stored on the server side or in locally controlled configuration, and should not be hard-coded into distributed documents.
5. Spreadsheet-Side Script Orchestration (Example)
Press Alt + F11 to enter the script editor, insert a module, and implement “read cell — send request — write back result.” Example code:
Sub AskLocalModel()Dim q As String, body As String, res As StringDim http As Object, url As String, token As Stringq = ThisWorkbook.Sheets(1).Range("A2").ValueIf Len(Trim(q)) = 0 Then Exit Suburl = "http://localhost:3001/api/v1/workspace/demo/stream-chat"token = "locally generated access key"Set http = CreateObject("MSXML2.XMLHTTP")http.Open "POST", url, Falsehttp.setRequestHeader "Content-Type", "application/json"http.setRequestHeader "Authorization", "Bearer " & tokenbody = "{""message"":""" & Replace(q, """", """""") & """,""mode"":""chat""}"http.send bodyIf http.Status = 200 Thenres = http.responseTextThisWorkbook.Sheets(1).Range("A4").Value = ExtractText(res)ElseMsgBox "Call failed: " & http.Status & " " & http.responseTextEnd IfEnd Sub
Engineering details must be noted: double quotes and line breaks in prompts must be escaped, otherwise the JSON is invalid; synchronous requests freeze the interface, so batch tasks should be changed to asynchronous with a status column showing progress; if streaming responses are enabled, the response body is multi-segment text in “event: data” format, which needs to be split by line, filtered for prefixes, and then concatenated, writing the reasoning process and the final answer into different columns.
6. Structured Output and Result Validation
To make results directly usable in spreadsheets, the prompt should specify JSON output with clear field names and enum values. On the parsing side, do not rely on string slicing; use regular expressions or a JSON parser to extract values layer by layer; for model hallucinations and format drift, adding a second call that “only performs format validation and correction” can significantly improve usability. It is recommended to keep a raw response column for traceability.
7. Performance, Concurrency, and Security
Performance: keep the model resident to avoid repeated loading; batch requests; control maximum output length; cache results for high-frequency questions.
Security: the interface should only listen on the loopback address; cross-machine access should go over the intranet with key authentication enabled; divide workspaces by least privilege; audit and log prompts and responses; desensitize sensitive information in uploaded documents. If elasticity is needed, the inference runtime can be containerized and combined with a container platform, monitoring and alerting, and logging services to achieve scaling and issue localization; static resources and knowledge base files can be placed in object storage for unified backup.
8. Acceptance Checklist
Can a Q&A be completed in an offline environment; is text escaping in cells safe; are streaming responses parsed correctly; has the key been moved out of the document; do batch tasks have progress and failure retry. After passing each item, this private assistant can stably support daily office and data processing scenarios.
