MCPcopy Create free account
hub / github.com/InferCore/InferCore / TestAdapterConformance_VLLM

Function TestAdapterConformance_VLLM

internal/adapters/conformance_test.go:31–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestAdapterConformance_VLLM(t *testing.T) {
32 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
33 switch r.URL.Path {
34 case "/health":
35 w.WriteHeader(http.StatusOK)
36 _, _ = w.Write([]byte(`{"status":"ok"}`))
37 case "/v1/chat/completions":
38 w.Header().Set("Content-Type", "application/json")
39 _ = json.NewEncoder(w).Encode(map[string]any{
40 "choices": []map[string]any{
41 {"message": map[string]any{"content": "hello from vllm"}},
42 },
43 })
44 default:
45 http.NotFound(w, r)
46 }
47 }))
48 defer srv.Close()
49
50 adapter := vllm.New(config.BackendConfig{
51 Name: "vllm-b",
52 Type: "vllm",
53 Endpoint: srv.URL,
54 TimeoutMS: 200,
55 Capabilities: []string{"chat"},
56 Cost: config.CostConfig{Unit: 2},
57 })
58 assertAdapterConformance(t, adapter)
59}
60
61func TestAdapterConformance_Anthropic(t *testing.T) {
62 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
assertAdapterConformanceFunction · 0.85
WriteHeaderMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected