Using Cloud Native Solutions with Phi-3, including .NET Aspire, Semantic Kernel and RAG
cd src/04.CloudNativeRAG/Phi3DotNETAspire/Phi3.Aspire.AppHost
dotnet build
Ensure you are in the .../src/04.CloudNativeRAG/Phi3DotNETAspire/Phi3.Aspire.AppHost folder (You can copy the files manually or use the following command)
Ensure you are in the 'src' folder
cp ./04.CloudNativeRAG/libs/onnxruntime-genai/build/Linux/RelWithDebInfo/libonnxruntime-genai.so ./04.CloudNativeRAG/Phi3DotNETAspire/Phi3.Aspire.ModelService/bin/Debug/net8.0/runtimes/linux-x64/native/
cp ./04.CloudNativeRAG/libs/onnxruntime-genai/build/Linux/RelWithDebInfo/libonnxruntime.so ./04.CloudNativeRAG/Phi3DotNETAspire/Phi3.Aspire.ModelService/bin/Debug/net8.0/runtimes/linux-x64/native/
export ASPIRE_ALLOW_UNSECURED_TRANSPORT=true
dotnet run --launch-profile http
Click the Follow Link in the terminal to open the .NET Aspire Portal using the localhost link:
Eample of the follow link in the info section of the output in your terminal
Login to the dashboard at http://localhost:15147/login?t=65d752d2a8345d9f3t5656ef78e4777
You will be prompted to enter a login token this can be found in your terminal output.
Example will be as follows
Login to the dashboard at http://localhost:15147/login?t=65d752d2a8345d9f3t5656ef78e4777
In this case the login code is
65d752d2a8345d9f3f10680ef78e4777
Setting Up Vue Portal in Codespaces Open up the brower windows and you will see the .NET Aspire Portal with a list of services and ports, select the vue services. You will see Endpoint as per the example below http://localhost:42811, copy port number 42811
You know need to configure your GitHub Codespaces ports. To set up port forwarding for http://localhost:42811 in GitHub Codespaces, follow these steps:
Access the PORTS tab:
- If you’re using Visual Studio Code, click on the PORTS tab in the bottom panel.
- If you’re using the browser, you can find the PORTS tab in terminal window.
Add the port:
You can manually forward a port that wasn't forwarded automatically.
- Open the terminal in your codespace.
- Click the PORTS tab.
Under the list of ports, click Add port.
- Click on Add port.
- Enter 42811 as the port number and press Enter.
Access the forwarded port:
Once the port is forwarded, you can access it via a URL provided by GitHub Codespaces. This URL will be displayed in the PORTS tab and can be clicked to open in your browser.
Change port protocol:
If you need to use HTTPS instead of HTTP, right-click the port in the PORTS tab, hover over Change Port Protocol, and select HTTPS. For more detailed information, you can refer to the GitHub Docs on forwarding ports in Codespaces
Start Chatting: