[GH-ISSUE #4390] Feature Request: Customizable JSON Encoder/Decoder Configuration for REST API Endpoints or other that might need #2743

Open
opened 2026-04-12 13:03:23 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @H0llyW00dzZ on GitHub (May 13, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4390

Description

Since this repository is written in Go, it is possible to customize the JSON encoding/decoding configuration for REST API endpoints.

However, it may require refactoring from scratch since there are many hard-coded instances of JSON using the standard library.

Proposed Feature

The proposed feature would work as follows:

  • Users can customize the JSON Encoder/Decoder by using another package. This idea is inspired by Fiber, which provides improved flexibility.

  • By implementing this feature, users will have more control over the JSON serialization and deserialization process, allowing for optimizations and customizations specific to their needs.

Benefits

  • Improved flexibility in handling JSON encoding/decoding for REST API endpoints.
  • Ability to optimize performance by using alternative JSON packages.
  • Greater control over the JSON serialization and deserialization process.

Considerations

  • Refactoring the existing codebase may be required to remove hard-coded instances of JSON using the standard library.
  • Thorough testing should be conducted to ensure compatibility and performance improvements.

References

Originally created by @H0llyW00dzZ on GitHub (May 13, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4390 ## Description Since this repository is written in Go, it is possible to customize the `JSON encoding/decoding` configuration for `REST API endpoints`. However, it may require refactoring from scratch since there are many `hard-coded` instances of `JSON` using the `standard library`. ## Proposed Feature The proposed feature would work as follows: - Users can customize the `JSON Encoder/Decoder` by using `another package`. This idea is inspired by [`Fiber`](https://docs.gofiber.io/guide/faster-fiber), which provides improved flexibility. - By implementing this feature, users will have more control over the JSON serialization and deserialization process, allowing for optimizations and customizations specific to their needs. ## Benefits - Improved flexibility in handling JSON encoding/decoding for REST API endpoints. - Ability to optimize performance by using alternative JSON packages. - Greater control over the JSON serialization and deserialization process. ## Considerations - Refactoring the existing codebase may be required to remove hard-coded instances of JSON using the standard library. - Thorough testing should be conducted to ensure compatibility and performance improvements. ## References - [`Fiber` - Custom JSON Encoding/Decoding](https://docs.gofiber.io/guide/faster-fiber)
GiteaMirror added the feature requestapi labels 2026-04-12 13:03:23 -05:00
Author
Owner

@H0llyW00dzZ commented on GitHub (May 13, 2024):

Note

Also note that this customization is not limited to REST API endpoints but can also be applied to other areas of the codebase where JSON encoding/decoding is used.

<!-- gh-comment-id:2106823064 --> @H0llyW00dzZ commented on GitHub (May 13, 2024): > [!NOTE] > Also note that this customization is not limited to `REST API endpoints` but can also be applied to other areas of the codebase where JSON encoding/decoding is used.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#2743