-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Summary - The `click` CLI interface is tested with a bunch of unit tests - The `main` function validation is added. - `OpenAIBackend` initializer parameters are optimized - target, host, and port parameters usage is simplified - `openai.NotFound` **_available models_** error is handled - `SerializableFileType` renamed to `SerializableFileExtension` - `SerializableFileExtension` now inherits `str` to simplify usage, since this Enum class is mostly used to work with strings. - `rate_type_to_load_gen_mode` renamed to `RATE_TYPE_TO_LOAD_GEN_MODE_MAPPER` - `rate_type_to_profile_mode` renamed to `RATE_TYPE_TO_PROFILE_MODE_MAPPER` - CLI parameters are renamed: - `--num-seconds` -> `--max-seconds` - `--num-requests` -> `--max-requests` - `path` removed from CLI arguments since it is not used - .env `GUIDELLM` prefix is fixed - Unused comments, settings, and code are removed - Logger default unit test uses the injected logging settings object - Module `backend.openai` has `_base_url` renamed to the `base_url` - In `OpenAIBackend.make_request`, the `GenerativeResponse` always counts `output_tokens` with `self._token_count` - `SerializableFileExtensions` is replaced with pure Python strings --------- Co-authored-by: Dmytro Parfeniuk <[email protected]> Co-authored-by: Mark Kurtz <[email protected]>
- Loading branch information
1 parent
996de81
commit 8494b7a
Showing
25 changed files
with
335 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,3 +164,8 @@ cython_debug/ | |
|
||
# MacOS files | ||
.DS_Store | ||
|
||
|
||
# Project specific files | ||
*.json | ||
*.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,6 +228,37 @@ The project is fully configurable with environment variables. With that configur | |
| `GUIDELLM__OPENAI__BASE_URL` | `http://localhost:8080` | The address to the **OpenAI-compatible** server.<br><br>OpenAI live base url is `https://api.openai.com/v1` | | ||
| `GUIDELLM__OPENAI__API_KEY` | `invalid` | Corresponds to the **OpenAI-compatible** server API key.<br><br>If you look for the live key - check [this link](https://platform.openai.com/api-keys). | | ||
|
||
<br> | ||
|
||
## Project configuration | ||
|
||
The project configuartion is powered by _[`🔗 pydantic-settings`](https://docs.pydantic.dev/latest/concepts/pydantic_settings/)_ | ||
|
||
The project configuration entrypoint is represented by lazy-loaded `settigns` singleton object ( `src/config/__init__` ) | ||
|
||
The project is fully configurable with environment variables. All the default values and | ||
|
||
```py | ||
class NestedIntoLogging(BaseModel): | ||
nested: str = "default value" | ||
|
||
class LoggingSettings(BaseModel): | ||
# ... | ||
disabled: bool = False | ||
|
||
|
||
class Settings(BaseSettings): | ||
"""The entrypoint to settings.""" | ||
|
||
# ... | ||
logging: LoggingSettings = LoggingSettings() | ||
|
||
|
||
settings = Settings() | ||
``` | ||
|
||
With that configuration set you can load parameters to `LoggingSettings()` by using environment variables. Just run `export GUIDELLM__LOGGING__DISABLED=true` or `export GUIDELLM__LOGGING__NESTED=another_value` respectfully. The nesting delimiter is `__` | ||
|
||
## Contact and Support | ||
|
||
If you need help or have any questions, please open an issue on GitHub or contact us at [email protected]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.