Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions EssentialCSharp.Web.Hosting/WebHostingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ public static IResourceBuilder<DotnetProjectResource> WithEssentialCSharpLocalAI

string? endpoint = builder.Configuration["AIOptions:Endpoint"];
bool azureConfigured = !string.IsNullOrWhiteSpace(endpoint);
// Graph selection is startup configuration, not a dashboard parameter. Keep existing saved
// disables working so upgrading does not unexpectedly download a local model.
// Graph selection is startup configuration, not a dashboard parameter. Local AI is opt-in because
// it downloads a multi-gigabyte model; a legacy saved Parameters:UseLocalAI value is still honored.
bool useLocalAI = !azureConfigured
&& (builder.Configuration.GetValue<bool?>("AIOptions:UseLocalAI")
?? builder.Configuration.GetValue<bool?>("Parameters:UseLocalAI")
?? true);
?? false);

if (azureConfigured)
{
Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,28 @@ Use the allocated Web HTTP endpoint reported by Aspire, not a hard-coded localho
`--isolated` keeps worktree container identities separate. SQL Server, pgvector PostgreSQL,
and optional Ollama use persistent data volumes; restart with the same command to retain data.
The AppHost has its own `UserSecretsId`, separate from ordinary Web application secrets.
SQL Server passwords are generated by Aspire unless an AppHost `Parameters:sqlserver-password`
secret is supplied. Stop only this AppHost using `aspire stop --apphost` with the same project path.
Database passwords are generated by Aspire and kept in the AppHost's user secrets. Because the data
volumes outlive those secrets, set fixed passwords once if you want them to survive a secrets reset:

```powershell
dotnet user-secrets set "Parameters:sqlserver-password" "<password>" --project dev\EssentialCSharp.Web.AppHost
dotnet user-secrets set "Parameters:postgres-password" "<password>" --project dev\EssentialCSharp.Web.AppHost
```

If the secrets are lost and a database rejects its login, remove that container's data volume
(or restore the same password) and restart. Stop only this AppHost using `aspire stop --apphost`
with the same project path.
Add `--format mermaid` to `aspire describe` to print the resource dependency graph as a Mermaid diagram.

The Web resource uses Aspire's Project v2 model (`AddDotnetProject`), which the AppHost builds
before launch. Aspire watch [is not yet implemented for Project v2 resources](https://aspire.dev/integrations/dotnet/migrate-dotnet-project-resource/#check-workflows-before-migrating);
after changing Web code, rebuild just that resource with `aspire resource essentialcsharp-web rebuild --apphost <path>`.

Local AI defaults to Ollama (`qwen2.5-coder:7b`, approximately 5 GB download); local vector search
is not enabled. Disable model downloads before starting when chat is unnecessary:
Local AI is off by default because it downloads a model. Enable Ollama (`qwen2.5-coder:7b`,
approximately 5 GB) before starting when you need local chat; local vector search is not enabled:

```powershell
dotnet user-secrets set "AIOptions:UseLocalAI" "false" --project dev\EssentialCSharp.Web.AppHost
dotnet user-secrets set "AIOptions:UseLocalAI" "true" --project dev\EssentialCSharp.Web.AppHost
```

This is startup configuration: restart the AppHost after changing it. It is not a dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ public async Task WithEssentialCSharpLocalAI_AzureEndpointConfigured_TakesPreced
[Arguments(new[] { "--AIOptions:UseLocalAI=false" }, false)]
[Arguments(new[] { "--Parameters:UseLocalAI=false" }, false)]
[Arguments(new[] { "--AIOptions:UseLocalAI=false", "--Parameters:UseLocalAI=true" }, false)]
[Arguments(new string[0], true)]
[Arguments(new[] { "--AIOptions:UseLocalAI=true" }, true)]
[Arguments(new[] { "--Parameters:UseLocalAI=true" }, true)]
[Arguments(new string[0], false)]
public async Task WithEssentialCSharpLocalAI_StartupConfiguration_ControlsOllamaWithoutDashboardParameter(
string[] args, bool expectOllama)
{
Expand Down
Loading