chore: major type fixes #12
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
shard/attrib.pyto shard to share types of attributes / methods among mixins, fixing around 196 type errors undershardfolder.shard/startup.pymethods toshard/node.py, and moved some from both to a newshard/comms.pymixin that is a renewed form ofshard/send.pymixin. It basically handles communication related functions.Field(default=...)but is stillOptionalto be their designated types.getattrstatements.api/node.pyas well.# FIXMEcomments to several places.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:
.vscode/tasks.jsonfile 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/.gitignoreto only track relevant files. [1] [2]README.mdwith instructions for running tests and using the new VSCode tasks, making onboarding and local development more accessible.testtarget to theMakefilefor running tests withpytest, and updated thepyproject.tomlto use the correct test file pattern. [1] [2]API parameter and model validation improvements:
ChatParamsinmodels.pyto use non-optional types with default values, improving type safety and ensuring default values are always set. Also standardized thestopparameter handling.API server logic and robustness fixes:
node.py, including clearer error messages and more robust topology/device checks. [1] [2]_handle_load_model, ensuring correct model assignment and fallback behavior, and simplified device/shard mapping. [1] [2] [3] [4] [5]These changes collectively improve developer experience, code quality, and the reliability of the API server.