Skip to content

Add temperature=0.9 and top_p=0.95 to zai-glm-4.7 model#163

Open
sebastiand-cerebras wants to merge 1 commit intocharmbracelet:mainfrom
sebastiand-cerebras:glm47-temperature-added
Open

Add temperature=0.9 and top_p=0.95 to zai-glm-4.7 model#163
sebastiand-cerebras wants to merge 1 commit intocharmbracelet:mainfrom
sebastiand-cerebras:glm47-temperature-added

Conversation

@sebastiand-cerebras
Copy link
Contributor

Added "temperature": 0.9, "top_p": 0.95 to zai-glm-4.7 model (also removed duplicate entry)

Will this work?:) Thanks for letting me know. If not, then probs do not merge it.

@sebastiand-cerebras sebastiand-cerebras requested a review from a team as a code owner January 24, 2026 23:16
@sebastiand-cerebras sebastiand-cerebras requested review from andreynering and meowgorithm and removed request for a team January 24, 2026 23:16
Copy link
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible to set this currently, so I think I'll just close this PR.

Let me know if I'm missing anything.

Comment on lines +68 to +69
"temperature": 1,
"top_p": 0.95
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can actually only set the fields available in this struct for now:

type Model struct {
ID string `json:"id"`
Name string `json:"name"`
CostPer1MIn float64 `json:"cost_per_1m_in"`
CostPer1MOut float64 `json:"cost_per_1m_out"`
CostPer1MInCached float64 `json:"cost_per_1m_in_cached"`
CostPer1MOutCached float64 `json:"cost_per_1m_out_cached"`
ContextWindow int64 `json:"context_window"`
DefaultMaxTokens int64 `json:"default_max_tokens"`
CanReason bool `json:"can_reason"`
ReasoningLevels []string `json:"reasoning_levels,omitempty"`
DefaultReasoningEffort string `json:"default_reasoning_effort,omitempty"`
SupportsImages bool `json:"supports_attachments"`
Options ModelOptions `json:"options"`
}

@kujtimiihoxha
Copy link
Contributor

@andreynering these can go under options

// ModelOptions stores extra options for models.
type ModelOptions struct {
	Temperature      *float64       `json:"temperature,omitempty"`
	TopP             *float64       `json:"top_p,omitempty"`
	TopK             *int64         `json:"top_k,omitempty"`
	FrequencyPenalty *float64       `json:"frequency_penalty,omitempty"`
	PresencePenalty  *float64       `json:"presence_penalty,omitempty"`
	ProviderOptions  map[string]any `json:"provider_options,omitempty"`
}

@kujtimiihoxha kujtimiihoxha reopened this Jan 27, 2026
@kujtimiihoxha
Copy link
Contributor

@sebastiand-cerebras can you move them to the correct place?

@caarlos0
Copy link
Member

should these options even be here? I think these should be on the clients instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants