Skip to content

Commit

Permalink
Deployed b1cc572 with MkDocs version: 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
samos123 committed Jan 11, 2025
1 parent a5a0540 commit ed0c83d
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion how-to/configure-embedding-models/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ <h2 id="install-baaibge-small-en-v15-model-using-infinity">Install BAAI/bge-smal
<div class="highlight"><pre><span></span><code>helm<span class="w"> </span>install<span class="w"> </span>kubeai-models<span class="w"> </span>kubeai/models<span class="w"> </span>-f<span class="w"> </span>./kubeai-models.yaml
</code></pre></div>
<p>Once the pod is ready, you can use the OpenAI Python SDK to interact with the model:</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">openai</span> <span class="kn">import</span> <span class="n">OpenAI</span>
<div class="highlight"><pre><span></span><code><span class="kn">from</span><span class="w"> </span><span class="nn">openai</span><span class="w"> </span><span class="kn">import</span> <span class="n">OpenAI</span>
<span class="c1"># Assumes port-forward of kubeai service to localhost:8000.</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">OpenAI</span><span class="p">(</span><span class="n">api_key</span><span class="o">=</span><span class="s2">&quot;ignored&quot;</span><span class="p">,</span> <span class="n">base_url</span><span class="o">=</span><span class="s2">&quot;http://localhost:8000/openai/v1&quot;</span><span class="p">)</span>
<span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">embeddings</span><span class="o">.</span><span class="n">create</span><span class="p">(</span>
Expand Down
4 changes: 2 additions & 2 deletions how-to/configure-text-generation-models/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1512,8 +1512,8 @@ <h3 id="using-the-openai-python-sdk-to-interact-with-the-model">Using the OpenAI
<p>Once the pod is ready, you can use the OpenAI Python SDK to interact with the model:
All OpenAI SDKs work with KubeAI since the KubeAI service is OpenAI API compatible.</p>
<p>See the below example code to interact with the model using the OpenAI Python SDK:
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">openai</span> <span class="kn">import</span> <span class="n">OpenAI</span>
<div class="highlight"><pre><span></span><code><span class="kn">import</span><span class="w"> </span><span class="nn">os</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">openai</span><span class="w"> </span><span class="kn">import</span> <span class="n">OpenAI</span>
<span class="c1"># Assumes port-forward of kubeai service to localhost:8000.</span>
<span class="n">kubeai_endpoint</span> <span class="o">=</span> <span class="s2">&quot;http://localhost:8000/openai/v1&quot;</span>
<span class="n">model_name</span> <span class="o">=</span> <span class="s2">&quot;llama-3.1-8b-instruct-fp8-l4&quot;</span>
Expand Down
2 changes: 1 addition & 1 deletion reference/openai-api-compatibility/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ <h2 id="openai-client-libaries">OpenAI Client libaries<a class="headerlink" href
<p>You can use the official OpenAI client libraries by setting the
<code>base_url</code> to the KubeAI endpoint.</p>
<p>For example, you can use the Python client like this:
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">openai</span> <span class="kn">import</span> <span class="n">OpenAI</span>
<div class="highlight"><pre><span></span><code><span class="kn">from</span><span class="w"> </span><span class="nn">openai</span><span class="w"> </span><span class="kn">import</span> <span class="n">OpenAI</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">OpenAI</span><span class="p">(</span><span class="n">api_key</span><span class="o">=</span><span class="s2">&quot;ignored&quot;</span><span class="p">,</span>
<span class="n">base_url</span><span class="o">=</span><span class="s2">&quot;http://kubeai/openai/v1&quot;</span><span class="p">)</span>
<span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">chat</span><span class="o">.</span><span class="n">completions</span><span class="o">.</span><span class="n">create</span><span class="p">(</span>
Expand Down
64 changes: 32 additions & 32 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,130 +2,130 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.kubeai.org/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/benchmarks/llama-3.2-11b-vision/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/concepts/autoscaling/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/concepts/backend-servers/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/concepts/load-balancing/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/concepts/lora-adapters/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/concepts/resource-profiles/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/concepts/storage-caching/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/contributing/development-environment/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/contributing/documentation/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/contributing/release-process/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/architect-for-multitenancy/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/authenticate-to-model-repos/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/build-models-into-containers/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/cache-models-with-aws-efs/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/cache-models-with-gcp-filestore/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/configure-autoscaling/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/configure-embedding-models/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/configure-resource-profiles/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/configure-speech-to-text/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/configure-text-generation-models/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/install-models/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/how-to/serve-lora-adapters/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/installation/any/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/installation/eks/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/installation/gke/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/reference/kubernetes-api/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/reference/openai-api-compatibility/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/tutorials/langchain/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/tutorials/langtrace/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/tutorials/private-deep-chat/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
<url>
<loc>https://www.kubeai.org/tutorials/weaviate/</loc>
<lastmod>2025-01-03</lastmod>
<lastmod>2025-01-11</lastmod>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion tutorials/langchain/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ <h2 id="using-langchain">Using LangChain<a class="headerlink" href="#using-langc
from your local machine.</p>
<p>Let's create a simple Python script that uses LangChain and is connected to KubeAI.</p>
<p>Create a file named <code>test-langchain.py</code> with the following content:
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">langchain_openai</span> <span class="kn">import</span> <span class="n">ChatOpenAI</span>
<div class="highlight"><pre><span></span><code><span class="kn">from</span><span class="w"> </span><span class="nn">langchain_openai</span><span class="w"> </span><span class="kn">import</span> <span class="n">ChatOpenAI</span>

