La función de resumen de temas no funciona :(

Hola chicos,

Esto es sobre una instancia autoalojada

He activado el plugin Discourse AI y he tenido algunos problemas.
Trabajando en un entorno empresarial y el acceso a IA es a través de un endpoint interno con autenticación adicional.
Implementé un endpoint de AWS API Gateway con una Lambda, que se encarga de enriquecer las cabeceras con la información de autenticación requerida y pasar la solicitud al endpoint interno compatible con OPENAI.

La prueba de LLM me da un

y pensé que estaba listo para empezar.

También veo las llamadas relacionadas en mis CloudWatch Logs para la llamada al API Gateway.

Luego relacioné las Personas de Resumen (Resumen y … (forma corta) con este LLM y activé la Resumen de Temas.

Lo que estoy viendo ahora, sin embargo, no es lo que quería ver :smiley:

Y eso no está cambiando :frowning:

Lo más extraño es que no veo una solicitud en CloudWatch Logs para el intento de resumir.

Ok, de nuevo lo que hice.

  • Activé IA
  • Creé vLLM con mi endpoint de API Gateway
  • Creé 2 Personas (ver arriba) y las relacioné con mi configuración de LLM
  • Activé Resumen y relacioné allí la Persona (probé ambas)

No estoy seguro de qué más puedo intentar :frowning:

Gracias chicos y saludos,

JP

[cita=“Wurzelseppi, post:1, topic:367880”]
El acceso a la IA es a través de un punto final interno con autenticación adicional.
[/cita]

Nuestro punto final de prueba es un poco engañoso y esto es algo que me gustaría solucionar.

Actualmente solo probamos puntos finales “no streaming”. No se prueba el “streaming”.

¿Funciona todo si deshabilitas el streaming en tu LLM (modelo de lenguaje grande), tal vez no esté implementado por tu proxy?

Hola @sam,

Desactivé la transmisión (codificada) en mi LAMBDA al pasar la solicitud.

El caso es que la LAMBDA ni siquiera se activa con la API de resumen (no veo ninguna solicitud).

La prueba LLM realiza una llamada, pero el botón de resumen en un tema no lo hace.

Nada, ningún error (activé el nivel de depuración con DISCOURSE_LOG_LEVEL=debug) en el registro de discourse, ni ningún registro en mi LAMBDA (CloudWatch).

Es como si no hubiera presionado nada :frowning:

Gracias y saludos,

Julian

¿Por qué el proveedor está configurado como vLLM si es un endpoint compatible con OpenAI?

1 me gusta

Hi,

I´ve tried many different engines. Sorry, the screenshot was misleading. I´ve tried OpenAI also …

This is the answer from the endpoint which I send 1:1 back to discourse instance.
With this I´m getting an “Internal Server Error” @ discourse (not sure why, because the test worked until this morning :smiley: )

{
  "statusCode": 200,
  "headers": {
    "date": "Mon, 02 Jun 2025 05:57:44 GMT",
    "content-type": "application/json",
    "content-length": "1315",
    "x-content-type-options": "nosniff",
    "x-frame-options": "DENY",
    "strict-transport-security": "max-age=63072000; includeSubdomains; preload",
    "content-security-policy": "default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'",
    "referrer-policy": "no-referrer",
    "x-xss-protection": "0",
    "x-request-id": "02d33931-1e29-418e-b9a7-4eba07710e8e",
    "x-accel-buffering": "no",
    "via": "1.1 google"
  },
  "body": {
    "id": "24c1474f-bd51-4542-b87a-8608fd90b5fb",
    "choices": [
      {
        "finish_reason": "stop",
        "index": 0,
        "logprobs": null,
        "message": {
          "content": "1 + 1 equals 2.",
          "refusal": null,
          "role": "assistant",
          "annotations": [],
          "audio": null,
          "function_call": null,
          "tool_calls": null,
          "reasoning_content": null
        },
        "content_filter_results": {
          "hate": {
            "filtered": false,
            "severity": "safe"
          },
          "profanity": {
            "filtered": false,
            "detected": false
          },
          "protected_material_code": {
            "filtered": false,
            "detected": false
          },
          "protected_material_text": {
            "filtered": false,
            "detected": false
          },
          "self_harm": {
            "filtered": false,
            "severity": "safe"
          },
          "sexual": {
            "filtered": false,
            "severity": "safe"
          },
          "violence": {
            "filtered": false,
            "severity": "safe"
          }
        }
      }
    ],
    "created": 1748843864,
    "model": "openai/gpt-4o",
    "object": "chat.completion",
    "usage": {
      "prompt_tokens": 25,
      "completion_tokens": 9,
      "total_tokens": 34,
      "prompt_tokens_details": {
        "audio_tokens": 0,
        "cached_tokens": 0
      },
      "completion_tokens_details": {
        "accepted_prediction_tokens": 0,
        "audio_tokens": 0,
        "reasoning_tokens": 0,
        "rejected_prediction_tokens": 0,
        "cached_tokens": 0
      }
    },
    "cost": {
      "interaction": {
        "prompt_tokens": 0.0000688,
        "prompt_tokens_details": {
          "standard": 0.0000688,
          "cached": 0
        },
        "completion_tokens": 0.000099,
        "completion_tokens_details": {
          "standard": 0.000099,
          "reasoning": 0,
          "cached": 0
        },
        "total": 0.0001678,
        "currency": "USD"
      },
      "integrations": {},
      "total": 0.0001678,
      "currency": "USD"
    }
  }
}

@ discourse logs:

 Back to site
DiscourseAi::Completions::Endpoints::Vllm: status: 502 - body: {"message": "Internal server error"}
8:07 am
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:134:in `block in error' 
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `block in dispatch' 
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `each' 
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `dispatch' 
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:134:in `error' 
/var/www/discourse/plugins/discourse-ai/lib/completions/endpoints/base.rb:160:in `block (2 levels) in perform_completion!' 
net-http-0.6.0/lib/net/http.rb:2433:in `block in transport_request' 
net-http-0.6.0/lib/net/http/response.rb:320:in `reading_body' 
net-http-0.6.0/lib/net/http.rb:2430:in `transport_request' 
net-http-0.6.0/lib/net/http.rb:2384:in `request' 
rack-mini-profiler-3.3.1/lib/patches/net_patches.rb:19:in `block in request_with_mini_profiler' 
rack-mini-profiler-3.3.1/lib/mini_profiler/profiling_methods.rb:50:in `step' 
rack-mini-profiler-3.3.1/lib/patches/net_patches.rb:18:in `request_with_mini_profiler' 
/var/www/discourse/plugins/discourse-ai/lib/completions/endpoints/base.rb:158:in `block in perform_completion!' 
net-http-0.6.0/lib/net/http.rb:1632:in `start' 
net-http-0.6.0/lib/net/http.rb:1070:in `start' 
/var/www/discourse/plugins/discourse-ai/lib/completions/endpoints/base.rb:129:in `perform_completion!' 
/var/www/discourse/plugins/discourse-ai/lib/completions/llm.rb:374:in `generate' 
/var/www/discourse/plugins/discourse-ai/lib/configuration/llm_validator.rb:36:in `run_test' 
/var/www/discourse/plugins/discourse-ai/app/controllers/discourse_ai/admin/ai_llms_controller.rb:128:in `test' 
actionpack-7.2.2.1/lib/action_controller/metal/basic_implicit_render.rb:8:in `send_action' 
actionpack-7.2.2.1/lib/abstract_controller/base.rb:226:in `process_action' 
actionpack-7.2.2.1/lib/action_controller/metal/rendering.rb:193:in `process_action' 
actionpack-7.2.2.1/lib/abstract_controller/callbacks.rb:261:in `block in process_action' 
activesupport-7.2.2.1/lib/active_support/callbacks.rb:121:in `block in run_callbacks' 
/var/www/discourse/app/controllers/application_controller.rb:428:in `block in with_resolved_locale' 
i18n-1.14.7/lib/i18n.rb:353:in `with_locale' 
/var/www/discourse/app/controllers/application_controller.rb:428:in `with_resolved_locale' 
activesupport-7.2.2.1/lib/active_support/callbacks.rb:130:in `block in run_callbacks' 
activesupport-7.2.2.1/lib/active_support/callbacks.rb:141:in `run_callbacks' 
actionpack-7.2.2.1/lib/abstract_controller/callbacks.rb:260:in `process_action' 
actionpack-7.2.2.1/lib/action_controller/metal/rescue.rb:27:in `process_action' 
actionpack-7.2.2.1/lib/action_controller/metal/instrumentation.rb:77:in `block in process_action' 
activesupport-7.2.2.1/lib/active_support/notifications.rb:210:in `block in instrument' 
activesupport-7.2.2.1/lib/active_support/notifications/instrumenter.rb:58:in `instrument' 
activesupport-7.2.2.1/lib/active_support/notifications.rb:210:in `instrument' 
actionpack-7.2.2.1/lib/action_controller/metal/instrumentation.rb:76:in `process_action' 
actionpack-7.2.2.1/lib/action_controller/metal/params_wrapper.rb:259:in `process_action' 
activerecord-7.2.2.1/lib/active_record/railties/controller_runtime.rb:39:in `process_action' 
actionpack-7.2.2.1/lib/abstract_controller/base.rb:163:in `process' 
actionview-7.2.2.1/lib/action_view/rendering.rb:40:in `process' 
rack-mini-profiler-3.3.1/lib/mini_profiler/profiling_methods.rb:89:in `block in profile_method' 
actionpack-7.2.2.1/lib/action_controller/metal.rb:252:in `dispatch' 
actionpack-7.2.2.1/lib/action_controller/metal.rb:335:in `dispatch' 
actionpack-7.2.2.1/lib/action_dispatch/routing/route_set.rb:67:in `dispatch' 
actionpack-7.2.2.1/lib/action_dispatch/routing/route_set.rb:50:in `serve' 
actionpack-7.2.2.1/lib/action_dispatch/routing/mapper.rb:32:in `block in <class:Constraints>' 
actionpack-7.2.2.1/lib/action_dispatch/routing/mapper.rb:62:in `serve' 
actionpack-7.2.2.1/lib/action_dispatch/journey/router.rb:53:in `block in serve' 
actionpack-7.2.2.1/lib/action_dispatch/journey/router.rb:133:in `block in find_routes' 
actionpack-7.2.2.1/lib/action_dispatch/journey/router.rb:126:in `each' 
actionpack-7.2.2.1/lib/action_dispatch/journey/router.rb:126:in `find_routes' 
actionpack-7.2.2.1/lib/action_dispatch/journey/router.rb:34:in `serve' 
actionpack-7.2.2.1/lib/action_dispatch/routing/route_set.rb:896:in `call' 
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:35:in `call' 
rack-2.2.13/lib/rack/tempfile_reaper.rb:15:in `call' 
rack-2.2.13/lib/rack/conditional_get.rb:27:in `call' 
rack-2.2.13/lib/rack/head.rb:12:in `call' 
actionpack-7.2.2.1/lib/action_dispatch/http/permissions_policy.rb:38:in `call' 
/var/www/discourse/lib/content_security_policy/middleware.rb:12:in `call' 
/var/www/discourse/lib/middleware/anonymous_cache.rb:415:in `call' 
/var/www/discourse/lib/middleware/csp_script_nonce_injector.rb:12:in `call' 
/var/www/discourse/config/initializers/008-rack-cors.rb:14:in `call' 
rack-2.2.13/lib/rack/session/abstract/id.rb:266:in `context' 
rack-2.2.13/lib/rack/session/abstract/id.rb:260:in `call' 
actionpack-7.2.2.1/lib/action_dispatch/middleware/cookies.rb:704:in `call' 
actionpack-7.2.2.1/lib/action_dispatch/middleware/callbacks.rb:31:in `block in call' 
activesupport-7.2.2.1/lib/active_support/callbacks.rb:101:in `run_callbacks' 
actionpack-7.2.2.1/lib/action_dispatch/middleware/callbacks.rb:30:in `call' 
actionpack-7.2.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:31:in `call' 
actionpack-7.2.2.1/lib/action_dispatch/middleware/show_exceptions.rb:32:in `call' 
logster-2.20.1/lib/logster/middleware/reporter.rb:40:in `call' 
/var/www/discourse/lib/middleware/default_headers.rb:13:in `call' 
railties-7.2.2.1/lib/rails/rack/logger.rb:41:in `call_app' 
railties-7.2.2.1/lib/rails/rack/logger.rb:29:in `call' 
/var/www/discourse/config/initializers/100-quiet_logger.rb:20:in `call' 
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call' 
actionpack-7.2.2.1/lib/action_dispatch/middleware/request_id.rb:33:in `call' 
/var/www/discourse/lib/middleware/enforce_hostname.rb:24:in `call' 
rack-2.2.13/lib/rack/method_override.rb:24:in `call' 
actionpack-7.2.2.1/lib/action_dispatch/middleware/executor.rb:16:in `call' 
rack-2.2.13/lib/rack/sendfile.rb:110:in `call' 
rack-mini-profiler-3.3.1/lib/mini_profiler.rb:191:in `call' 
/var/www/discourse/lib/middleware/processing_request.rb:12:in `call' 
message_bus-4.4.1/lib/message_bus/rack/middleware.rb:60:in `call' 
/var/www/discourse/lib/middleware/request_tracker.rb:385:in `call' 
actionpack-7.2.2.1/lib/action_dispatch/middleware/remote_ip.rb:96:in `call' 
railties-7.2.2.1/lib/rails/engine.rb:535:in `call' 
railties-7.2.2.1/lib/rails/railtie.rb:226:in `public_send' 
railties-7.2.2.1/lib/rails/railtie.rb:226:in `method_missing' 
rack-2.2.13/lib/rack/urlmap.rb:74:in `block in call' 
rack-2.2.13/lib/rack/urlmap.rb:58:in `each' 
rack-2.2.13/lib/rack/urlmap.rb:58:in `call' 
unicorn-6.1.0/lib/unicorn/http_server.rb:634:in `process_client'
unicorn-6.1.0/lib/unicorn/http_server.rb:739:in `worker_loop'
unicorn-6.1.0/lib/unicorn/http_server.rb:547:in `spawn_missing_workers'
unicorn-6.1.0/lib/unicorn/http_server.rb:143:in `start'
unicorn-6.1.0/bin/unicorn:128:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/bin/unicorn:25:in `load' 
/var/www/discourse/vendor/bundle/ruby/3.3.0/bin/unicorn:25:in `<main>' 
infobacktraceenv
 Solve  Remove  Protect  Copy  Share
 Debug
 Info
  Warning
  Error
  Fatal
Search

 Clear logs

Hola chicos,

El traductor y el Ayudante del Foro están funcionando ahora, pero el botón de Resumir no desencadena nada.

No veo nada en mis registros de CloudWatch que indique que se haya activado alguna solicitud desde Discourse.

El resumidor está configurado con la Persona de Resumir, y la Persona está usando el punto final LLM que mencioné anteriormente en esta discusión…

¿Alguna sugerencia?

Muchas gracias y saludos,

WS

Nueva perspectiva:

Algunos temas se pueden resumir, otros no…

Parece que los nuevos se pueden resumir.
Y otra pregunta: Cuando tengo un tema con imágenes y no tengo ninguna IA de reconocimiento de imágenes implementada, ¿es esto un problema?

Ese es un 502 de tu propio endpoint :stuck_out_tongue:

¿La longitud del tema, tal vez?

Lo será para tareas relacionadas con imágenes, como la descripción de imágenes o la automatización de la clasificación de publicaciones.

1 me gusta

Hola @Falco

Pero Discourse ni siquiera inicia la solicitud, ni da ninguna razón (registros, …) por la que no lo hace :frowning:
Es difícil acotar mis opciones

No, no lo fue. Encontré el problema (no hice JSON.stringify del cuerpo del endpoint de llm, pero Discourse podría ser un poco más comunicativo sobre la razón de este 502 :-))

Gracias y saludos,

WS

1 me gusta