Skip to content

Instantly share code, notes, and snippets.

@up1
Last active April 20, 2026 15:04
Show Gist options
  • Select an option

  • Save up1/48d6a21cb30751b8737fded83b29e3b9 to your computer and use it in GitHub Desktop.

Select an option

Save up1/48d6a21cb30751b8737fded83b29e3b9 to your computer and use it in GitHub Desktop.
// เรียกใช้งานผ่าน LiteLLM Proxy
$curl -X POST 'http://127.0.0.1:4000/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer dummy' \
-d '{
"model": "openthaigpt",
"messages": [
{"role": "user", "content": "สวัสดี"}
]
}'
// ผลการทำงาน
{"id":"chatcmpl-df9be8edb2ada55cebe1681ae2b9cbf5","created":1776695879,
"model":"openthaigpt","object":"chat.completion",
"choices":[{"finish_reason":"stop","index":0,
"message":{"content":"<think>\nOkay, the user said \"สวัสดี\" which means \"Hello\" in Thai. I need to respond politely. Since they just greeted me, I should acknowledge their greeting and offer help. Maybe start with a friendly response like \"สวัสดีค่ะ! ยินดีที่ได้พบคุณ :) ฉันพร้อมช่วยเหลือในเรื่องใดก็ได้ที่คุณต้องการนะคะ\" to keep it warm and open. That covers thanking them and inviting them to ask for assistance. Keep it simple and friendly.\n</think>\nสวัสดีค่ะ! ยินดีที่ได้พบคุณ :) ฉันพร้อมช่วยเหลือในเรื่องใดก็ได้ที่คุณต้องการนะคะ",
"role":"assistant","provider_specific_fields":{"refusal":null}},"provider_specific_fields":{"stop_reason":null}}],
"usage":{"completion_tokens":175,"prompt_tokens":12,"total_tokens":187}}
services:
litellm:
image: docker.litellm.ai/berriai/litellm:main-latest
container_name: litellm
ports:
- "4000:4000"
volumes:
- ./litellm_config.yml:/app/config.yaml
command:
- "--config"
- "/app/config.yaml"
environment:
- THAILLM_API_KEY=${THAILLM_API_KEY}
- LITELLM_LOG_LEVEL=debug
model_list:
- model_name: openthaigpt
litellm_params:
model: openai//model
api_base: http://thaillm.or.th/api/pathumma/v1
api_key: dummy
extra_headers:
apikey: os.environ/THAILLM_API_KEY
User-Agent: litellm
general_settings:
master_key: dummy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment