Skip to content

Conversation

@erhant
Copy link
Member

@erhant erhant commented Oct 21, 2025

  • Added a shard/attrib.py to shard to share types of attributes / methods among mixins, fixing around 196 type errors under shard folder.
  • Moved some shard/startup.py methods to shard/node.py, and moved some from both to a new shard/comms.py mixin that is a renewed form of shard/send.py mixin. It basically handles communication related functions.
  • Fixed some class fields that have Field(default=...) but is still Optional to be their designated types.
  • Fixed a variety of: type mismatches, misconfigured object instantiations, unnecessary getattr statements.
  • Added a few fixes to api/node.py as well.
  • Added # FIXME comments to several places.
  • Added VsCode tasks for ease of testing, along with testing docs & Make rule.

Resolves #7

Copilot Summary

This pull request introduces several improvements and fixes to the development workflow, API parameter handling, and server logic. The most significant changes include adding VSCode tasks for common development actions, refining how API parameters are handled and validated, and improving the robustness and clarity of the API server's internal logic.

Development workflow enhancements:

  • Added a .vscode/tasks.json file with pre-configured tasks for starting API and shard servers, running health checks, preparing and loading models, and making test API calls, making it easier to develop and test locally in VSCode. Also updated .vscode/.gitignore to only track relevant files. [1] [2]
  • Updated the README.md with instructions for running tests and using the new VSCode tasks, making onboarding and local development more accessible.
  • Added a test target to the Makefile for running tests with pytest, and updated the pyproject.toml to use the correct test file pattern. [1] [2]

API parameter and model validation improvements:

  • Refactored ChatParams in models.py to use non-optional types with default values, improving type safety and ensuring default values are always set. Also standardized the stop parameter handling.

API server logic and robustness fixes:

  • Improved error handling and logging throughout node.py, including clearer error messages and more robust topology/device checks. [1] [2]
  • Refactored model and topology selection logic in _handle_load_model, ensuring correct model assignment and fallback behavior, and simplified device/shard mapping. [1] [2] [3] [4] [5]
  • Cleaned up and clarified type annotations and usage in several endpoints and internal functions, including handling of streaming responses and device assignments. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

These changes collectively improve developer experience, code quality, and the reliability of the API server.

@erhant erhant self-assigned this Oct 21, 2025
@erhant erhant marked this pull request as ready for review October 21, 2025 10:45
@erhant erhant requested a review from andthattoo October 21, 2025 10:45
@erhant erhant added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Oct 21, 2025
@andthattoo andthattoo merged commit ab8cfb0 into master Oct 21, 2025
Copy link
Member

@andthattoo andthattoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got through the changes w/ erhant

@erhant erhant deleted the erhant/shard-type-fixes branch November 18, 2025 07:27
@andthattoo andthattoo mentioned this pull request Nov 20, 2025
7 tasks
Yuvrajxms09 pushed a commit to Yuvrajxms09/dnet that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: add types for compute and startup mixins

3 participants