/ examples / quickstart.py
quickstart.py
 1  """
 2  ARGUS-AI Quick Start Example
 3  
 4  3-line integration for LLM observability with G-ARVIS scoring.
 5  
 6  Author: Anil Prasad | Ambharii Labs
 7  """
 8  
 9  import argus_ai
10  
11  # --- 3-Line Setup ---
12  argus = argus_ai.init(profile="enterprise")
13  
14  # Evaluate a single LLM interaction
15  result = argus.evaluate(
16      prompt="What are the main causes of climate change?",
17      response=(
18          "The main causes of climate change include greenhouse gas emissions "
19          "from burning fossil fuels, deforestation, industrial processes, "
20          "and agricultural practices. Carbon dioxide and methane are the "
21          "primary greenhouse gases driving global warming."
22      ),
23      context=(
24          "Climate change is primarily driven by human activities that release "
25          "greenhouse gases into the atmosphere. The burning of fossil fuels "
26          "for energy is the largest source of emissions. Deforestation reduces "
27          "the planet's ability to absorb CO2."
28      ),
29      model_name="claude-sonnet-4",
30      latency_ms=1200.0,
31      input_tokens=45,
32      output_tokens=65,
33      cost_usd=0.003,
34  )
35  
36  # Inspect results
37  print(f"G-ARVIS Composite Score: {result.garvis_composite:.3f}")
38  print(f"  Groundedness:   {result.groundedness:.3f}")
39  print(f"  Accuracy:       {result.accuracy:.3f}")
40  print(f"  Reliability:    {result.reliability:.3f}")
41  print(f"  Variance:       {result.variance:.3f}")
42  print(f"  Inference Cost: {result.inference_cost:.3f}")
43  print(f"  Safety:         {result.safety:.3f}")
44  print(f"  Passing:        {result.passing}")
45  print(f"  Eval Latency:   {result.evaluation_ms:.1f}ms")
46  
47  if result.alerts:
48      print(f"\nAlerts:")
49      for alert in result.alerts:
50          print(f"  {alert}")
51  
52  # Quick score (lightweight)
53  score = argus.score(
54      prompt="Summarize this document",
55      response="The document discusses quarterly revenue trends.",
56      context="Q3 2024 revenue increased 12% year-over-year to $4.2B.",
57  )
58  print(f"\nQuick Score: {score}")