plano/demos/function_calling
2024-09-26 16:03:48 -07:00
..
api_server move demo functions out of model_server (#67) 2024-09-20 14:38:10 -07:00
grafana improve service names (#54) 2024-09-17 08:47:35 -07:00
prometheus add details on how to use grafana dashboards (#72) 2024-09-24 11:51:31 -07:00
Arch-Function-Calling-1.5B-Q4_K_M.model_file Integrate Arch-Function-Calling-1.5B model (#85) 2024-09-25 23:30:50 -07:00
bolt_config.yaml improve response handling (#71) 2024-09-23 22:56:35 -07:00
docker-compose.yaml expose access logs from envoy (#89) 2024-09-26 16:03:48 -07:00
README.md Integrate Arch-Function-Calling-1.5B model (#85) 2024-09-25 23:30:50 -07:00

Function calling

This demo shows how you can use intelligent prompt gateway to do function calling. This demo assumes you are using ollama running natively. If you want to run ollama running inside docker then please update ollama endpoint in docker-compose file.

Starting the demo

  1. Ensure that submodule is up to date
    git submodule sync --recursive
    
  2. Create .env file and set OpenAI key using env var OPENAI_API_KEY
  3. Start services
    docker compose up
    
  4. Download Bolt-FC model. This demo assumes we have downloaded Arch-Function-Calling-1.5B:Q4_K_M to local folder.
  5. If running ollama natively run
    ollama serve
    
  6. Create model file in ollama repository
    ollama create Arch-Function-Calling-1.5B:Q4_K_M -f Arch-Function-Calling-1.5B-Q4_K_M.model_file
    
  7. Navigate to http://localhost:18080/
  8. You can type in queries like "how is the weather in Seattle"
    • You can also ask follow up questions like "show me sunny days"
  9. To see metrics navigate to "http://localhost:3000/" (use admin/grafana for login)
    • Open up dahsboard named "Intelligent Gateway Overview"
    • On this dashboard you can see reuqest latency and number of requests

Observability

Arch gateway publishes stats endpoint at http://localhost:19901/stats. In this demo we are using prometheus to pull stats from envoy and we are using grafan to visalize the stats in dashboard. To see grafana dashboard follow instructions below,

  1. Start grafana and prometheus using following command
    docker compose --profile monitoring up
    
  2. Navigate to http://localhost:3000/ to open grafana UI (use admin/grafana as credentials)
  3. From grafana left nav click on dashboards and select "Intelligent Gateway Overview" to view arch gateway stats

Here is sample interaction,

image