Goal: Build an advanced RAG sample showing how LMP (Language Model Programs) and MEDI (Microsoft.Extensions.DataIngestion) coexist and natively layer. MEDI handles pipeline infrastructure (ingestion, vector search, RRF, tree traversal). LMP handles the intelligence layer (optimizable typed predictors for every LLM call). LMP optimizers tune the whole thing end-to-end.
Domain: Survival/equipment documentation (matching the advanced-rag sample).
PRD + Tech Spec — .NET NuGet “Model Fetch + Cache” System (HuggingFace default, configurable source, optional MSBuild prefetch)
We ship a .NET NuGet package that uses an AI model. The model can be large (100MB–multiple GB). Putting the model inside the NuGet package is a bad fit (slow restore, duplicated storage per version, plan quotas, painful CI).
We need a robust, boring, predictable way to:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #:package [email protected] | |
| using Microsoft.Extensions.AI; | |
| using OpenAI; | |
| var key = Environment.GetEnvironmentVariable("OPENAI_KEY"); | |
| IChatClient chatClient = | |
| new OpenAIClient(key) | |
| .GetChatClient("gpt-4o-mini") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #r "nuget:Microsoft.ML" | |
| #r "nuget:Microsoft.ML.Vision" | |
| #r "nuget:Microsoft.ML.ImageAnalytics" | |
| #r "nuget:SciSharp.TensorFlow.Redist" | |
| open System | |
| open System.IO | |
| open Microsoft.ML | |
| open Microsoft.ML.Data | |
| open Microsoft.ML.Vision |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt update && sudo apt install git dkms | |
| cd Downloads | |
| git clone -b extended --single-branch https://github.com/lwfinger/rtlwifi_new.git | |
| unofficial | |
| cd rtlwifi_new | |
| make | |
| sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Try this | |
| type Folder = { | |
| Name:string | |
| Size:int64 | |
| NumFiles:int64 | |
| AvgSize:float | |
| DistinctExt:string list | |
| } | |
| open System.IO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| write a program that outputs the largest unique set of characters that can be removed | |
| from this paragraph without letting its length drop below 50. | |
| For example: [‘H’, ‘i’, ‘!’, ‘ ’] | |
| */ | |
| //Exception based on paragraph length | |
| function ParagraphLengthException(message){ | |
| this.name = "ParagraphLengthException" | |
| this.message = message; |
NewerOlder