Skip to content

generalov-ai/ai-dial-models-parameters

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Work with different LLMs and parameters

A Python implementation task to work with different LLMs (Large Language Models) and request parameters via DIAL API

πŸŽ“ Learning Goals

By completing these tasks, you will learn:

  • How to work with different LLMs through DIAL API
  • How can we configure LLM output via request parameters (temperature, n, seed, etc...)

πŸ“‹ Requirements

  • Python 3.11+
  • pip
  • API key for DIAL service
  • Basic understanding of HTTP requests and async/await

πŸ”§ Setup

  1. Install dependencies:

    pip install -r requirements.txt
  2. Set your API key:

  3. Project structure:

    task/
    β”œβ”€β”€ models/
    β”‚   β”œβ”€β”€ conversation.py          βœ… Complete
    β”‚   β”œβ”€β”€ message.py               βœ… Complete  
    β”‚   └── role.py                  βœ… Complete   
    β”œβ”€β”€ app/
    β”‚   β”œβ”€β”€ main.py                  βœ… Complete
    β”‚   └── client.py                βœ… Complete
    β”œβ”€β”€ 1-task-models.py             🚧 TODO
    β”œβ”€β”€ 2-task-n.py                  🚧 TODO
    β”œβ”€β”€ 3-task-temperature.py        🚧 TODO
    β”œβ”€β”€ 4-task-seed.py               🚧 TODO
    β”œβ”€β”€ 5-task-max_tokens.py         🚧 TODO
    β”œβ”€β”€ 6-task-frequency_penalty.py  🚧 TODO
    β”œβ”€β”€ 7-task-presence_penalty.py   🚧 TODO
    └── 8-task-stop.py               🚧 TODO
    

Available models:

  • gpt-4o
  • gpt-4.1-nano-2025-04-14
  • gpt-4.1-mini-2025-04-14
  • gemini-2.0-flash-lite
  • gemini-2.0-flash
  • gemini-2.5-pro
  • gemini-2.5-flash
  • claude-3-5-haiku@20241022
  • claude-3-7-sonnet@20250219
  • claude-sonnet-4@20250514

πŸ“ Your Tasks

Implement all tasks from these files:

  • 1-task-models.py
  • 2-task-n.py
  • 3-task-temperature.py
  • 4-task-seed.py
  • 5-task-max_tokens.py
  • 6-task-frequency_penalty.py
  • 7-task-presence_penalty.py
  • 8-task-stop.py

πŸ’ͺ Additional task:

Practice with other parameters from OpenAI and Anthropic. For instance OpenAI have reasoning_effort and Anthropic thinking, and there are many others like citations, etc...

Pay attention that we are using DIAL Unified protol and all parameters that are not present in here https://dialx.ai/dial_api#operation/sendChatCompletionRequest must be provided as {"custom_fields": {"configuration": {CUSTOM_PARAMETERS} }}. More about custom_fields read here https://dialx.ai/dial_api#operation/sendChatCompletionRequest it is the last parameter described in documentation!


About

Task to work with different models and parameters via DIAL /chat/completion API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%