Skip to content

SDK Size #602

@nkavian

Description

@nkavian

Context

  • The jar dependency adds around 30MB to my final spring boot project, based on the main dependency and its child dependencies.
  • The decompressed openai-java-core takes about 76MB.
  • The ResponseStreamEvent.class is by itself 91KB. The contents of this file are more equivalent to a god function written in C than object oriented code written in Java. Maybe due to some sort of scripted code creation?
 62M	./com/openai/models
 10M	./com/openai/services

Concerns

  • The first concern is the added size in terms of MB to the project size.
  • The second concern is that when this code runs, it will instantiate larger than necessary objects that will consume more memory (compared to a better design).
    • For instance ResponseStreamEvent, it has: 51 member variables, leading to very large functions such as equals, hashcode, toString, and most other methods; across 2400 lines of code
  • The third concern is about forcing integrators to have to pull in Kotlin into a server side project. Additionally, when there is no intention to run on Android.

Feature Request

Please consider to:

  • refactor and remove the kotlin dependency
  • refactor and reduce the overall SDK size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedsdk

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions