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

[FIX] Chat with LMStudio Hosted Model via Khoj Docker on Windows #1047

Open
3 of 14 tasks
RyzeNGrind opened this issue Jan 8, 2025 · 1 comment
Open
3 of 14 tasks
Labels
fix Fix something that isn't working as expected

Comments

@RyzeNGrind
Copy link

Describe the bug

Cannot get chat to run and complete on any of my chat models, or api providers remotely or locally via LM Studio.

To Reproduce

Steps to reproduce the behavior:
Self host with docker.
Setup as per docs for LM Studio config.
Run chat locally after config of admin panel per docs.

Screenshots

If applicable, add screenshots to help explain your problem.
image
image
image

Platform

  • Server:
    • Cloud-Hosted (https://app.khoj.dev)
    • Self-Hosted Docker
    • Self-Hosted Python package
    • Self-Hosted source code
  • Client:
    • Obsidian
    • Emacs
    • Desktop app
    • Web browser
    • WhatsApp
  • OS:
    • Windows OS: Windows 11 Pro Workstation 10.0.22631 Build 22631
    • macOS
    • Linux
    • Android
    • iOS

If self-hosted

  • Server Version [e.g. 1.0.1]:
    1.33.2
    ghcr.io/khoj-ai/khoj:latest sha256:56ea19cc86254e122eba855f3e932dc0d82da4f2e01675357613d2e65bd683b1

Additional context

Add any other context about the problem here.

$ cat docker-compose.yml
services:
  database:
    image: ankane/pgvector
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: REDACTED
      POSTGRES_DB: postgres
    volumes:
      - khoj_db:/var/lib/postgresql/data/
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 30s
      timeout: 10s
      retries: 5
  sandbox:
    image: ghcr.io/khoj-ai/terrarium:latest
    ports:
      - "8080:8080"
  search:
    image: docker.io/searxng/searxng:latest
    ports:
      - "42113:8080"
    volumes:
      - khoj_search:/etc/searxng
    environment:
      - SEARXNG_BASE_URL=http://localhost:42113/
  server:
    depends_on:
      database:
        condition: service_healthy
    # Use the following line to use the latest version of khoj. Otherwise, it will build from source. Set this to ghcr.io/khoj-ai/khoj-cloud:latest if you want to use the prod image.
    image: ghcr.io/khoj-ai/khoj:latest
    # Uncomment the following line to build from source. This will take a few minutes. Comment the next two lines out if you want to use the official image.
    # build:
      # context: .
    ports:
      # If changing the local port (left hand side), no other changes required.
      # If changing the remote port (right hand side),
      #   change the port in the args in the build section,
      #   as well as the port in the command section to match
      - "42110:42110"
    working_dir: /app
    volumes:
      - khoj_config:/root/.khoj/
      - khoj_models:/root/.cache/torch/sentence_transformers
      - khoj_models:/root/.cache/huggingface
    # Use 0.0.0.0 to explicitly set the host ip for the service on the container. https://pythonspeed.com/articles/docker-connection-refused/
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=REDACTED
      - POSTGRES_HOST=database
      - POSTGRES_PORT=5432
      - KHOJ_DJANGO_SECRET_KEY=REDACTED
      - KHOJ_DEBUG=False
      - KHOJ_ADMIN_EMAIL=REDACTED
      - KHOJ_ADMIN_PASSWORD=REDACTED
      # Default URL of Terrarium, the Python sandbox used by Khoj to run code. Its container is specified above
      - KHOJ_TERRARIUM_URL=http://host.docker.internal:8080
      # Default URL of SearxNG, the default web search engine used by Khoj. Its container is specified above
      - KHOJ_SEARXNG_URL=http://host.docker.internal:42113
      # Uncomment line below to use with Ollama running on your local machine at localhost:11434.
      # Change URL to use with other OpenAI API compatible providers like VLLM, LMStudio etc.
      - OPENAI_API_BASE=http://host.docker.internal:1234/v1
      #
      # Uncomment appropriate lines below to use chat models by OpenAI, Anthropic, Google.
      # Ensure you set your provider specific API keys.
      # ---
      # - OPENAI_API_KEY=your_openai_api_key
      # - GEMINI_API_KEY=your_gemini_api_key
      # - ANTHROPIC_API_KEY=your_anthropic_api_key
      #
      # Uncomment appropriate lines below to enable web results with Khoj
      # Ensure you set your provider specific API keys.
      # ---
      # Free, Slower API. Does both web search and webpage read. Get API key from https://jina.ai/
      - JINA_API_KEY=REDACTED
      # Paid, Fast API. Only does web search. Get API key from https://serper.dev/
      # - SERPER_DEV_API_KEY=your_serper_dev_api_key
      # Paid, Fast, Open API. Only does webpage read. Get API key from https://firecrawl.dev/
      # - FIRECRAWL_API_KEY=your_firecrawl_api_key
      # Paid, Fast, Higher Read Success API. Only does webpage read. Get API key from https://olostep.com/
      # - OLOSTEP_API_KEY=your_olostep_api_key
      #
      #EMAIL API
      - RESEND_EMAIL=REDACTED
      - RESEND_API_KEY=REDACTED
      # Uncomment the necessary lines below to make your instance publicly accessible.
      # Replace the KHOJ_DOMAIN with either your domain or IP address (no http/https prefix).
      # Proceed with caution, especially if you are using anonymous mode.
      # ---
      - KHOJ_NO_HTTPS=True
      - KHOJ_DOMAIN=localhost,host.docker.internal,REDACTED
      #- KHOJ_DOMAIN=host.docker.internal
      #- KHOJ_DOMAIN=REDACTED
      # Uncomment the line below to disable telemetry.
      # Telemetry helps us prioritize feature development and understand how people are using Khoj
      # Read more at https://docs.khoj.dev/miscellaneous/telemetry
      #- KHOJ_TELEMETRY_DISABLE=True
    # Comment out this line when you're using the official ghcr.io/khoj-ai/khoj-cloud:latest prod image.
    command: --host="0.0.0.0" --port=42110 -vv --anonymous-mode #--non-interactive


volumes:
  khoj_config:
  khoj_db:
  khoj_models:
  khoj_search:
$ docker ps
CONTAINER ID   IMAGE                              COMMAND                  CREATED          STATUS                    PORTS                      NAMES
32a8b004a13b   ghcr.io/khoj-ai/khoj:latest        "python3 src/khoj/ma…"   25 minutes ago   Up 24 minutes             0.0.0.0:42110->42110/tcp   khoj-server-1
1a8004eaaf1d   ankane/pgvector                    "docker-entrypoint.s…"   25 minutes ago   Up 25 minutes (healthy)   0.0.0.0:5432->5432/tcp     khoj-database-1
d5a2fa215c28   searxng/searxng:latest             "/sbin/tini -- /usr/…"   25 minutes ago   Up 25 minutes             0.0.0.0:42113->8080/tcp    khoj-search-1
4a4be55a5e78   ghcr.io/khoj-ai/terrarium:latest   "ts-node src/index.ts"   25 minutes ago   Up 25 minutes (healthy)   0.0.0.0:8080->8080/tcp     khoj-sandbox-1
REPOSITORY                                    TAG                   IMAGE ID       CREATED         SIZE
ghcr.io/khoj-ai/khoj                          latest                56ea19cc8625   20 hours ago    4.51GB
searxng/searxng                               latest                a719598eedf2   2 days ago      283MB
ghcr.io/khoj-ai/terrarium                     latest                594f4386bb86   3 weeks ago     432MB```

CONTAINER LOGS HERE: GH reached 65536 character limit.

@RyzeNGrind RyzeNGrind added the fix Fix something that isn't working as expected label Jan 8, 2025
@RyzeNGrind
Copy link
Author

RyzeNGrind commented Jan 8, 2025

Container Logs:
2025-01-08 14:30:11 server-1 | [19:30:11.047037] INFO uvicorn.access: 172.24.0.1:55720 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET /api/chat/sessions HTTP/1.1" 200 2025-01-08 14:30:11 server-1 | [19:30:11.048932] INFO uvicorn.access: 172.24.0.1:55740 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET /api/content/computer HTTP/1.1" 2025-01-08 14:30:11 server-1 | 200 2025-01-08 14:30:11 server-1 | [19:30:11.086280] INFO uvicorn.access: 172.24.0.1:55740 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "POST 2025-01-08 14:30:11 server-1 | /api/chat/sessions?client=web&agent_s 2025-01-08 14:30:11 server-1 | lug=khoj HTTP/1.1" 200 2025-01-08 14:30:11 server-1 | [19:30:11.125520] INFO uvicorn.access: 172.24.0.1:55740 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET 2025-01-08 14:30:11 server-1 | /chat?conversationId=db1204d5-ee0f-48 2025-01-08 14:30:11 server-1 | 34-946f-008ebd9b7dd4 HTTP/1.1" 200 2025-01-08 14:30:11 server-1 | [19:30:11.131398] INFO uvicorn.access: 172.24.0.1:55720 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET 2025-01-08 14:30:11 server-1 | /api/chat/conversation/file-filters/d 2025-01-08 14:30:11 server-1 | b1204d5-ee0f-4834-946f-008ebd9b7dd4 2025-01-08 14:30:11 server-1 | HTTP/1.1" 200 2025-01-08 14:30:11 server-1 | [19:30:11.246775] INFO uvicorn.access: 172.24.0.1:55740 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET /api/chat/options HTTP/1.1" 200 2025-01-08 14:30:11 server-1 | [19:30:11.255633] INFO uvicorn.access: 172.24.0.1:55720 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET /api/v1/user HTTP/1.1" 200 2025-01-08 14:30:11 server-1 | [19:30:11.339579] INFO uvicorn.access: 172.24.0.1:55720 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET 2025-01-08 14:30:11 server-1 | /api/chat/history?client=web&conversa 2025-01-08 14:30:11 server-1 | tion_id=db1204d5-ee0f-4834-946f-008eb 2025-01-08 14:30:11 server-1 | d9b7dd4&n=10 HTTP/1.1" 200 2025-01-08 14:30:11 server-1 | [19:30:11.341750] INFO uvicorn.access: 172.24.0.1:55740 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET /api/chat/sessions HTTP/1.1" 200 2025-01-08 14:30:11 server-1 | [19:30:11.387474] INFO uvicorn.access: 172.24.0.1:43242 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "POST /api/chat?client=web HTTP/1.1" 2025-01-08 14:30:11 server-1 | 200 2025-01-08 14:30:11 server-1 | [19:30:11.403309] INFO uvicorn.access: 172.24.0.1:55740 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET /api/content/computer HTTP/1.1" 2025-01-08 14:30:11 server-1 | 200 2025-01-08 14:30:11 server-1 | [19:30:11.410185] INFO uvicorn.access: 172.24.0.1:55720 - h11_impl.py:476 2025-01-08 14:30:11 server-1 | "GET 2025-01-08 14:30:11 server-1 | /api/chat/conversation/file-filters/d 2025-01-08 14:30:11 server-1 | b1204d5-ee0f-4834-946f-008ebd9b7dd4 2025-01-08 14:30:11 server-1 | HTTP/1.1" 200 2025-01-08 14:30:12 server-1 | [19:30:12.291851] DEBUG khoj.processor.conversation.utils: utils.py:537 2025-01-08 14:30:12 server-1 | Fallback to default chat model 2025-01-08 14:30:12 server-1 | tokenizer: gpt-4o. 2025-01-08 14:30:12 server-1 | Configure tokenizer for model: 2025-01-08 14:30:12 server-1 | dolphin-2.9.2-qwen2-72b in Khoj settings 2025-01-08 14:30:12 server-1 | to improve context stuffing. 2025-01-08 14:30:12 server-1 | [19:30:12.610121] DEBUG khoj.processor.conversation.openai before_sleep.py:65 2025-01-08 14:30:12 server-1 | .utils: Retrying 2025-01-08 14:30:12 server-1 | khoj.processor.conversation.openai 2025-01-08 14:30:12 server-1 | .utils.completion_with_backoff in 2025-01-08 14:30:12 server-1 | 0.14591159727206704 seconds as it 2025-01-08 14:30:12 server-1 | raised APIStatusError: <html> 2025-01-08 14:30:12 server-1 | <head><title>405 Not 2025-01-08 14:30:12 server-1 | Allowed</title></head> 2025-01-08 14:30:12 server-1 | <body> 2025-01-08 14:30:12 server-1 | <center><h1>405 Not 2025-01-08 14:30:12 server-1 | Allowed</h1></center> 2025-01-08 14:30:12 server-1 | <hr><center>openresty</center> 2025-01-08 14:30:12 server-1 | </body> 2025-01-08 14:30:12 server-1 | </html>. 2025-01-08 14:30:12 server-1 | [19:30:12.944753] DEBUG khoj.processor.conversation.openai before_sleep.py:65 2025-01-08 14:30:12 server-1 | .utils: Retrying 2025-01-08 14:30:12 server-1 | khoj.processor.conversation.openai 2025-01-08 14:30:12 server-1 | .utils.completion_with_backoff in 2025-01-08 14:30:12 server-1 | 0.7873716157114505 seconds as it 2025-01-08 14:30:12 server-1 | raised APIStatusError: <html> 2025-01-08 14:30:12 server-1 | <head><title>405 Not 2025-01-08 14:30:12 server-1 | Allowed</title></head> 2025-01-08 14:30:12 server-1 | <body> 2025-01-08 14:30:12 server-1 | <center><h1>405 Not 2025-01-08 14:30:12 server-1 | Allowed</h1></center> 2025-01-08 14:30:12 server-1 | <hr><center>openresty</center> 2025-01-08 14:30:12 server-1 | </body> 2025-01-08 14:30:12 server-1 | </html>. 2025-01-08 14:30:13 server-1 | [19:30:13.956121] DEBUG khoj.routers.helpers: Chat actor: helpers.py:193 2025-01-08 14:30:13 server-1 | Infer information sources to refer: 2025-01-08 14:30:13 server-1 | 2.547 seconds 2025-01-08 14:30:14 server-1 | [19:30:13.957754] ERROR uvicorn.error: Exception in ASGI h11_impl.py:411 2025-01-08 14:30:14 server-1 | application 2025-01-08 14:30:14 server-1 | 2025-01-08 14:30:14 server-1 | ╭─ Traceback (most recent call last─╮ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/uvicorn/protocols/http/h11 │ 2025-01-08 14:30:14 server-1 | │ _impl.py:406 in run_asgi │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 403 │ # ASGI exception wrappe │ 2025-01-08 14:30:14 server-1 | │ 404 │ async def run_asgi(self │ 2025-01-08 14:30:14 server-1 | │ 405 │ │ try: │ 2025-01-08 14:30:14 server-1 | │ ❱ 406 │ │ │ result = await │ 2025-01-08 14:30:14 server-1 | │ 407 │ │ │ │ self.scope, │ 2025-01-08 14:30:14 server-1 | │ 408 │ │ │ ) │ 2025-01-08 14:30:14 server-1 | │ 409 │ │ except BaseExceptio │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/uvicorn/middleware/proxy_h │ 2025-01-08 14:30:14 server-1 | │ eaders.py:70 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 67 │ │ │ │ │ port = 0 │ 2025-01-08 14:30:14 server-1 | │ 68 │ │ │ │ │ scope["c │ 2025-01-08 14:30:14 server-1 | │ 69 │ │ │ 2025-01-08 14:30:14 server-1 | │ ❱ 70 │ │ return await self.ap │ 2025-01-08 14:30:14 server-1 | │ 71 │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/fastapi/applications.py:10 │ 2025-01-08 14:30:14 server-1 | │ 54 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 1051 │ async def __call__(sel │ 2025-01-08 14:30:14 server-1 | │ 1052 │ │ if self.root_path: │ 2025-01-08 14:30:14 server-1 | │ 1053 │ │ │ scope["root_pa │ 2025-01-08 14:30:14 server-1 | │ ❱ 1054 │ │ await super().__ca │ 2025-01-08 14:30:14 server-1 | │ 1055 │ │ 2025-01-08 14:30:14 server-1 | │ 1056 │ def add_api_route( │ 2025-01-08 14:30:14 server-1 | │ 1057 │ │ self, │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/applications.py: │ 2025-01-08 14:30:14 server-1 | │ 113 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 110 │ │ scope["app"] = self │ 2025-01-08 14:30:14 server-1 | │ 111 │ │ if self.middleware_ │ 2025-01-08 14:30:14 server-1 | │ 112 │ │ │ self.middleware │ 2025-01-08 14:30:14 server-1 | │ ❱ 113 │ │ await self.middlewa │ 2025-01-08 14:30:14 server-1 | │ 114 │ │ 2025-01-08 14:30:14 server-1 | │ 115 │ def on_event(self, even │ 2025-01-08 14:30:14 server-1 | │ 116 │ │ return self.router. │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/error │ 2025-01-08 14:30:14 server-1 | │ s.py:187 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 184 │ │ │ # We always con │ 2025-01-08 14:30:14 server-1 | │ 185 │ │ │ # This allows s │ 2025-01-08 14:30:14 server-1 | │ 186 │ │ │ # to optionally │ 2025-01-08 14:30:14 server-1 | │ ❱ 187 │ │ │ raise exc │ 2025-01-08 14:30:14 server-1 | │ 188 │ │ 2025-01-08 14:30:14 server-1 | │ 189 │ def format_line(self, i │ 2025-01-08 14:30:14 server-1 | │ str: │ 2025-01-08 14:30:14 server-1 | │ 190 │ │ values = { │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/error │ 2025-01-08 14:30:14 server-1 | │ s.py:165 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 162 │ │ │ await send(mess │ 2025-01-08 14:30:14 server-1 | │ 163 │ │ │ 2025-01-08 14:30:14 server-1 | │ 164 │ │ try: │ 2025-01-08 14:30:14 server-1 | │ ❱ 165 │ │ │ await self.app( │ 2025-01-08 14:30:14 server-1 | │ 166 │ │ except Exception as │ 2025-01-08 14:30:14 server-1 | │ 167 │ │ │ request = Reque │ 2025-01-08 14:30:14 server-1 | │ 168 │ │ │ if self.debug: │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/sessi │ 2025-01-08 14:30:14 server-1 | │ ons.py:85 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 82 │ │ │ │ │ headers. │ 2025-01-08 14:30:14 server-1 | │ 83 │ │ │ await send(messa │ 2025-01-08 14:30:14 server-1 | │ 84 │ │ │ 2025-01-08 14:30:14 server-1 | │ ❱ 85 │ │ await self.app(scope │ 2025-01-08 14:30:14 server-1 | │ 86 │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /app/src/khoj/configure.py:351 in │ 2025-01-08 14:30:14 server-1 | │ __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 348 │ │ async def __call__( │ 2025-01-08 14:30:14 server-1 | │ 349 │ │ │ if scope["type" │ 2025-01-08 14:30:14 server-1 | │ 350 │ │ │ │ scope["path │ 2025-01-08 14:30:14 server-1 | │ ❱ 351 │ │ │ await self.app( │ 2025-01-08 14:30:14 server-1 | │ 352 │ │ │ 2025-01-08 14:30:14 server-1 | │ 353 │ │ def __init__(self, │ 2025-01-08 14:30:14 server-1 | │ 354 │ │ │ super().__init_ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/authe │ 2025-01-08 14:30:14 server-1 | │ ntication.py:48 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 45 │ │ if auth_result is No │ 2025-01-08 14:30:14 server-1 | │ 46 │ │ │ auth_result = Au │ 2025-01-08 14:30:14 server-1 | │ 47 │ │ scope["auth"], scope │ 2025-01-08 14:30:14 server-1 | │ ❱ 48 │ │ await self.app(scope │ 2025-01-08 14:30:14 server-1 | │ 49 │ │ 2025-01-08 14:30:14 server-1 | │ 50 │ @staticmethod │ 2025-01-08 14:30:14 server-1 | │ 51 │ def default_on_error(con │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/base. │ 2025-01-08 14:30:14 server-1 | │ py:188 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 185 │ │ with collapse_excgr │ 2025-01-08 14:30:14 server-1 | │ 186 │ │ │ async with anyi │ 2025-01-08 14:30:14 server-1 | │ 187 │ │ │ │ response = │ 2025-01-08 14:30:14 server-1 | │ ❱ 188 │ │ │ │ await respo │ 2025-01-08 14:30:14 server-1 | │ 189 │ │ │ │ response_se │ 2025-01-08 14:30:14 server-1 | │ 190 │ │ 2025-01-08 14:30:14 server-1 | │ 191 │ async def dispatch(self │ 2025-01-08 14:30:14 server-1 | │ Response: │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/base. │ 2025-01-08 14:30:14 server-1 | │ py:222 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 219 │ │ │ } │ 2025-01-08 14:30:14 server-1 | │ 220 │ │ ) │ 2025-01-08 14:30:14 server-1 | │ 221 │ │ │ 2025-01-08 14:30:14 server-1 | │ ❱ 222 │ │ async for chunk in │ 2025-01-08 14:30:14 server-1 | │ 223 │ │ │ await send({"ty │ 2025-01-08 14:30:14 server-1 | │ 224 │ │ │ 2025-01-08 14:30:14 server-1 | │ 225 │ │ await send({"type": │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/base. │ 2025-01-08 14:30:14 server-1 | │ py:179 in body_stream │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 176 │ │ │ │ │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 177 │ │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 178 │ │ │ │ if app_exc │ 2025-01-08 14:30:14 server-1 | │ ❱ 179 │ │ │ │ │ raise a │ 2025-01-08 14:30:14 server-1 | │ 180 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 181 │ │ │ response = _Str │ 2025-01-08 14:30:14 server-1 | │ content=body_stream(), info │ 2025-01-08 14:30:14 server-1 | │ 182 │ │ │ response.raw_he │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/base. │ 2025-01-08 14:30:14 server-1 | │ py:149 in coro │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 146 │ │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 147 │ │ │ │ async with │ 2025-01-08 14:30:14 server-1 | │ 148 │ │ │ │ │ try: │ 2025-01-08 14:30:14 server-1 | │ ❱ 149 │ │ │ │ │ │ awa │ 2025-01-08 14:30:14 server-1 | │ 150 │ │ │ │ │ except │ 2025-01-08 14:30:14 server-1 | │ 151 │ │ │ │ │ │ app │ 2025-01-08 14:30:14 server-1 | │ 152 │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/cors. │ 2025-01-08 14:30:14 server-1 | │ py:93 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 90 │ │ │ await response( │ 2025-01-08 14:30:14 server-1 | │ 91 │ │ │ return │ 2025-01-08 14:30:14 server-1 | │ 92 │ │ │ 2025-01-08 14:30:14 server-1 | │ ❱ 93 │ │ await self.simple_r │ 2025-01-08 14:30:14 server-1 | │ 94 │ │ 2025-01-08 14:30:14 server-1 | │ 95 │ def is_allowed_origin(s │ 2025-01-08 14:30:14 server-1 | │ 96 │ │ if self.allow_all_o │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/cors. │ 2025-01-08 14:30:14 server-1 | │ py:144 in simple_response │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 141 │ │ 2025-01-08 14:30:14 server-1 | │ 142 │ async def simple_respon │ 2025-01-08 14:30:14 server-1 | │ request_headers: Headers) - │ 2025-01-08 14:30:14 server-1 | │ 143 │ │ send = functools.pa │ 2025-01-08 14:30:14 server-1 | │ ❱ 144 │ │ await self.app(scop │ 2025-01-08 14:30:14 server-1 | │ 145 │ │ 2025-01-08 14:30:14 server-1 | │ 146 │ async def send(self, me │ 2025-01-08 14:30:14 server-1 | │ None: │ 2025-01-08 14:30:14 server-1 | │ 147 │ │ if message["type"] │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/middleware/excep │ 2025-01-08 14:30:14 server-1 | │ tions.py:62 in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 59 │ │ else: │ 2025-01-08 14:30:14 server-1 | │ 60 │ │ │ conn = WebSocket │ 2025-01-08 14:30:14 server-1 | │ 61 │ │ │ 2025-01-08 14:30:14 server-1 | │ ❱ 62 │ │ await wrap_app_handl │ 2025-01-08 14:30:14 server-1 | │ 63 │ │ 2025-01-08 14:30:14 server-1 | │ 64 │ def http_exception(self, │ 2025-01-08 14:30:14 server-1 | │ 65 │ │ assert isinstance(ex │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/_exception_handl │ 2025-01-08 14:30:14 server-1 | │ er.py:53 in wrapped_app │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 50 │ │ │ │ handler = _l │ 2025-01-08 14:30:14 server-1 | │ 51 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 52 │ │ │ if handler is No │ 2025-01-08 14:30:14 server-1 | │ ❱ 53 │ │ │ │ raise exc │ 2025-01-08 14:30:14 server-1 | │ 54 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 55 │ │ │ if response_star │ 2025-01-08 14:30:14 server-1 | │ 56 │ │ │ │ raise Runtim │ 2025-01-08 14:30:14 server-1 | │ started.") from exc │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/_exception_handl │ 2025-01-08 14:30:14 server-1 | │ er.py:42 in wrapped_app │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 39 │ │ │ await send(messa │ 2025-01-08 14:30:14 server-1 | │ 40 │ │ │ 2025-01-08 14:30:14 server-1 | │ 41 │ │ try: │ 2025-01-08 14:30:14 server-1 | │ ❱ 42 │ │ │ await app(scope, │ 2025-01-08 14:30:14 server-1 | │ 43 │ │ except Exception as │ 2025-01-08 14:30:14 server-1 | │ 44 │ │ │ handler = None │ 2025-01-08 14:30:14 server-1 | │ 45 │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/routing.py:715 │ 2025-01-08 14:30:14 server-1 | │ in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 712 │ │ """ │ 2025-01-08 14:30:14 server-1 | │ 713 │ │ The main entry poin │ 2025-01-08 14:30:14 server-1 | │ 714 │ │ """ │ 2025-01-08 14:30:14 server-1 | │ ❱ 715 │ │ await self.middlewa │ 2025-01-08 14:30:14 server-1 | │ 716 │ │ 2025-01-08 14:30:14 server-1 | │ 717 │ async def app(self, sco │ 2025-01-08 14:30:14 server-1 | │ 718 │ │ assert scope["type" │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/routing.py:735 │ 2025-01-08 14:30:14 server-1 | │ in app │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 732 │ │ │ match, child_sc │ 2025-01-08 14:30:14 server-1 | │ 733 │ │ │ if match == Mat │ 2025-01-08 14:30:14 server-1 | │ 734 │ │ │ │ scope.updat │ 2025-01-08 14:30:14 server-1 | │ ❱ 735 │ │ │ │ await route │ 2025-01-08 14:30:14 server-1 | │ 736 │ │ │ │ return │ 2025-01-08 14:30:14 server-1 | │ 737 │ │ │ elif match == M │ 2025-01-08 14:30:14 server-1 | │ 738 │ │ │ │ partial = r │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/routing.py:288 │ 2025-01-08 14:30:14 server-1 | │ in handle │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 285 │ │ │ │ response = │ 2025-01-08 14:30:14 server-1 | │ headers=headers) │ 2025-01-08 14:30:14 server-1 | │ 286 │ │ │ await response( │ 2025-01-08 14:30:14 server-1 | │ 287 │ │ else: │ 2025-01-08 14:30:14 server-1 | │ ❱ 288 │ │ │ await self.app( │ 2025-01-08 14:30:14 server-1 | │ 289 │ │ 2025-01-08 14:30:14 server-1 | │ 290 │ def __eq__(self, other: │ 2025-01-08 14:30:14 server-1 | │ 291 │ │ return ( │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/routing.py:76 in │ 2025-01-08 14:30:14 server-1 | │ app │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 73 │ │ │ response = awai │ 2025-01-08 14:30:14 server-1 | │ 74 │ │ │ await response( │ 2025-01-08 14:30:14 server-1 | │ 75 │ │ │ 2025-01-08 14:30:14 server-1 | │ ❱ 76 │ │ await wrap_app_hand │ 2025-01-08 14:30:14 server-1 | │ 77 │ │ 2025-01-08 14:30:14 server-1 | │ 78 │ return app │ 2025-01-08 14:30:14 server-1 | │ 79 │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/_exception_handl │ 2025-01-08 14:30:14 server-1 | │ er.py:53 in wrapped_app │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 50 │ │ │ │ handler = _l │ 2025-01-08 14:30:14 server-1 | │ 51 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 52 │ │ │ if handler is No │ 2025-01-08 14:30:14 server-1 | │ ❱ 53 │ │ │ │ raise exc │ 2025-01-08 14:30:14 server-1 | │ 54 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 55 │ │ │ if response_star │ 2025-01-08 14:30:14 server-1 | │ 56 │ │ │ │ raise Runtim │ 2025-01-08 14:30:14 server-1 | │ started.") from exc │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/_exception_handl │ 2025-01-08 14:30:14 server-1 | │ er.py:42 in wrapped_app │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 39 │ │ │ await send(messa │ 2025-01-08 14:30:14 server-1 | │ 40 │ │ │ 2025-01-08 14:30:14 server-1 | │ 41 │ │ try: │ 2025-01-08 14:30:14 server-1 | │ ❱ 42 │ │ │ await app(scope, │ 2025-01-08 14:30:14 server-1 | │ 43 │ │ except Exception as │ 2025-01-08 14:30:14 server-1 | │ 44 │ │ │ handler = None │ 2025-01-08 14:30:14 server-1 | │ 45 │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/routing.py:74 in │ 2025-01-08 14:30:14 server-1 | │ app │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 71 │ │ │ 2025-01-08 14:30:14 server-1 | │ 72 │ │ async def app(scope │ 2025-01-08 14:30:14 server-1 | │ 73 │ │ │ response = awai │ 2025-01-08 14:30:14 server-1 | │ ❱ 74 │ │ │ await response( │ 2025-01-08 14:30:14 server-1 | │ 75 │ │ │ 2025-01-08 14:30:14 server-1 | │ 76 │ │ await wrap_app_hand │ 2025-01-08 14:30:14 server-1 | │ 77 │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/responses.py:252 │ 2025-01-08 14:30:14 server-1 | │ in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 249 │ │ await send({"type": │ 2025-01-08 14:30:14 server-1 | │ 250 │ │ 2025-01-08 14:30:14 server-1 | │ 251 │ async def __call__(self │ 2025-01-08 14:30:14 server-1 | │ ❱ 252 │ │ async with anyio.cr │ 2025-01-08 14:30:14 server-1 | │ 253 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 254 │ │ │ async def wrap( │ 2025-01-08 14:30:14 server-1 | │ 255 │ │ │ │ await func( │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/anyio/_backends/_asyncio.p │ 2025-01-08 14:30:14 server-1 | │ y:597 in __aexit__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 594 │ │ │ │ else: │ 2025-01-08 14:30:14 server-1 | │ 595 │ │ │ │ │ raise │ 2025-01-08 14:30:14 server-1 | │ 596 │ │ │ elif exception │ 2025-01-08 14:30:14 server-1 | │ ❱ 597 │ │ │ │ raise exce │ 2025-01-08 14:30:14 server-1 | │ 598 │ │ except BaseExcepti │ 2025-01-08 14:30:14 server-1 | │ 599 │ │ │ # Clear the co │ 2025-01-08 14:30:14 server-1 | │ 600 │ │ │ # If the conte │ 2025-01-08 14:30:14 server-1 | │ #145). │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/responses.py:255 │ 2025-01-08 14:30:14 server-1 | │ in wrap │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 252 │ │ async with anyio.cr │ 2025-01-08 14:30:14 server-1 | │ 253 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 254 │ │ │ async def wrap( │ 2025-01-08 14:30:14 server-1 | │ ❱ 255 │ │ │ │ await func( │ 2025-01-08 14:30:14 server-1 | │ 256 │ │ │ │ task_group. │ 2025-01-08 14:30:14 server-1 | │ 257 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 258 │ │ │ task_group.star │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/starlette/responses.py:244 │ 2025-01-08 14:30:14 server-1 | │ in stream_response │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 241 │ │ │ │ "headers": │ 2025-01-08 14:30:14 server-1 | │ 242 │ │ │ } │ 2025-01-08 14:30:14 server-1 | │ 243 │ │ ) │ 2025-01-08 14:30:14 server-1 | │ ❱ 244 │ │ async for chunk in │ 2025-01-08 14:30:14 server-1 | │ 245 │ │ │ if not isinstan │ 2025-01-08 14:30:14 server-1 | │ 246 │ │ │ │ chunk = chu │ 2025-01-08 14:30:14 server-1 | │ 247 │ │ │ await send({"ty │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /app/src/khoj/routers/api_chat.py │ 2025-01-08 14:30:14 server-1 | │ :788 in event_generator │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 785 │ │ program_execution_ │ 2025-01-08 14:30:14 server-1 | │ 786 │ │ │ 2025-01-08 14:30:14 server-1 | │ 787 │ │ if conversation_co │ 2025-01-08 14:30:14 server-1 | │ ❱ 788 │ │ │ chosen_io = aw │ 2025-01-08 14:30:14 server-1 | │ 789 │ │ │ │ q, │ 2025-01-08 14:30:14 server-1 | │ 790 │ │ │ │ meta_log, │ 2025-01-08 14:30:14 server-1 | │ 791 │ │ │ │ is_automat │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /app/src/khoj/routers/helpers.py: │ 2025-01-08 14:30:14 server-1 | │ 396 in │ 2025-01-08 14:30:14 server-1 | │ aget_data_sources_and_output_form │ 2025-01-08 14:30:14 server-1 | │ at │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 393 │ ) │ 2025-01-08 14:30:14 server-1 | │ 394 │ │ 2025-01-08 14:30:14 server-1 | │ 395 │ with timer("Chat actor │ 2025-01-08 14:30:14 server-1 | │ ❱ 396 │ │ response = await s │ 2025-01-08 14:30:14 server-1 | │ 397 │ │ │ relevant_tools │ 2025-01-08 14:30:14 server-1 | │ 398 │ │ │ response_type= │ 2025-01-08 14:30:14 server-1 | │ 399 │ │ │ user=user, │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /app/src/khoj/routers/helpers.py: │ 2025-01-08 14:30:14 server-1 | │ 1035 in │ 2025-01-08 14:30:14 server-1 | │ send_message_to_model_wrapper │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 1032 │ │ │ query_files=qu │ 2025-01-08 14:30:14 server-1 | │ 1033 │ │ ) │ 2025-01-08 14:30:14 server-1 | │ 1034 │ │ │ 2025-01-08 14:30:14 server-1 | │ ❱ 1035 │ │ return send_messag │ 2025-01-08 14:30:14 server-1 | │ 1036 │ │ │ messages=trunc │ 2025-01-08 14:30:14 server-1 | │ 1037 │ │ │ api_key=api_ke │ 2025-01-08 14:30:14 server-1 | │ 1038 │ │ │ model=chat_mod │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /app/src/khoj/processor/conversat │ 2025-01-08 14:30:14 server-1 | │ ion/openai/gpt.py:129 in │ 2025-01-08 14:30:14 server-1 | │ send_message_to_model │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 126 │ """ │ 2025-01-08 14:30:14 server-1 | │ 127 │ │ 2025-01-08 14:30:14 server-1 | │ 128 │ # Get Response from GPT │ 2025-01-08 14:30:14 server-1 | │ ❱ 129 │ return completion_with_ │ 2025-01-08 14:30:14 server-1 | │ 130 │ │ messages=messages, │ 2025-01-08 14:30:14 server-1 | │ 131 │ │ model_name=model, │ 2025-01-08 14:30:14 server-1 | │ 132 │ │ openai_api_key=api_ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/tenacity/__init__.py:330 │ 2025-01-08 14:30:14 server-1 | │ in wrapped_f │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 327 │ │ │ f, functools.WR │ 2025-01-08 14:30:14 server-1 | │ 328 │ │ ) │ 2025-01-08 14:30:14 server-1 | │ 329 │ │ def wrapped_f(*args │ 2025-01-08 14:30:14 server-1 | │ ❱ 330 │ │ │ return self(f, │ 2025-01-08 14:30:14 server-1 | │ 331 │ │ │ 2025-01-08 14:30:14 server-1 | │ 332 │ │ def retry_with(*arg │ 2025-01-08 14:30:14 server-1 | │ 333 │ │ │ return self.cop │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/tenacity/__init__.py:467 │ 2025-01-08 14:30:14 server-1 | │ in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 464 │ │ │ 2025-01-08 14:30:14 server-1 | │ 465 │ │ retry_state = Retry │ 2025-01-08 14:30:14 server-1 | │ 466 │ │ while True: │ 2025-01-08 14:30:14 server-1 | │ ❱ 467 │ │ │ do = self.iter( │ 2025-01-08 14:30:14 server-1 | │ 468 │ │ │ if isinstance(d │ 2025-01-08 14:30:14 server-1 | │ 469 │ │ │ │ try: │ 2025-01-08 14:30:14 server-1 | │ 470 │ │ │ │ │ result │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/tenacity/__init__.py:368 │ 2025-01-08 14:30:14 server-1 | │ in iter │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 365 │ │ self._begin_iter(re │ 2025-01-08 14:30:14 server-1 | │ 366 │ │ result = None │ 2025-01-08 14:30:14 server-1 | │ 367 │ │ for action in self. │ 2025-01-08 14:30:14 server-1 | │ ❱ 368 │ │ │ result = action │ 2025-01-08 14:30:14 server-1 | │ 369 │ │ return result │ 2025-01-08 14:30:14 server-1 | │ 370 │ │ 2025-01-08 14:30:14 server-1 | │ 371 │ def _begin_iter(self, r │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/tenacity/__init__.py:410 │ 2025-01-08 14:30:14 server-1 | │ in exc_check │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 407 │ │ │ │ fut = t.cas │ 2025-01-08 14:30:14 server-1 | │ 408 │ │ │ │ retry_exc = │ 2025-01-08 14:30:14 server-1 | │ 409 │ │ │ │ if self.rer │ 2025-01-08 14:30:14 server-1 | │ ❱ 410 │ │ │ │ │ raise r │ 2025-01-08 14:30:14 server-1 | │ 411 │ │ │ │ raise retry │ 2025-01-08 14:30:14 server-1 | │ 412 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 413 │ │ │ self._add_actio │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/tenacity/__init__.py:183 │ 2025-01-08 14:30:14 server-1 | │ in reraise │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 180 │ │ 2025-01-08 14:30:14 server-1 | │ 181 │ def reraise(self) -> t. │ 2025-01-08 14:30:14 server-1 | │ 182 │ │ if self.last_attemp │ 2025-01-08 14:30:14 server-1 | │ ❱ 183 │ │ │ raise self.last │ 2025-01-08 14:30:14 server-1 | │ 184 │ │ raise self │ 2025-01-08 14:30:14 server-1 | │ 185 │ │ 2025-01-08 14:30:14 server-1 | │ 186 │ def __str__(self) -> st │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/lib/python3.10/concurrent/fu │ 2025-01-08 14:30:14 server-1 | │ tures/_base.py:451 in result │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 448 │ │ │ │ if self._st │ 2025-01-08 14:30:14 server-1 | │ 449 │ │ │ │ │ raise C │ 2025-01-08 14:30:14 server-1 | │ 450 │ │ │ │ elif self._ │ 2025-01-08 14:30:14 server-1 | │ ❱ 451 │ │ │ │ │ return │ 2025-01-08 14:30:14 server-1 | │ 452 │ │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 453 │ │ │ │ self._condi │ 2025-01-08 14:30:14 server-1 | │ 454 │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/lib/python3.10/concurrent/fu │ 2025-01-08 14:30:14 server-1 | │ tures/_base.py:403 in │ 2025-01-08 14:30:14 server-1 | │ __get_result │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 400 │ def __get_result(self): │ 2025-01-08 14:30:14 server-1 | │ 401 │ │ if self._exception: │ 2025-01-08 14:30:14 server-1 | │ 402 │ │ │ try: │ 2025-01-08 14:30:14 server-1 | │ ❱ 403 │ │ │ │ raise self. │ 2025-01-08 14:30:14 server-1 | │ 404 │ │ │ finally: │ 2025-01-08 14:30:14 server-1 | │ 405 │ │ │ │ # Break a r │ 2025-01-08 14:30:14 server-1 | │ 406 │ │ │ │ self = None │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/tenacity/__init__.py:470 │ 2025-01-08 14:30:14 server-1 | │ in __call__ │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 467 │ │ │ do = self.iter( │ 2025-01-08 14:30:14 server-1 | │ 468 │ │ │ if isinstance(d │ 2025-01-08 14:30:14 server-1 | │ 469 │ │ │ │ try: │ 2025-01-08 14:30:14 server-1 | │ ❱ 470 │ │ │ │ │ result │ 2025-01-08 14:30:14 server-1 | │ 471 │ │ │ │ except Base │ 2025-01-08 14:30:14 server-1 | │ 472 │ │ │ │ │ retry_s │ 2025-01-08 14:30:14 server-1 | │ 473 │ │ │ │ else: │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /app/src/khoj/processor/conversat │ 2025-01-08 14:30:14 server-1 | │ ion/openai/utils.py:77 in │ 2025-01-08 14:30:14 server-1 | │ completion_with_backoff │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 74 │ if os.getenv("KHOJ_LLM_ │ 2025-01-08 14:30:14 server-1 | │ 75 │ │ model_kwargs["seed" │ 2025-01-08 14:30:14 server-1 | │ 76 │ │ 2025-01-08 14:30:14 server-1 | │ ❱ 77 │ chat: ChatCompletion | │ 2025-01-08 14:30:14 server-1 | │ client.chat.completions.cre │ 2025-01-08 14:30:14 server-1 | │ 78 │ │ messages=formatted_ │ 2025-01-08 14:30:14 server-1 | │ 79 │ │ model=model_name, │ 2025-01-08 14:30:14 server-1 | │ 80 │ │ stream=stream, │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/openai/_utils/_utils.py:27 │ 2025-01-08 14:30:14 server-1 | │ 9 in wrapper │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 276 │ │ │ │ │ else: │ 2025-01-08 14:30:14 server-1 | │ 277 │ │ │ │ │ │ msg │ 2025-01-08 14:30:14 server-1 | │ 278 │ │ │ │ raise TypeE │ 2025-01-08 14:30:14 server-1 | │ ❱ 279 │ │ │ return func(*ar │ 2025-01-08 14:30:14 server-1 | │ 280 │ │ │ 2025-01-08 14:30:14 server-1 | │ 281 │ │ return wrapper # t │ 2025-01-08 14:30:14 server-1 | │ 282 │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/openai/resources/chat/comp │ 2025-01-08 14:30:14 server-1 | │ letions.py:859 in create │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 856 │ │ timeout: float | h │ 2025-01-08 14:30:14 server-1 | │ 857 │ ) -> ChatCompletion | │ 2025-01-08 14:30:14 server-1 | │ 858 │ │ validate_response_ │ 2025-01-08 14:30:14 server-1 | │ ❱ 859 │ │ return self._post( │ 2025-01-08 14:30:14 server-1 | │ 860 │ │ │ "/chat/complet │ 2025-01-08 14:30:14 server-1 | │ 861 │ │ │ body=maybe_tra │ 2025-01-08 14:30:14 server-1 | │ 862 │ │ │ │ { │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/openai/_base_client.py:128 │ 2025-01-08 14:30:14 server-1 | │ 0 in post │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 1277 │ │ opts = FinalReques │ 2025-01-08 14:30:14 server-1 | │ 1278 │ │ │ method="post", │ 2025-01-08 14:30:14 server-1 | │ **options │ 2025-01-08 14:30:14 server-1 | │ 1279 │ │ ) │ 2025-01-08 14:30:14 server-1 | │ ❱ 1280 │ │ return cast(Respon │ 2025-01-08 14:30:14 server-1 | │ stream_cls=stream_cls)) │ 2025-01-08 14:30:14 server-1 | │ 1281 │ │ 2025-01-08 14:30:14 server-1 | │ 1282 │ def patch( │ 2025-01-08 14:30:14 server-1 | │ 1283 │ │ self, │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/openai/_base_client.py:957 │ 2025-01-08 14:30:14 server-1 | │ in request │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 954 │ │ else: │ 2025-01-08 14:30:14 server-1 | │ 955 │ │ │ retries_taken │ 2025-01-08 14:30:14 server-1 | │ 956 │ │ │ 2025-01-08 14:30:14 server-1 | │ ❱ 957 │ │ return self._reque │ 2025-01-08 14:30:14 server-1 | │ 958 │ │ │ cast_to=cast_t │ 2025-01-08 14:30:14 server-1 | │ 959 │ │ │ options=option │ 2025-01-08 14:30:14 server-1 | │ 960 │ │ │ stream=stream, │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ /usr/local/lib/python3.10/dist-pa │ 2025-01-08 14:30:14 server-1 | │ ckages/openai/_base_client.py:106 │ 2025-01-08 14:30:14 server-1 | │ 1 in _request │ 2025-01-08 14:30:14 server-1 | │ │ 2025-01-08 14:30:14 server-1 | │ 1058 │ │ │ │ err.respon │ 2025-01-08 14:30:14 server-1 | │ 1059 │ │ │ │ 2025-01-08 14:30:14 server-1 | │ 1060 │ │ │ log.debug("Re- │ 2025-01-08 14:30:14 server-1 | │ ❱ 1061 │ │ │ raise self._ma │ 2025-01-08 14:30:14 server-1 | │ 1062 │ │ │ 2025-01-08 14:30:14 server-1 | │ 1063 │ │ return self._proce │ 2025-01-08 14:30:14 server-1 | │ 1064 │ │ │ cast_to=cast_t │ 2025-01-08 14:30:14 server-1 | ╰───────────────────────────────────╯ 2025-01-08 14:30:14 server-1 | APIStatusError: <html> 2025-01-08 14:30:14 server-1 | <head><title>405 Not 2025-01-08 14:30:14 server-1 | Allowed</title></head> 2025-01-08 14:30:14 server-1 | <body> 2025-01-08 14:30:14 server-1 | <center><h1>405 Not 2025-01-08 14:30:14 server-1 | Allowed</h1></center> 2025-01-08 14:30:14 server-1 | <hr><center>openresty</center> 2025-01-08 14:30:14 server-1 | </body> 2025-01-08 14:30:14 server-1 | </html> 2025-01-08 14:30:48 server-1 | [19:30:48.659976] INFO uvicorn.access: 172.24.0.1:55720 - h11_impl.py:476 2025-01-08 14:30:48 server-1 | "GET /api/chat/sessions HTTP/1.1" 200 2025-01-08 14:30:48 server-1 | [19:30:48.661950] INFO uvicorn.access: 172.24.0.1:55740 - h11_impl.py:476 2025-01-08 14:30:48 server-1 | "GET /api/content/computer HTTP/1.1" 2025-01-08 14:30:48 server-1 | 200 2025-01-08 14:30:48 server-1 | [19:30:48.677768] INFO uvicorn.access: 172.24.0.1:55740 - h11_impl.py:476 2025-01-08 14:30:48 server-1 | "GET 2025-01-08 14:30:48 server-1 | /chat.txt?conversationId=db1204d5-ee0 2025-01-08 14:30:48 server-1 | f-4834-946f-008ebd9b7dd4&_rsc=1ivqj 2025-01-08 14:30:48 server-1 | HTTP/1.1" 404 2025-01-08 14:30:55 server-1 | [19:30:55.964166] INFO uvicorn.access: 172.24.0.1:45836 - h11_impl.py:476 2025-01-08 14:30:55 server-1 | "GET 2025-01-08 14:30:55 server-1 | /server/admin/database/chatmodel/15/c 2025-01-08 14:30:55 server-1 | hange/ HTTP/1.1" 200 2025-01-08 14:30:56 server-1 | [19:30:55.998522] INFO uvicorn.access: 172.24.0.1:45836 - h11_impl.py:476 2025-01-08 14:30:56 server-1 | "GET /server/admin/jsi18n/ HTTP/1.1" 2025-01-08 14:30:56 server-1 | 200 2025-01-08 14:30:56 server-1 | [19:30:56.032911] INFO uvicorn.access: 172.24.0.1:45836 - h11_impl.py:476 2025-01-08 14:30:56 server-1 | "GET 2025-01-08 14:30:56 server-1 | /static/unfold/fonts/material-symbols 2025-01-08 14:30:56 server-1 | /Material-Symbols-Outlined.woff2 2025-01-08 14:30:56 server-1 | HTTP/1.1" 304 2025-01-08 14:30:56 server-1 | [19:30:56.037723] INFO uvicorn.access: 172.24.0.1:45852 - h11_impl.py:476 2025-01-08 14:30:56 server-1 | "GET 2025-01-08 14:30:56 server-1 | /static/unfold/fonts/inter/Inter-Semi 2025-01-08 14:30:56 server-1 | Bold.woff2 HTTP/1.1" 304 2025-01-08 14:30:56 server-1 | [19:30:56.050847] INFO uvicorn.access: 172.24.0.1:45836 - h11_impl.py:476 2025-01-08 14:30:56 server-1 | "GET 2025-01-08 14:30:56 server-1 | /static/unfold/fonts/inter/Inter-Regu 2025-01-08 14:30:56 server-1 | lar.woff2 HTTP/1.1" 304 2025-01-08 14:30:56 server-1 | [19:30:56.053684] INFO uvicorn.access: 172.24.0.1:45852 - h11_impl.py:476 2025-01-08 14:30:56 server-1 | "GET 2025-01-08 14:30:56 server-1 | /static/unfold/fonts/inter/Inter-Medi 2025-01-08 14:30:56 server-1 | um.woff2 HTTP/1.1" 304

@debanjum debanjum changed the title [FIX] khoj.processor.conversation.utils:utils.py:Fallback to default chat model tokenizer: gpt-4o. Configure tokenizer for model: [FIX] Chat with LMStudio Hosted Model via Khoj Docker on Windows Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix something that isn't working as expected
Projects
None yet
Development

No branches or pull requests

1 participant