SDK Size
Open
Nobody has claimed this yet.
question
sdk
- Dominant language
- Kotlin
- Stars
- 1.5k
- Forks
- 264
- Avg merge
- 9h 46m
- Merged PRs (30d)
- 96
Description
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-coretakes about 76MB. - The
ResponseStreamEvent.classis by itself 91KB. The contents of this file are more equivalent to a god function written inCthan object oriented code written inJava. 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 asequals,hashcode,toString, and most other methods; across 2400 lines of code
- For instance
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by measuring the openai-java-core dependency and inspecting the generated com/openai/models and com/openai/services contents, especially ResponseStreamEvent.class. Determine the scope of the Kotlin dependency and identify a feasible design for reducing generated code and SDK size; done means the requested dependency and size reductions are demonstrated without breaking the SDK.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- backend-api-design, developer-experience
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100