Skip to content

Refactor the server host application in its own assembly - #197

Merged
zhongkaifu merged 3 commits into
zhongkaifu:mainfrom
vvdb-architecture:RefactorServerHost
Sep 6, 2026
Merged

Refactor the server host application in its own assembly#197
zhongkaifu merged 3 commits into
zhongkaifu:mainfrom
vvdb-architecture:RefactorServerHost

Conversation

@vvdb-architecture

@vvdb-architecture vvdb-architecture commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This PR is the spiritual continuation of #196.

  • It factors out the host application out of TensorSharp.Server and puts it into a new assembly TensorSharp.Server.Host.
  • It makes a number of types in TensorSharp.Server public so that these types can be referenced both in TensorSharp.Server.Host and in existing hosts which wants to integrate TensorSharp.

All tests run, and TensorSharp.Server.Host runs as well.

The documentation has been updated: references to running TensorSharp.Server were changed appropriately into TensorSharp.Server.Host. Please note that the documentation in Chinese was updated as well, but I don't speak the language: I just changed the references to TensorSharp.Server. I've been careful, but perhaps this should be reviewed carefully.

Future PRs may decide to expose more types in the TensorSharp.Server assembly for additional flexibility, but at this point in time it's too soon to tell.

Postscriptum: for folks like me who like to work in Visual Studio and press F5 in Debug mode to find out how things work, it's interesting to add a launchsettings.json containing the following:

{
  "profiles": {
    "TensorSharp.Server.Host": {
      "commandName": "Project",
      "commandLineArgs": "--model F:\\models\\gemma-4-E4B-it-Q8_0.gguf --backend cuda",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:5000"
    }
  }
}

...where commandLineArgs is obviously tailored to your needs. This will allow you to single step through the code and learn a bit better how everything fits together.

Perhaps this could be written down somewhere in a README.md file somewhere.

@zhongkaifu
zhongkaifu merged commit bb7b6d3 into zhongkaifu:main Sep 6, 2026
1 of 2 checks passed
@zhongkaifu

Copy link
Copy Markdown
Owner

@vvdb-architecture Thank you so much for these refactoring. It looks more organizated now. This changed has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants