Add context tracking

This commit is contained in:
dwrz
2026-06-27 12:35:11 +00:00
parent f2edd39160
commit ec9e0a80f8
5 changed files with 110 additions and 6 deletions

View File

@@ -249,10 +249,19 @@ func (m *Message) UnmarshalJSON(data []byte) error {
// Model represents an available model from the API.
type Model struct {
ID string `json:"id"`
Created int64 `json:"created"`
Object string `json:"object"`
OwnedBy string `json:"owned_by"`
ID string `json:"id"`
Created int64 `json:"created"`
Object string `json:"object"`
OwnedBy string `json:"owned_by"`
Meta *ModelMeta `json:"meta,omitempty"`
}
// ModelMeta contains optional model metadata from the provider.
// llama.cpp includes n_ctx (configured context size) and
// n_ctx_train (model's native training context).
type ModelMeta struct {
NCtx int `json:"n_ctx,omitempty"`
NCtxTrain int `json:"n_ctx_train,omitempty"`
}
// ModelsResponse is the response for GET /models.