Commit 4010165
authored
[NA] [BE][FE][SDK] Rename OPIK_BUILTIN to OPIK_FREE and improve free model UX (#4443)
* [NA] [BE][FE][SDK] Rename OPIK_BUILTIN to OPIK_FREE and improve free model UX
Rename internal terminology from OPIK_BUILTIN to OPIK_FREE and enhance
the user experience for the free model in the Playground.
- Display free model directly in model selector (not in a dropdown/submenu)
- Show model as "gpt-4o-mini (free)" with Opik icon for clear identification
- Dynamic model label from backend config via `model_label` field
- Provider label changed from "Opik Built-in" to "Opik"
- Description updated to "Free model provided by Opik - no API key required"
- API key name changed to "OPIK_FREE_MODEL_API_KEY" in configuration page
- Free model included in search/filter results
- LlmProvider enum: OPIK_BUILTIN → OPIK_FREE (value: "opik-free")
- Package rename: opikbuiltin → freemodel
- Class renames: OpikBuiltin* → FreeModel*
- Config: opikbuiltinProviderEnabled → opikfreeProviderEnabled
- Environment variable: TOGGLE_OPIKBUILTIN_PROVIDER_ENABLED → TOGGLE_OPIKFREE_PROVIDER_ENABLED
- Added model_label to provider configuration for dynamic UI display
- PROVIDER_TYPE.OPIK_BUILTIN → PROVIDER_TYPE.OPIK_FREE
- PROVIDER_MODEL_TYPE.OPIK_BUILTIN_MODEL → PROVIDER_MODEL_TYPE.OPIK_FREE_MODEL
- Feature toggle: OPIKBUILTIN_PROVIDER_ENABLED → OPIKFREE_PROVIDER_ENABLED
- Refactored PromptModelSelect for improved free model presentation
- TypeScript SDK provider types updated
- OpenAPI specs updated
* Address PR feedback: add validation and improve robustness
- FreeModelConfig: Add JavaDoc explaining required fields
- FreeModelConfig: isEnabled() now validates that actualModel, spanProvider,
and baseUrl are set, ensuring fail-fast on misconfiguration
- PromptModelSelect: Handle empty string for model_label with .trim() check
* Fix camelCase naming for opikFreeProviderEnabled
Rename opikfreeProviderEnabled to opikFreeProviderEnabled to follow
consistent camelCase naming convention in configuration properties.
* Remove opikFreeProviderEnabled feature toggle
The free model visibility is already controlled by freeModel.enabled
backend config, making the feature toggle redundant. This simplifies
the codebase by removing unnecessary toggle checks.
Changes:
- Remove toggle from backend config and ServiceTogglesConfig
- Remove toggle from frontend feature-toggles and DEFAULT_STATE
- Update ProviderSelect and ProviderGrid to explicitly exclude OPIK_FREE
- Update PROVIDER_FEATURE_TOGGLE_MAP type to use Exclude<>
- Regenerate OpenAPI specs and SDKs
* [NA] [FE] Add opik_free_model metadata flag for BI tracking
Add a boolean flag to span metadata when users use the free model,
enabling the BI team to identify and track free model usage in the
analytics database.
* Revision 3: Refactor PromptModelSelect - extract useModelOptions hook
- Extract data transformation logic into useModelOptions hook
- Simplify renderSelectTrigger with getSelectedModelInfo callback
- Fix vertical alignment with py-1 padding on options container
- Reduce component from 484 to ~350 lines
* Revision 4: Fix useModelOptions type errors
- Change ProviderKey to ProviderObject (correct exported type)
- Use ModelOption[] instead of inline type for consistency
* Revision 5: Fix free model row vertical alignment in PromptModelSelect1 parent e6b0563 commit 4010165
File tree
42 files changed
+507
-381
lines changed- apps
- opik-backend
- src
- main/java/com/comet/opik
- api
- resources/v1/priv
- domain
- llm/structuredoutput
- infrastructure
- llm
- freemodel
- test
- java/com/comet/opik
- api/resources/v1/priv
- infrastructure/llm
- resources
- opik-documentation/documentation/fern/openapi
- opik-frontend/src
- api/playground
- components
- pages/ConfigurationPage/AIProvidersTab
- constants
- hooks
- types
- sdks
- code_generation/fern/openapi
- python/src/opik/rest_api
- llm_provider_key/types
- types
- typescript/src/opik/rest_api
- api
- resources/llmProviderKey/types
- types
- serialization
- resources/llmProviderKey/types
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
42 files changed
+507
-381
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | 603 | | |
607 | 604 | | |
608 | 605 | | |
| |||
753 | 750 | | |
754 | 751 | | |
755 | 752 | | |
756 | | - | |
757 | | - | |
| 753 | + | |
| 754 | + | |
758 | 755 | | |
759 | | - | |
| 756 | + | |
| 757 | + | |
760 | 758 | | |
761 | | - | |
762 | | - | |
763 | | - | |
| 759 | + | |
764 | 760 | | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | 761 | | |
770 | | - | |
771 | | - | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
772 | 767 | | |
773 | | - | |
774 | | - | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | 50 | | |
53 | 51 | | |
0 commit comments