<span class="n">llm</span> <span class="o">=</span> <span class="n">ChatOpenAI</span><span class="p">(</span>
<span class="n">model</span><span class="o">=</span><span class="s2">&quot;gemma2-2b-cpu&quot;</span><span class="p">,</span>
Expand Down
8 changes: 4 additions & 4 deletions tutorials/langtrace/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1283,11 +1283,11 @@ <h1 id="deploying-kubeai-with-langtrace">Deploying KubeAI with Langtrace<a class
<div class="highlight"><pre><span></span><code><span class="c1"># Replace this with your langtrace API key by visiting http://localhost:3000</span>
<span class="n">langtrace_api_key</span><span class="o">=</span><span class="s2">&quot;f7e003de19b9a628258531c17c264002e985604ca9fa561debcc85c41f357b09&quot;</span>

<span class="kn">from</span> <span class="nn">langtrace_python_sdk</span> <span class="kn">import</span> <span class="n">langtrace</span>
<span class="kn">from</span> <span class="nn">langtrace_python_sdk.utils.with_root_span</span> <span class="kn">import</span> <span class="n">with_langtrace_root_span</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">langtrace_python_sdk</span><span class="w"> </span><span class="kn">import</span> <span class="n">langtrace</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">langtrace_python_sdk.utils.with_root_span</span><span class="w"> </span><span class="kn">import</span> <span class="n">with_langtrace_root_span</span>
<span class="c1"># Paste this code after your langtrace init function</span>

<span class="kn">from</span> <span class="nn">openai</span> <span class="kn">import</span> <span class="n">OpenAI</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">openai</span><span class="w"> </span><span class="kn">import</span> <span class="n">OpenAI</span>

<span class="n">langtrace</span><span class="o">.</span><span class="n">init</span><span class="p">(</span>
<span class="n">api_key</span><span class="o">=</span><span class="n">api_key</span><span class="p">,</span>
Expand All @@ -1298,7 +1298,7 @@ <h1 id="deploying-kubeai-with-langtrace">Deploying KubeAI with Langtrace<a class
<span class="n">model</span> <span class="o">=</span> <span class="s2">&quot;gemma2-2b-cpu&quot;</span>

<span class="nd">@with_langtrace_root_span</span><span class="p">()</span>
<span class="k">def</span> <span class="nf">example</span><span class="p">():</span>
<span class="k">def</span><span class="w"> </span><span class="nf">example</span><span class="p">():</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">OpenAI</span><span class="p">(</span><span class="n">base_url</span><span class="o">=</span><span class="n">base_url</span><span class="p">,</span> <span class="n">api_key</span><span class="o">=</span><span class="s2">&quot;ignored-by-kubeai&quot;</span><span class="p">)</span>
<span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">chat</span><span class="o">.</span><span class="n">completions</span><span class="o">.</span><span class="n">create</span><span class="p">(</span>
<span class="n">model</span><span class="o">=</span><span class="n">model</span><span class="p">,</span>
Expand Down
16 changes: 8 additions & 8 deletions tutorials/weaviate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1561,10 +1561,10 @@ <h3 id="weaviate-client-python-setup">Weaviate client Python Setup<a class="head
</code></pre></div></p>
<h3 id="collection-and-data-import">Collection and Data Import<a class="headerlink" href="#collection-and-data-import" title="Permanent link">&para;</a></h3>
<p>Create a file named <code>create-collection.py</code> with the following content:
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">json</span>
<span class="kn">import</span> <span class="nn">weaviate</span>
<span class="kn">import</span> <span class="nn">requests</span>
<span class="kn">from</span> <span class="nn">weaviate.classes.config</span> <span class="kn">import</span> <span class="n">Configure</span>
<div class="highlight"><pre><span></span><code><span class="kn">import</span><span class="w"> </span><span class="nn">json</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">weaviate</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">requests</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">weaviate.classes.config</span><span class="w"> </span><span class="kn">import</span> <span class="n">Configure</span>

<span class="c1"># This works due to port forward in previous step</span>
<span class="k">with</span> <span class="n">weaviate</span><span class="o">.</span><span class="n">connect_to_local</span><span class="p">(</span><span class="n">port</span><span class="o">=</span><span class="mi">8080</span><span class="p">,</span> <span class="n">grpc_port</span><span class="o">=</span><span class="mi">50051</span><span class="p">)</span> <span class="k">as</span> <span class="n">client</span><span class="p">:</span>
Expand Down Expand Up @@ -1604,8 +1604,8 @@ <h3 id="collection-and-data-import">Collection and Data Import<a class="headerli
<p>The collection is now created and data is imported. The vectors are generated by KubeAI and stored in Weaviate.</p>
<h3 id="semantic-search">Semantic Search<a class="headerlink" href="#semantic-search" title="Permanent link">&para;</a></h3>
<p>Now let's do semantic search, which uses the embeddings. Create a file named <code>search.py</code> with the following content:
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">weaviate</span>
<span class="kn">from</span> <span class="nn">weaviate.classes.config</span> <span class="kn">import</span> <span class="n">Configure</span>
<div class="highlight"><pre><span></span><code><span class="kn">import</span><span class="w"> </span><span class="nn">weaviate</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">weaviate.classes.config</span><span class="w"> </span><span class="kn">import</span> <span class="n">Configure</span>

<span class="c1"># This works due to port forward in previous step</span>
<span class="k">with</span> <span class="n">weaviate</span><span class="o">.</span><span class="n">connect_to_local</span><span class="p">(</span><span class="n">port</span><span class="o">=</span><span class="mi">8080</span><span class="p">,</span> <span class="n">grpc_port</span><span class="o">=</span><span class="mi">50051</span><span class="p">)</span> <span class="k">as</span> <span class="n">client</span><span class="p">:</span>
Expand All @@ -1630,8 +1630,8 @@ <h3 id="generative-search-rag">Generative Search (RAG)<a class="headerlink" href
<p>Now let's do generative search, which uses the generative model (Text generation LLM).
The generative model is run locally and managed by KubeAI.</p>
<p>Create a file named <code>generate.py</code> with the following content:
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">weaviate</span>
<span class="kn">from</span> <span class="nn">weaviate.classes.config</span> <span class="kn">import</span> <span class="n">Configure</span>
<div class="highlight"><pre><span></span><code><span class="kn">import</span><span class="w"> </span><span class="nn">weaviate</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">weaviate.classes.config</span><span class="w"> </span><span class="kn">import</span> <span class="n">Configure</span>

<span class="c1"># This works due to port forward in previous step</span>
<span class="k">with</span> <span class="n">weaviate</span><span class="o">.</span><span class="n">connect_to_local</span><span class="p">(</span><span class="n">port</span><span class="o">=</span><span class="mi">8080</span><span class="p">,</span> <span class="n">grpc_port</span><span class="o">=</span><span class="mi">50051</span><span class="p">)</span> <span class="k">as</span> <span class="n">client</span><span class="p">:</span>
Expand Down

0 comments on commit ed0c83d

Please sign in to comment.