Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add model api read and datasource #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Gilles-Marco
Copy link

PR Dependencies

Http request authorization : #6

Changes

Added datasource litellm_model and the ReadContext for model resource

Also introduced multiple structs representing the Litellm model and model api responses.

I had to change the schema.Schema of the resource Model

Testing

resource "litellm_model" "example" {
  model_name = "example-model"

  litellm_params_custom_llm_provider = "openai"
  litellm_params_model               = "gpt-3.5-turbo"
  litellm_params_api_key             = "your_underlying_model_api_key"
  litellm_params_api_base            = "https://api.openai.com/v1"

  model_info_id  = "mysupermymodel"
  model_info_base_model = "gpt-3.5-turbo"
  model_info_tier       = "paid"
}

data "litellm_model" "example_dt" {
  model_info_id = "4d73f0a13ad754cb37f0dc0d1afb5cd08da9288ed1744560e18b84af7960af41"
}

output "litellm_model_name"{
  value = data.litellm_model.example_dt.model_name
}

Tested to read a model created by the config, it's working.
Read/update/delete/create model is working.

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.

1 participant